I've always wondered if better multi-core performance can come from processing different keyframe segments separately. IIUC all current encoders that support parallelism work by multiple threads working on the same frame at the same time. Often times the frame is split into regions and each thread focuses on a specific region of the frame. This approach can have a (usually small) quality/efficiency cost and requires…
Video codecs often encode the delta from the previous frame, and because this delta is often small, it's efficient to do it this way. If each thread needed to process the frame separately, you would need to make significant changes to the codec, and I hypothesize it would cause the video stream to be bigger in size.
FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
61–70 of 186 posts
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#62I'm using FFMPEG to encode MP3 with LAME for an audio hosting service and it would be great to improve encode times for long files.
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#63Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#64Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#65I've always wondered if better multi-core performance can come from processing different keyframe segments separately. IIUC all current encoders that support parallelism work by multiple threads working on the same frame at the same time. Often times the frame is split into regions and each thread focuses on a specific region of the frame. This approach can have a (usually small) quality/efficiency cost and requires…
your idea also doesn't work with live streaming, and may also not work with inter-frame filters (depending on implementation). nonetheless, this exists already with those limitations: av1an and I believe vapoursynth work more or less the way you describe, except you don't actually need to load every chunk into memory, only the current frames. as I understand, this isn't a major priority for mainstream encoding pipeli…
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#66Meanwhile, I've been enjoying threaded filter processing in VapourSynth for nearly a decade. Not that this isn't great. Its fantastic. But TBH its not really going to change my workflow of VapourSynth preprocessing + av1an encoding for "quality" video encodes.
I don't understand why you would want to piggyback on this story to say this. are people just itching for reasons to dive into show & tell or to wax poetic about how they have solved the problem for years ? I really don't understand people at all, because I don't understand why people do this. and I'm sure I've done it, too.
Hype for FEAT is beyond sensibility. People with similar FEAT are bristled by this and wish that their projects received even a fraction of FEAT's hype.
I think it's normal.
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#67Earlier quoted context omitted.
your idea also doesn't work with live streaming, and may also not work with inter-frame filters (depending on implementation). nonetheless, this exists already with those limitations: av1an and I believe vapoursynth work more or less the way you describe, except you don't actually need to load every chunk into memory, only the current frames. as I understand, this isn't a major priority for mainstream encoding pipeli…
It can work with live streaming, you just need to add N keyframes of latency. With low-latency livestreaming keyframes are often close together anyways so adding say 4s of latency to get 4x encoding speed may be a good tradeoff.
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#68Earlier quoted context omitted.
Video codecs often encode the delta from the previous frame, and because this delta is often small, it's efficient to do it this way. If each thread needed to process the frame separately, you would need to make significant changes to the codec, and I hypothesize it would cause the video stream to be bigger in size.
The parent comment referred to "keyframes" instead of just "frames". Keyframes—unlike normal frames—encode the full image. That is done in case the "delta" you mentioned could be dropped in a stream ending up with strange artifacts in the resulting video output. Keyframes are where the codec gets to press "reset".
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#69I've always wondered if better multi-core performance can come from processing different keyframe segments separately. IIUC all current encoders that support parallelism work by multiple threads working on the same frame at the same time. Often times the frame is split into regions and each thread focuses on a specific region of the frame. This approach can have a (usually small) quality/efficiency cost and requires…
Re: FFmpeg lands CLI multi-threading as its "most complex refactoring" in decades
#70Earlier quoted context omitted.
It can work with live streaming, you just need to add N keyframes of latency. With low-latency livestreaming keyframes are often close together anyways so adding say 4s of latency to get 4x encoding speed may be a good tradeoff.
4s of latency is not acceptable for applications like live chat