[FFmpeg-user] extracting a subclip, -ss and -t options do not work as expected

Michael Woywod m.woywod at hff-potsdam.de
Mon Aug 15 15:36:12 CEST 2011


Hello,

I want to trim a video via ffmpeg cli.
First obstacle, I detected was the order of parameters. Now I place -ss 
and -t before the -i option and get a valid output at least. This output 
still is not the subclip, i want to extract from the input file.

I got a recent build of ffmpeg -> ffmpeg -version:
ffmpeg N-31774-g6c4e9ca
libavutil    51. 11. 1 / 51. 11. 1
libavcodec   53.  9. 1 / 53.  9. 1
libavformat  53.  6. 0 / 53.  6. 0
libavdevice  53.  2. 0 / 53.  2. 0
libavfilter   2. 28. 0 /  2. 28. 0
libswscale    2.  0. 0 /  2.  0. 0
libpostproc  51.  2. 0 / 51.  2. 0

The input is a 10 seconds video h264, created with ffmpeg via:
ffmpeg -i original.mov -y -r 25 -vcodec libx264 -s 640x360 -sameq 
-maxrate 1500k -bufsize 500k first_transcode.mp4

following calls produce results:

ffmpeg.exe -ss 5 -t 2 -i first_transcode.mp4 -y -vcodec copy -acodec 
copy first_trimmed_5_2.mp4
-> 7 seconds subclip, starting from 00:00:00 of the input-clip
ffmpeg.exe -ss 00:00:05.000 -t 00:00:02.000 -i first_transcode.mp4 -y 
-vcodec copy -acodec copy first_trimmed_5_2.mp4
-> same result
When playing around with numbers, the result seems to be more like: -ss 
0 -t (ss+t). This even works, if the values for -ss are negative (-ss -6 
-t 8 returns a 2sec clip, starting from 0 of the input file)

Without -ss, the -t option seems to work fine, but i have no option to 
trim the first part of the clip. I'm looking for a sollution to 
precisely trim my clips via ffmpeg CLI for a while now but don't get it 
working. Any help would be greatly apreciated. I didn't find information 
regarding known bugs or useful examples for CLI usage yet.

Best Regards
Michael


More information about the ffmpeg-user mailing list