FFmpegCmdSdk

Additional

Language
C
Version
N/A
Created
Oct 17, 2017
Updated
Jul 15, 2019 (Retired)
Owner
yuyunlong (mengzhidaren)
Contributor
yuyunlong (mengzhidaren)
1
Activity
Badge
Generate
Download
Source code

#ffmpeg and ffprobe android command line tools

FFMPEG(4.1.3 官网2019-07-05最新版本)

  1. ffmpeg日志回调接口
  2. ffmpeg增加监听百分比进度(需要获取转码后视频的总时间 具体看demo)
ffmpeg需要单例运行  
如:转码mp4 CPU利用率80%以上 其它视频不低于60%间波动  (冬天暖手宝)

FFPROBE

  1. ffprobe 只实现了返回 json 回调
  2. ffprobe线程和ffmpeg线程独立运行

注意编解码器

如果编码器全开放 库文件就太大了
解码器全部放开了 但是编码器只有aac 和 libx264  所以大部分手机基本都支持了
--disable-encoders 
--enable-encoder=aac 
--enable-encoder=libx264 
--enable-encoder=png 
--enable-encoder=mjpeg

如果对编码器有特殊需求的可以重新编译库文件
重新裁剪编码器解决问题

review runing

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);
    

####编译版本号官网2019-07-05最新版本ffmpeg和h264

License

MIT License.