移植ffmpeg到i.mx6ull
交叉編譯x264
x264源碼:
x264-master.tar.gz: https://url91.ctfile.com/f/10165491-822116167-b4ee73?p=5623 (訪問密碼: 5623)
交叉編譯命令:
tar -xvf x264-master.tar.gz
cd x264-master
./configure ?–enable-shared –enable-static –host=arm-linux-gnueabihf –cross-prefix=arm-linux-gnueabihf- ??–disable-opencl –enable-pic –disable-asm –prefix=$PWD/_install
make
make install
?
交叉編譯ffmpeg
ffmpeg源碼:
ffmpeg-snapshot.tar.bz2: https://url91.ctfile.com/f/10165491-822116638-b1eaad?p=5623 (訪問密碼: 5623)
tar -xjf ffmpeg-snapshot.tar.bz2
cd ffmpeg
把extra-cflags和extra-cflags替換成自己安裝的絕對(duì)路徑
./configure –cross-prefix=arm-linux-gnueabihf- –enable-cross-compile –target-os=linux –cc=arm-linux-gnueabihf-gcc –arch=arm –prefix=$PWD/_install –enable-shared –disable-static –enable-gpl –enable-nonfree –disable-ffplay –enable-swscale –enable-pthreads –disable-armv5te –disable-armv6 –disable-armv6t2 –disable-x86asm –disable-stripping –enable-libx264 –extra-cflags=-I/home/xl/files/alpha/test/x264-master/_install/include –extra-ldflags=-L/home/xl/files/alpha/test/x264-master/_install/lib –extra-libs=-ldl
Makefile?38 行新增?:?CFLAGS += -fPIC
make
make install
復(fù)制庫和可執(zhí)行程序
復(fù)制x264-master/_install 和ffmpeg/_install內(nèi)容到開發(fā)板
路徑分別為: ?/root/x264 ?/root/ffmpeg
最后新增profile文件,內(nèi)容如下:
export PATH=”/root/ffmpeg/bin:$PATH”
export LD_LIBRARY_PATH=/root/x264/lib/:/root/ffmpeg/lib:
執(zhí)行
ffmpeg -i 202199103339.flv -vcodec copy -acodec copy 202199103339.mp4