FFmpegCmdSdk
Introduction: ffmpeg and ffprobe android command line tools ffprobe 线程和 ffmpeg 线程独立运行
Tags:
ffmpeg-ffprobe-video-视频转码-转码-视频---
FFMPEG(4.1.3 官网 2019-07-05 最新版本)
- ffmpeg 日志回调接口
- ffmpeg 增加监听百分比进度(需要获取转码后视频的总时间 具体看 demo)
ffmpeg 需要单例运行 如:转码 mp4 CPU 利用率 80%以上 其它视频不低于 60%间波动 (冬天暖手宝)
FFPROBE
- ffprobe 只实现了返回 json 回调
- ffprobe 线程和 ffmpeg 线程独立运行
注意编解码器
``` 如果编码器全开放 库文件就太大了 解码器全部放开了 但是编码器只有 aac 和 libx264 所以大部分手机基本都支持了 --disable-encoders --enable-encoder=aac --enable-encoder=libx264 --enable-encoder=png --enable-encoder=mjpeg
如果对编码器有特殊需求的可以重新编译库文件 重新裁剪编码器解决问题
## review runing
<image src="./img/222.gif" width="500px"/>
## Gradle
implementation 'com.yyl.ffmpeg:ffmpeg_cmd:4.1.3'
目前支持的库 armeabi-v7a arm64-v8a 也可以参考 build_android.sh 脚本定制 ndk { abiFilters "armeabi-v7a","arm64-v8a" }
## java Code
//ffprobe -v error -print_format json -select_streams v:0 -show_entries stream=width,height,index inputFile String cmd = "ffprobe -v quiet -print_format json -show_format -i " +inputFile; String json = FFmpegUtils.getInstance().execffprobe(cmd);
String cmd = "ffmpeg -h"
int code = FFmpegUtils.getInstance().execffmpeg(cmd,callback);
```