ffmpeg在mac下编译

mac下x86_64:

./configure --disable-everything --disable-yasm  --extra-ldflags=-L/usr/local/lib/ --extra-cflags=-I/usr/local/include/ --extra-libs=-lmp3lame --enable-decoder=mp3 --enable-protocol=file --enable-bsf=mp3_header_decompress --enable-demuxer=mp3 --enable-muxer=mp3 --enable-encoder=libmp3lame --enable-decoder=cook --enable-demuxer=rm --enable-muxer=rm --enable-decoder=wmav2 --enable-decoder=wmav1 --enable-decoder=wmalossless --enable-decoder=wmavoice --enable-decoder=wmapro --enable-decoder=amr_nb_at --enable-decoder=amrnb --enable-decoder=amrwb --enable-demuxer=amr --enable-muxer=amr --enable-decoder=aac --enable-decoder=mpeg4 --enable-encoder=aac --enable-encoder=mpeg4 --enable-parser=aac --enable-parser=aac_latm --enable-bsf=aac_adtstoasc --enable-bsf=mpeg4_unpack_bframes --enable-muxer=mp4 --enable-demuxer=aac --enable-filter=amerge --enable-filter=aresample --enable-filter=volume --enable-filter=volumedetect --enable-filter=silencedetect --enable-filter=silenceremove --enable-libmp3lame

ios下armv7和arm64:

集成lame时出现的问题:

1. 找不到lame路径,原因是由于默认路径出现问题,在源码中,#include是尖括号,所以需要指定include和lib的路径,才可以解决问题,路径为/usr/local/include 和 /usr/local/lib

2. 需要将lame的头文件放入lame文件夹中,lame的库也要加入,同时还要添加--enable-muxer=mp3 --enable-encoder=libmp3lame --enable-libmp3lame,用于使ffmpeg添加lame的同时,加入muxer和encoder。

3. 使用build-ffmpeg.sh,修改其中的内容为

    ./configure --disable-everything --disable-yasm  --extra-ldflags=-L/Users/chen/Documents/lame-ios-build-master/fat-lame/lib/  --extra-cflags=-I/Users/chen/Documents/lame-ios-build-master/fat-lame/include/  --extra-libs=-lmp3lame --enable-decoder=mp3 --enable-protocol=file --enable-bsf=mp3_header_decompress --enable-demuxer=mp3 --enable-muxer=mp3 --enable-encoder=libmp3lame --enable-decoder=cook --enable-demuxer=rm --enable-muxer=rm --enable-decoder=wmav2 --enable-decoder=wmav1 --enable-decoder=wmalossless --enable-decoder=wmavoice --enable-decoder=wmapro --enable-decoder=amr_nb_at --enable-decoder=amrnb --enable-decoder=amrwb --enable-demuxer=amr --enable-muxer=amr --enable-decoder=aac --enable-decoder=mpeg4 --enable-encoder=aac --enable-encoder=mpeg4 --enable-parser=aac --enable-parser=aac_latm --enable-bsf=aac_adtstoasc --enable-bsf=mpeg4_unpack_bframes --enable-muxer=mp4 --enable-demuxer=aac --enable-filter=amerge --enable-filter=volume --enable-filter=volumedetect --enable-filter=silencedetect --enable-filter=silenceremove --enable-libmp3lame

新增mp4解码和重采样

--enable-demuxer=rtsp --enable-filter=aresample

你可能感兴趣的:(ffmpeg在mac下编译)