<HTML><BODY><div><div>Thanks for the answer.</div><div> </div><div><strong>Yes, I tried to configure for mjpeg</strong></div><div> </div><div><div><div>    if (!(pInpCdcCtx = avcodec_alloc_context3(pInpCdc)))</div><div>    {</div><div>        PrintError("Error allocate decoder context", (rt = AVERROR(ENOMEM)));</div><div>        return rt;</div><div>    }</div><div>    pInpCdcCtx->thread_count = 4;</div></div></div><div> </div><div><div><div><strong>and after your answer I added</strong></div></div></div><div> </div><div><div><div>        if (!(pSwsCtx = sws_getContext(pInpCdcCtx->width, pInpCdcCtx->height, pInpCdcCtx->pix_fmt,</div><div>                                    pOutCdcCtx->width, pOutCdcCtx->height, pOutCdcCtx->pix_fmt,</div><div>                                    SCALE_FLAGS, NULL, NULL, NULL)))</div><div>        {</div><div>            PrintError("Error initialize the conversion context", (rt = AVERROR(ENOMEM)));</div><div>            return rt;</div><div>        }</div><div>        else</div><div>            <strong>av_opt_set_int(pSwsCtx, "threads", 20, 0);</strong></div></div></div><div> </div><div><strong>But there is no effect, what am I doing wrong?</strong></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16609020380225801005_BODY">Have you tried setting "threads" option to the sws_scale context? And to<br>the codec context?<br><br>See:<br><br><a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavfilter/vf_scale.c#l546" target="_blank">https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavfilter/vf_scale.c#l546</a></div></div></div></div></blockquote> <div> </div></div></BODY></HTML>