ffmpeg linux下命令行将h264文件转换成MP4格式

 先交叉编译

 

裁减自己需要的ffmpeg选项:

./configure \
--enable-shared \
--disable-static \
--prefix=../ffmpeg_4.0.2_output \
--enable-cross-compile \
--disable-swresample \
--disable-swscale \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--disable-avdevice \
--disable-symver \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vdpau \
--disable-videotoolbox \
--disable-protocols \
--disable-hwaccels \
--disable-indevs \
--disable-iconv \
--disable-v4l2-m2m \
--disable-xlib \
--disable-outdevs \
--disable-encoders \
--disable-decoders \
--disable-filters \
--disable-bsfs \
--disable-muxers \
--disable-demuxers \
--disable-parsers \
--enable-bsf=hevc_mp4toannexb \
--enable-bsf=h264_mp4toannexb \
--enable-bsf=aac_adtstoasc \
--enable-muxer=mp4 \
--enable-demuxer=mov \
--enable-parser=hevc \
--enable-parser=h264 \
--disable-symver \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vdpau \
--disable-videotoolbox \
--disable-protocols \
--disable-hwaccels \
--disable-indevs \
--disable-iconv \
--disable-v4l2-m2m \
--disable-xlib \
--disable-outdevs \
--disable-encoders \
--disable-decoders \
--disable-filters \
--disable-bsfs \
--disable-muxers \
--disable-demuxers \
--disable-parsers \
--enable-bsf=hevc_mp4toannexb \
--enable-bsf=h264_mp4toannexb \
--enable-bsf=aac_adtstoasc \
--enable-muxer=mp4 \
--enable-demuxer=mov \
--enable-parser=hevc \
--enable-parser=h264 \
--enable-parser=aac \
--disable-postproc \
--enable-protocol=file \
--cc=/usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-gcc \
--cxx=/usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-g++ \
--cross-prefix=/usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu- \
--arch=aarch64 \
--target-os=linux

./configure --disable-yasm --enable-gpl --enable-nonfree --prefix=/ud/build/lq_work/arm_ffmpeg211 --enable-cross-compile --cross-prefix=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf- --cc=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc --arch=arm  --target-os=linux

make && make install

将其ffmpeg拷贝到开发板,在开发板上直接运行ffmpeg(./ffmpeg -h查看选项)

./ffmpeg  -i 123.mp4_A_0105065433_e5fecca2.h264 -vcodec copy -f mp4 test.mp4

 

 

ffmpeg下载地址:使用版本3.4.2

http://ffmpeg.org/download.html

 

你可能感兴趣的:(ffmpeg linux下命令行将h264文件转换成MP4格式)