<HTML><BODY><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><span style="font-family: var(--vkui--octavius_font_family_global,var(--vkui--font_family_base,Helvetica,Arial,sans-serif)); letter-spacing: var(--vkui--font_text--letter_spacing--regular,normal);">libavfilter is a little harder to set up (but not that much if you have</span></div></div>only one input and one output), but it can take care of more issues at<br>once.</blockquote><div> </div><div>I set the threads like this</div><div> </div><div><div><div>        if ((rt = avfilter_graph_create_filter(&pFltCtxBufSink, pFltBufSink, "out", NULL, NULL, pFltGph)) < 0)</div><div>        {</div><div>            PrintError("Error create buffer sink", rt);</div><div>            return rt;</div><div>        }</div><div>        pFltCtxBufSink->nb_threads = 10;</div><div>        pFltCtxBufSink->graph->nb_threads = pFltCtxBufSink->nb_threads;</div><div> </div></div></div><div>Now I see swscaler warnings 40 times, why? ffmpeg gives out only 20</div><div> </div><div>       [swscaler @ 0x1a2aa00] [swscaler @ 0x1bf6ab0] deprecated pixel format used, make sure you did set range correctly</div><div> </div><div>Scaling has accelerated by about 3 times, but it's still slow (about 50 ms, it was 130)</div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">I do not know if it supports it. Try setting the threads options on it<br>too.</blockquote><div> </div><div>Probably the mjpeg decoder does not support threads.</div><div>Don't work</div><div> </div><div>    av_dict_set(&pDicInp, "threads", "10", 0);</div><div><div>    AVDictionary * opts = NULL;</div><div>    av_dict_copy(&opts, pDicInp, 0);</div><div>    rt = avformat_open_input(&pFmtCtxInp, device, pInpFmt, &opts);</div><div> </div><div>OR</div><div> </div><div><div><div>    if (!(pCdcCtxInp = avcodec_alloc_context3(pCdcInp)))</div><div>    {</div><div>        PrintError("Error allocate decoder context", (rt = AVERROR(ENOMEM)));</div><div>        return rt;</div><div>    }</div><div>    pCdcCtxInp->thread_count = 10;</div></div></div><div> </div></div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Also try to use the command-line tool to see if multithreading is indeed<br>used.</blockquote><div> </div><div>Please explain what it is about?</div><div> </div><div> <div> </div></div></BODY></HTML>