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

Nitish Prabhu nitishsprabhu at gmail.com
Fri Sep 8 09:23:41 EEST 2017


On Fri, Sep 8, 2017 at 11:13 AM, Gyan <gyandoshi at gmail.com> wrote:
> wrote:

> You'll want to use the seek_timestamp option.
>
> As it says in the docs,
>
> "-seek_timestamp (*input*)
>

I tried using "-seek_timestamp" prior to posting this, but was not
really sure if this works on MP4 files. I used ffprobe to get the
first pts of the offset stream and used this with "-ss" option.

Following is the output of ffprobe for the first frame of
"input_clip_x264_offset.mp4", the clip where offset was introduced:
[FRAME]
media_type=video
key_frame=1
pkt_pts=921923
pkt_pts_time=60.021029
pkt_dts=921923
pkt_dts_time=60.021029
best_effort_timestamp=921923
best_effort_timestamp_time=60.021029
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=48
pkt_size=123379
width=1920
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]

Following is the command that I used to seek with timestamp value:
$ ffmpeg -seek_timestamp 1 -ss 60.021029 -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 do not see any change in the behavior with the above command. It
does not seek to the required timestamp.


More information about the ffmpeg-user mailing list