[Libav-user] Multithread decode and scaler

Nicolas George george at nsup.org
Fri Aug 19 12:40:24 EEST 2022


wolverin via Libav-user (12022-08-19):
> Everything is fine as long as the incoming and outgoing stream resolution is 640x480, but if the incoming is 1920x1080 and I do sws_scale, then decoding and scaling are very slow.
> If I run ffmpeg from the command line, I see swscale errors, which means that sws_getContext is called 20 times, which means a queue of 20 scaling threads is created

> 1. How to create a multithreading ffmpeg for sws_scale?
>  
> 2. Does internal multithreading work for mjpeg decoding, for example in AVCodecContext? If not, what is the best way to create multithreading for decoding?

Have you tried setting "threads" option to the sws_scale context? And to
the codec context?

See:

https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavfilter/vf_scale.c#l546

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220819/88e635b5/attachment.sig>


More information about the Libav-user mailing list