[FFmpeg-user] [ffmpeg-users] How to get time stamp of closet k-frame before a given timestamp with ffmpeg?

Quy Pham Sy phamsyquybk at gmail.com
Wed Feb 20 05:48:00 CET 2013


I want a ffmpeg seeking command that fast and accurate. I found
this<http://ffmpeg.org/trac/ffmpeg/wiki/Seeking%20with%20FFmpeg>

The solution is that we apply -ss for both input (fast seeking) and output
(accurate seeking). The question is that if the input seeking is not
accurate how can we be sure that the seeking position is accurate.

For example: as the example used in the link, if we want to seek to
00:03:00, the command is something likes

ffmpeg -ss 00:02:30 -i ... -ss 00:00:30 As said, the first seeking will
seek to somewhere else not 00:02:30, say 00:02:31. and after applying
second seek, the final result would be 00:03:01- NOT what we want. Is that
correct?

Where does fist seeking seek to? Does it seek to k-frame that closet to
00:02:30?

If so, here is my thought, correct me if i'm wrong: after first seeking, we
get the timestamp of the result (in this example: 00:02:31), then we apply
second seeking with appropriate time, in this case 00:00:29.

Question is how do we get time stamp of first seeking's result?


More information about the ffmpeg-user mailing list