[FFmpeg-devel] [FEATURE] Cut a video (-ss) with timings non-aligned on keyframes, with minimal re-encoding
basj at gget.it
basj at gget.it
Tue Aug 20 15:13:37 EEST 2024
>> More generally, which is the recommanded way to cut a video with a specific starting point and specific length, with minimal re-encoding?
>> Millions of hours of CPU-time are probably wasted to reencode already-perfectly-encoded content, just for cutting ;)
>
>Only do remux without transcoding, and let mp4 muxer use editlist to strip the timeline from IDR to the requested start time.
>The preroll at the beginning can be slow when playback, but seeking also has the same preroll
>
>Other choice is use multiple groups of SPS/PPS in mp4 sample description. We have that support in mp4 demuxer, but not
>in muxer. It’s standard in specification but not widely supported. So if we add support to muxer and it works with our own
>demuxer, it’s not surprise to experience a lot of compatibility issues with other software.
Thank you Zhao for your answer.
Is there a feature already available in ffmpeg to use one of your 2 solutions?
Or is someone already working on this topic? (if so, can I join this feature development?)
In any case, if someone has a solution, many people are looking for a solution for this, either here: https://stackoverflow.com/questions/63548027/cut-a-video-in-between-key-frames-without-re-encoding-the-full-video-using-ffpme (closed),
or here: https://superuser.com/questions/1850814/how-to-cut-a-video-with-ffmpeg-with-no-or-minimal-re-encoding.
It would help many people if a ffmpeg-expert could help on this :)
All the best.
More information about the ffmpeg-devel
mailing list