ffmpeg: unable to cut avi movie
I am using ffmpeg to cut v开发者_StackOverflow中文版ideo file:
ffmpeg -<InputFile> -ss 00:00:00 -t 00:00:30 <OutputFile>
It's OK for different file formats exclude *.avi format. For avi movies ffmpeg shows that video is truncated, but output file contains full video (without truncating). Does anybody know possible ways for problem troubleshooting?
Here converting command output for avi file:
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 1 2011 02:54:36 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 1 / 0.16. 1
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.93. 0 / 52.93. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1.74. 0 / 1.74. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg4 @ 0x91e7e10] Invalid and inefficient vfw-avi packed B frames detected
Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 25.00 (25/1)
Input #0, avi, from '/home/mightymeeting/Videos/tam-19.avi':
Duration: 00:04:43.32, start: 0.000000, bitrate: 564 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 352x208 [PAR 1:1 DAR 22:13], 25 fps, 25 tbr, 25 tbn, 30k tbc
Stream #0.1: Audio: mp3, 32000 Hz, 2 channels, s16, 80 kb/s
[buffer @ 0x91e6ed0] w:352 h:208 pixfmt:yuv420p
Output #0, avi, to 'out.avi':
Metadata:
ISFT : Lavf52.93.0
Stream #0.0: Video: mpeg4, yuv420p, 352x208 [PAR 1:1 DAR 22:13], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream #0.1: Audio: mp2, 32000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg4 @ 0x91e7e10] Invalid and inefficient vfw-avi packed B frames detected
frame= 7082 fps=999 q=2.0 Lsize= 7513kB time=30.02 bitrate=2049.8kbits/s dup=0 drop=1
video:7079kB audio:235kB global headers:0kB muxing overhead 2.718192%
Sounds like this may be a DivX file. Try
ffmpeg -i INPUT.avi -c copy -ss 00:00:00 -t 00:00:30 -bsf:v mpeg4_unpack_bframes OUTPUT.avi
From the documentation
DivX-style packed B-frames are not valid MPEG-4 and were only a workaround for the broken Video for Windows subsystem. They use more space, can cause minor AV sync issues, require more CPU power to decode (unless the player has some decoded picture queue to compensate the 2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like mp4 or mpeg-ps/ts, because MPEG-4 decoders may not be able to decode them, since they are not valid MPEG-4.
精彩评论