See also:
* https://ffmpeg.guide/ — create complex FFmpeg filtergraphs quickly and correctly
* https://www.hadet.dev/ffmpeg-cheatsheet/ — clipping, adding fade in/out, scaling, concat, etc
* https://ffmpeg.guide/ — create complex FFmpeg filtergraphs quickly and correctly
* https://www.hadet.dev/ffmpeg-cheatsheet/ — clipping, adding fade in/out, scaling, concat, etc
It's also an issue in the original post.
Seeking the container is usually much faster than decoding and then throwing away what you don't need, but it has fatal flaw: most videos use p-frames and thus require you to decode the frames before it.
So, say you want to skip to 60 seconds in. The solution is to do "-ss 50 -i input.mkv -ss 10", which is fast and should get the keyframes you need.
https://ffmpeg.org/ffmpeg-all.html#toc-Main-options
-ss position (input/output)
When used as an input option (before -i), seeks in this input file to
position. Note that in most formats it is not possible to seek exactly, so
ffmpeg will seek to the closest seek point before position. When transcoding
and -accurate_seek is enabled (the default), this extra segment between the
seek point and position will be decoded and discarded. When doing stream copy
or when -noaccurate_seek is used, it will be preserved.
When used as an output option (before an output url), decodes but discards
input until the timestamps reach position....which becomes obvious once you notice that options apply either to one of the inputs or output.