我正在使用 ffmpeg 转换我网站上的视频。我正在将所有视频转换为 flv 。如果我上传 flv ,它没有问题,但如果我上传除 flv 之外的任何其他文件类型,它会显示此错误:
ffmpeg version 0.7.11, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 26 2013 01:58:02 with gcc 4.4.7 20120313 (Red Hat 4.4.7-3)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvorbis
--enable-libopencore-amrnb --enable-libopencore-amrwb libavutil 50. 43. 0 / 50. 43. 0 libavcodec 52.123. 0 / 52.123. 0 libavformat 52.111. 0 / 52.111. 0
libavdevice 52. 5. 0 / 52. 5. 0 libavfilter 1. 80. 0 / 1. 80. 0 libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0
Seems stream 0 codec frame rate differs from container frame rate: 2997.00 (2997/1) -> 14.99 (15000/1001)
Input #0, avi, from 'uploads/v_37.avi':
Metadata: title : AJ McLean - Teenage Wildlife encoder : Lavf52.16.0
Duration: 00:04:17.19, start: 0.000000, bitrate: 470 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 14.98 fps, 14.99 tbr, 14.99 tbn, 2997 tbc
Stream #0.1: Audio: mp3, 22050 Hz, stereo, s16, 128 kb/s
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
[buffer @ 0x2137ae0] w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param: [scale @ 0x2139da0] w:640 h:480 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
Output #0, flv, to 'uploads/aaa.flv': Metadata: title : AJ McLean - Teenage Wildlife encoder : Lavf52.111.0
Stream #0.0: Video: flv, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1k tbn, 14.99 tbc Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, s16, 0 kb/s
Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
frame= 26 fps= 0 q=2.0 Lsize= 80kB time=00:00:01.73 bitrate= 375.7kbits/s video:64kB audio:14kB global headers:0kB muxing overhead 2.339835%
最后一行是:复用开销 2.339835%
最终文件是一个 1 秒的视频(视频的长度没有任何区别,它们都变成了一个 1 秒的视频)
问题是什么 ?这是转换视频的 ffmpeg 代码:
echo passthru("$ffmpegpath -i uploads/$file -ar 22050 -ab 32 -f flv -s 320×240 uploads/aaa.flv 2>&1");