Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: szlldm on January 21, 2021, 03:56:12 PM

Title: [lavcodec] Multithreaded decoding
Post by: szlldm on January 21, 2021, 03:56:12 PM
Is there a particular reason, that multithreading is not enabled in decoding?
I tried MT with h.265 and 264, didnt see any error. But decoding speed was way faster.
(Only have sw decoding capabilities, no HW accel.)

Thank you!
Title: Re: [lavcodec] Multithreaded decoding
Post by: eumagga0x2a on January 21, 2021, 10:30:25 PM
Multithreading is incompatible with HW accel implementation in Avidemux. It would be trivial to avoid using HW decoder when MT is enabled, but this easy solution collapses when MT gets enabled prior to appending a video but after the first video was loaded (with hw decoder used). The preview is not refreshed. Trying to find out why.
Title: Re: [lavcodec] Multithreaded decoding
Post by: szlldm on January 22, 2021, 01:49:23 AM
So it would be possible, to create a copy of preferences at Avidemux start, then decide from these parameters, if MT can be enabled (HW decoder disabled and/or HW decoder not available)?
Only drawback, that changing these parameters would require restart.
Title: Re: [lavcodec] Multithreaded decoding
Post by: eumagga0x2a on January 22, 2021, 02:43:55 AM
I've pushed a highly experimental change which enables lavc MT by default to speed up evaluation on different platforms. I'll back it out at the first sign of trouble.
Title: Re: [lavcodec] Multithreaded decoding
Post by: szlldm on January 22, 2021, 02:10:45 PM
Thank you very much!
Tested with various samples from https://kodi.wiki/view/Samples. Did not encounter errors yet.
Also tested appending, i patched up very different samples together (x264, x265, vp9 (this uses single thread decoder),  also 8bit and 10bit hdr).

Unrelated to the topic:
Among the sample videos, the 4k / 21. ProRes HDR DCI-P3 Strobe Scientist is loading but decoded into garbage (rainbow noise), regardless of this commit.