How do you splice out a part of an xvid encoded avi file, with ffmpeg? (no problems with other files)
Posted
by
user11955
on Super User
See other posts from Super User
or by user11955
Published on 2010-06-05T02:57:28Z
Indexed on
2012/06/12
10:42 UTC
Read the original article
Hit count: 252
Im using the following command, which works for most files, except what seems to be xvid encoded ones
/usr/bin/ffmpeg -sameq -i file.avi -ss 00:01:00 -t 00:00:30 -ac 2 -r 25 -copyts output.avi
So this should basically splice out 30 seconds of video + audio, starting from 1 minute mark.
It does START encoding at the 00:01:00 mark but it goes all the way to the end of the file for some reason, ignoring that I want just 30 seconds.
The output looks like this.
FFmpeg version git-ecc4bdd, Copyright (c) 2000-2010 the FFmpeg developers
built on May 31 2010 04:52:24 with gcc 4.4.3 20100127 (Red Hat 4.4.3-4)
configuration: --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-libopenjpeg --enable-libfaac --enable-libvorbis --enable-gpl --enable-nonfree --enable-libxvid --enable-pthreads --enable-libfaad --extra-cflags=-fPIC --enable-postproc --enable-libtheora --enable-libvorbis --enable-shared
libavutil 50.15. 2 / 50.15. 2
libavcodec 52.67. 0 / 52.67. 0
libavformat 52.62. 0 / 52.62. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg4 @ 0x17cf770]Invalid and inefficient vfw-avi packed B frames detected
Input #0, avi, from 'file.avi':
Metadata:
ISFT : VirtualDubMod 1.5.10.2 (build 2540/release)
Duration: 00:02:00.00, start: 0.000000, bitrate: 1587 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 672x368 [PAR 1:1 DAR 42:23], 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
File 'lol6.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'lol6.avi':
Metadata:
ISFT : Lavf52.62.0
Stream #0.0: Video: mpeg4, yuv420p, 672x368 [PAR 1:1 DAR 42:23], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream #0.1: Audio: mp2, 48000 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 @ 0x17cf770]Invalid and inefficient vfw-avi packed B frames detected
[buffer @ 0x184b610]Buffering several frames is not supported. Please consume all available frames before adding a new one.
frame= 1501 fps=104 q=0.0 Lsize= 15612kB time=30.02 bitrate=4259.7kbits/s ts/s
video:15303kB audio:235kB global headers:0kB muxing overhead 0.482620%
if I convert this file to mp4 for example, and then perform the same action, it works perfectly.
© Super User or respective owner