[Libav-user] Multithread decode and scaler

wolverin wolverin82 at mail.ru
Fri Aug 19 13:14:32 EEST 2022

Thanks for the answer.
Yes, I tried to configure for mjpeg
    if (!(pInpCdcCtx = avcodec_alloc_context3(pInpCdc)))
        PrintError("Error allocate decoder context", (rt = AVERROR(ENOMEM)));
        return rt;
    pInpCdcCtx->thread_count = 4;
and after your answer I added
        if (!(pSwsCtx = sws_getContext(pInpCdcCtx->width, pInpCdcCtx->height, pInpCdcCtx->pix_fmt,
                                    pOutCdcCtx->width, pOutCdcCtx->height, pOutCdcCtx->pix_fmt,
                                    SCALE_FLAGS, NULL, NULL, NULL)))
            PrintError("Error initialize the conversion context", (rt = AVERROR(ENOMEM)));
            return rt;
             av_opt_set_int(pSwsCtx, "threads", 20, 0);
But there is no effect, what am I doing wrong?
>Have you tried setting "threads" option to the sws_scale context? And to
>the codec context?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220819/34797954/attachment.htm>

More information about the Libav-user mailing list