FFMpeg那些事——独立运行的二进制文件ffmpeg编译

想编译一个Android可用的二进制文件(要求:支持libx264/liblamemp3)

 

github资源:

    1.首先编译一个带lame库的ffmpeg

    https://github.com/aksalj/ffmpeg-android

    好了一次编译通过这个包之后你会发现多了ffmpeg、 ffmplay等二进制文件,关键是参考这边的配置文件confi.sh,这个达不到楼主的需要我们还需要libx264包

    2.先下载下面的 资源文件

    包含@x264的资源包 如果想要省事,请直接 git clone xxxx  -recursive(迭代下载所有引用资源文件)

    https://github.com/Cheers-Dev/android-ffmpeg

    3.拷贝x264包到步骤一中的根目录

     拷贝old下的config_x264.sh 和 make_x264.sh到步骤一目录并分别执行下 这样x264目录下会产生x264.a的静态文件留待下一步编译使用

    4.修改config.sh  

    --extra-ldflags=" -L${ARM_LIB} -L${MP3LAME}/lib" \ 修改为

 

    --extra-ldflags=" -L${ARM_LIB} -L${MP3LAME}/lib -L../x264" \

     同理增加cflag参数: --extra-cflags=" -I../x264" \

    放开libx264

    -enable libx264 \

    -enable statics \

    -disable shared \

    -disable ffmplay \

    -enable ffmpeg \

  ok,执行编译 如无意外您在 build/bin下面会发现 期待已久的ffmpeg大概12M左右

 

  注意:由于这是在win下发的博客,所以配置文件没有详细贴出,

    在这里我只是提供下我的解决思路,祝大家好运!

    

 

参考文档:-qscale的用法

    https://trac.ffmpeg.org/wiki/Encode/MPEG-4

    freetype2 not fond error! (下面给出了解决方案)

    https://github.com/jdpxiaoming/ffmpeg-android

        

安卓的用法 /data/data/com.xx.xx/ffmpeg -y -%03d.jpeg ...

 

    

 

注意及错误处理:

  1)ERROR: libmp3lame >= 3.98.3 not found

  编译器环境为 对应的platform/aroid-9/arch-arm/usr (lib/include)

  将我们的 lame对应头文件和.a拷贝到上面的编译目录即可。

 

转载于:https://www.cnblogs.com/poe-blog/p/4269950.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Getting help: -h -- print basic options -h long -- print more options -h full -- print all options (including all format and codec specific options, very long) See man ffmpeg for detailed description of the options. Print help / information / capabilities: -L show license -h topic show help -? topic show help -help topic show help --help topic show help -version show version -buildconf show build configuration -formats show available formats -devices show available devices -codecs show available codecs -decoders show available decoders -encoders show available encoders -bsfs show available bit stream filters -protocols show available protocols -filters show available filters -pix_fmts show available pixel formats -layouts show standard channel layouts -sample_fmts show available audio sample formats -colors show available color names -sources device list sources of the input device -sinks device list sinks of the output device Global options (affect whole program instead of just one file: -loglevel loglevel set logging level -v loglevel set logging level -report generate a report -max_alloc bytes set maximum size of a single allocated block -y overwrite output files -n never overwrite output files -stats print progress report during encoding -max_error_rate ratio of errors (0.0: no errors, 1.0: 100% error maximum error rate -bits_per_raw_sample number set the number of bits per raw sample -vol volume change audio volume (256=normal) Per-file main options: -f fmt force format -c codec codec name -codec codec
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值