<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1496784149470_3491"><br></div><div id="yui_3_16_0_1_1496784149470_3491">To simplify my problem, I've modified an existing FFmpeg code sample. My modified code sample generates a .ts file containing mp2v video (no audio), but I cannot figure out why parallel encoding will not work (well, the ffmpeg library will not call back into my custom execute callback funcs).  <br></div><div id="yui_3_16_0_1_1496784149470_3490" dir="ltr"><br><a href="https://pastebin.com/y1kae2fu" id="yui_3_16_0_1_1496784149470_3553" class="edited-link-editor">https://pastebin.com/y1kae2fu</a></div><div class="qtdSeparateBR" id="yui_3_16_0_1_1496784149470_3456"><div id="yui_3_16_0_1_1496784149470_3748"><br></div><div id="yui_3_16_0_1_1496784149470_3748"><br></div><div id="yui_3_16_0_1_1496784149470_3748">If you run the code sample and insert a debugger breakpoint in the custom 'execute'/'execute2' function, you will note that the user-defined functions are never called by the encoder even though parallel encoding is explicitly enabled.</div><div id="yui_3_16_0_1_1496784149470_3748"><br></div><div id="yui_3_16_0_1_1496784149470_3748"><br></div><div id="yui_3_16_0_1_1496784149470_3748">Gavin. </div><div dir="ltr" id="yui_3_16_0_1_1496784149470_3749"><br></div></div><div class="yahoo_quoted" id="yui_3_16_0_1_1496784149470_3395" style="display: block;">  <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_1_1496784149470_3394"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;" id="yui_3_16_0_1_1496784149470_3393"> <div dir="ltr" id="yui_3_16_0_1_1496784149470_3454"> <font size="2" face="Arial" id="yui_3_16_0_1_1496784149470_3453"> <hr size="1" id="yui_3_16_0_1_1496784149470_3455"> <b><span style="font-weight:bold;">From:</span></b> Gavin Smith <gcs584-at-yahoo.com@ffmpeg.org><br> <b><span style="font-weight: bold;">To:</span></b> "libav-user@ffmpeg.org" <libav-user@ffmpeg.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, 1 June 2017, 15:29<br> <b><span style="font-weight: bold;">Subject:</span></b> [Libav-user] User-specified execute/execute2 function in mpeg2     video encoder<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1496784149470_3392"><br><div id="yiv8272439783"><div id="yui_3_16_0_1_1496784149470_3391"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_1_1496784149470_3390"><div id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2703" dir="ltr">I'm attempting to set the mpeg2video encoder to use the threads within my existing thread pool.  I'm encoding SD interlaced PAL content, but I cannot seem to get the encoder to callback into my user-defined execute function(s). To keep things simple, I have tried testing the callbacks with GDB before attempting to post the work to my thread pool.</div><div id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2703" dir="ltr"><br></div><div id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2703" dir="ltr">I have attached a link to a code snippet to provide some insight on how the encoder is being configured.</div><div id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2703"><br></div><div id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2749">https://pastebin.com/qLZ6ZYMy</div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2751"></div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750">Note: In the code snippet provided, the code detects that threads may be used in conjunction with slices.</div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br></div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br>Admittedly, there are a few fields which are linked, yet they do add for some confusion.  The trunk docs are a bit sparse on the first two (2) fields.  I may try update the docs if I can retrieve some additional information. </div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"> * AVCodecContext::thread_type<br> * AVCodecContext::active_thread_type<br> * AVCodec::capabilities</div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br><br></div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750">Any tips/suggestions would be much appreciated...</div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br></div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750"><br></div><div dir="ltr" id="yiv8272439783yui_3_16_0_ym19_1_1496325783993_2750">Gavin.</div></div></div></div>_______________________________________________<br>Libav-user mailing list<br><a ymailto="mailto:Libav-user@ffmpeg.org" href="mailto:Libav-user@ffmpeg.org" id="yui_3_16_0_1_1496784149470_3489">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank" id="yui_3_16_0_1_1496784149470_3742">http://ffmpeg.org/mailman/listinfo/libav-user</a><br><br><br></div> </div> </div>  </div></div></body></html>