|
交叉编译ffmpeg实现h264文件转mp4文件测试
[复制链接]
本帖最后由 37°男人 于 2015-8-26 15:07 编辑
1、ffmpeg源文件下载
http://ffmpeg.org/download.html
( 测试版本为 : ffmpeg version 2.1.1 )
2、交叉编译
./configure --disable-yasm --enable-gpl --enable-nonfree --prefix=/opt/80_debug/install/ffmpeg211_arm --enable-cross-compile --cross-prefix=arm-hisiv300-linux- --cc=arm-hisiv300-linux-gcc --arch=arm --target-os=linux
make
make install
|
3、把编译的执行文件copy到开发板上面,或者是直接挂载到开发板上面,测试运行
# ./ffmpeg
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 25 2015 09:09:35 with gcc 4.8.3 (Hisilicon_v300) 20131202 (prerelease)
configuration: --disable-yasm --enable-gpl --enable-nonfree --prefix=/opt/80_debug/install/ffmpeg211_arm --enable-cross-compile --cross-prefix=arm-hisiv300-linux- --cc=arm-hisiv300-linux-gcc --arch=arm --target-os=linux
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
|
4、转换h264文件为mp4文件
# ./ffmpeg -i Tid0.h264 -vcodec copy -f mp4 test.mp4
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 25 2015 09:09:35 with gcc 4.8.3 (Hisilicon_v300) 20131202 (prerelease)
configuration: --disable-yasm --enable-gpl --enable-nonfree --prefix=/opt/80_debug/install/ffmpeg211_arm --enable-cross-compile --cross-prefix=arm-hisiv300-linux- --cc=arm-hisiv300-linux-gcc --arch=arm --target-os=linux
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 0x223cd50] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'Tid0.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709), 2048x1536, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf55.19.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 2048x1536, q=2-31, 25 fps, 1200k tbn, 1200k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 542 fps=298 q=-1.0 Lsize= 22969kB time=00:00:21.64 bitrate=8695.0kbits/s
video:22966kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.013807%
# ls
Tid0.h264 ffmpeg ffprobe ffserver test.mp4
# ls -lh
total 74512
-rw-r--r-- 1 root root 22.4M Aug 25 2015 Tid0.h264
-rwxr-xr-x 1 root root 9.6M Aug 25 2015 ffmpeg
-rwxr-xr-x 1 root root 9.5M Aug 25 2015 ffprobe
-rwxr-xr-x 1 root root 8.8M Aug 25 2015 ffserver
-rw-r--r-- 1 root root 22.4M Aug 25 2015 test.mp4
|
注:测试环境为hi3516a 平台进行测试,技术交流 ternence.hsu@foxmail.com
|
|