Encode a video into segments #2063
Unanswered
danielkonecny
asked this question in
1. Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am encoding a video with FFV1 to preserve as much quality as possible (16-bit pixel depth) but have at least some compression to save disk space. Since the encoded videos turn out to be in lower hundreds of GBs in size, I would like to split them into multiple segments while encoding. I am dealing only with one video stream, nothing more, no audio/subtitles.
The ffmpeg command that I would like to imitate is:
ffmpeg -i input.mkv -c:v copy -segment_time 60 -f segment -segment_list segments.m3u8 output%03d.mkv(Of course, my input is different, it's in NumPy arrays, that's why I'm using PyAV.)
My current code is very similar to the "Generating Video" example from docs, see below, I simplified it to match the example better. I would like to extend it with the segments-related commands:
I can imagine splitting the video into segments on my own simply by encoding a new video each time. But since ffmpeg is able to do so in such a simple way, I am interested whether PyAV enables this too. Is such segmentation available in PyAV and if so, can someone please help me extend my code for such use-case. I wasn't able to find any example that would implement this.
Beta Was this translation helpful? Give feedback.
All reactions