[FFmpeg-user] Understanding the behavior of "-ss/-t" option

Nitish Prabhu nitishsprabhu at gmail.com
Fri Sep 8 08:08:29 EEST 2017


Hi,

Does FFmpeg apply the option "-ss/-t" based on container time stamp
information, or is it based on bit stream timing information?

I generated a stream with a 60 second start offset using the following command:
$ ffmpeg -itsoffset 60 -i input_clip_x264.mp4 -c copy input_clip_x264_offset.mp4

I tried to seek to a particular time in the generated stream using the
following:
$ ffmpeg -ss 60 -t 10 -i input_clip_x264_offset.mp4 -copyts -filter:v
"select=between(t\,60.000\,70.000)" -c:v libx264 offset_extract.mp4

I see that no frames are extracted in the above command. Using
ffprobe, I checked that the frame timestamps start from 60 in the clip
with offset (input_clip_x264_offset.mp4). So, in theory, this had to
work. If I run the above command with "-ss 0", I see that it is able
to extract frames.

Thus, I wanted to understand how seeking works under the hood in FFmpeg.

Thanks!

Best Regards,
Nitish


More information about the ffmpeg-user mailing list