3 ms·
This indeed does snap to keyframes when input seeking is used. On output seeking, it cuts the video at the exact time, but there isn't enough information to re
by nosoop 7y ago
This indeed does snap to keyframes when input seeking is used. On output seeking, it cuts the video at the exact time, but there isn't enough information to rebuild the image as it's still a truncated copy of the stream.
It's possible to reencode a (h264-encoded, at least) video up to the first keyframe; it's discussed in this StackExchange submission: https://video.stackexchange.com/a/23542 https://video.stackexchange.com/a/23542
Coincidentally, I refined the above approach very recently and posted the result to my own blog: https://csrd.science/blag/2020/trimming-an-h264-video-and-preserving-most-of-the-original-video-stream.html https://csrd.science/blag/2020/trimming-an-h264-video-and-pr...
The gist is to extract and reencode the segment containing the group of pictures to be cut (using the stream segment muxer), then rejoin the subsequent segments and remux the trimmed audio back in afterwards.
- bscphil 7y agoNice work! Would definitely like to see the complete write up and code you talk about at the end, especially if you manage to test it on mkv or mp4 containers.