<HTML><BODY><div><div>Hi, thank you for reply!</div><div> </div><div>Here is my code for now:</div><div><div><div>   foreach (var videoFile in videoFiles)</div><div>            {</div><div>                fileSrc["location"] = videoFile;</div></div><div> </div><div><div>                readerPipe.SetState(State.Playing);</div></div><div> </div><div><div>                var step = 1; //fn тоже с 1 начинается</div><div>                while (step < frameNumber)</div><div>                {</div><div>                    appSink.PullSample();</div><div>                    step++;</div><div>                }</div></div><div> </div><div><div>                Debug.SetDefaultThreshold(DebugLevel.Debug);</div></div><div> </div><div><div>                readerPipe.SetState(State.Null);</div><div>                fileSrc.Unlink(decodebin);</div></div><div> </div><div><div>                fileSrc.Link(decodebin);</div><div>            }</div><div>        }</div></div></div><div> </div><div>Still it hangs on SetState(State.Null) with continous messages:</div><div><div><div>0:00:48.596434300 DEBUG             bufferpool gstbufferpool.c:312:do_alloc_buffer:<d3d11bufferpool2> max buffers reached</div><div>0:00:48.597077100DEBUG               GST_POLL gstpoll.c:1414:gst_poll_wait: 000001F550D09AE0: timeout :99:99:99.999999999</div></div><div> </div><div>It seems to be the reason of hang behaviour. I’ve added queue before appsink (filesrc ! decodebin ! queue ! appsink),</div><div>but still no luck.</div></div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Вторник, 8 августа 2023, 20:55 +03:00 от cfd new <newcfd@yahoo.com>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16915173440992823941_BODY"><div class="cl_577613"><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif; font-size:13px" class="ydpf6d9c46ayahoo-style-wrap_mr_css_attr"><div> </div><div>for question 1:</div><div>Steps:</div><div>1. set pipeline state to null</div><div>2. disconnect <span>decodebin ! appsink</span> from <span>filesrc</span></div><div>3. set new location to filesrc</div><div>4. reconnect <span><span>decodebin ! appsink</span> to <span>filesrc</span></span></div><div>5. set pipeline state to play</div></div><div id="yahoo_quoted_2084088024_mr_css_attr" class="yahoo_quoted_mr_css_attr"><div style="color:#26282a; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px"><div>On Monday, August 7, 2023, 08:45:50 a.m. EDT, Антон Шаров via gstreamer-devel <<a href="/compose?To=gstreamer%2ddevel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>> wrote:</div><div> </div><div> </div><div><div id="yiv4266842845_mr_css_attr"><div><div>Hi.</div><div> </div><div>I have following  pipeline filesrc ! decodebin ! appsink</div><div>By some condition I need to exctract some frame (cond. for now is exact frame number):</div><div><div><div>(here is code sample on C#)</div><div> </div><div><div><div>  var fileSrc = readerPipe.GetByName("filesrc");</div><div>   fileSrc["location"] = videoFile; // new file to read from</div></div></div><div> </div><div>   var appSink = (AppSink) readerPipe.GetByName("my_appsink");</div><div>   readerPipe.SetName($"file {videoFile} frame_stepper");</div><div>   var q = readerPipe.SetState(State.Playing);</div></div><div>   var step = 1;</div><div><div>   while (step < frameNumber)</div><div>        {</div><div>            appSink.PullSample();</div><div>            step++;</div><div>        }</div><div> </div><div>The questions:</div><ol><li>It seems that it doesn’t matter what video file is set, it will always read from first setuped file. How to reset pipeline to read from new file? Should I create new pipeline or can I reset given pipeline so it can read from given file?</li><li>What is the best and fastest pipeline to read frame-by-frame from file ? Maybe the one above is not goot,  maybe playbin + appsink is better?</li></ol><div>Thanks in advance.</div></div></div><div> </div><div> </div></div></div></div></div></div></div></div></div></div></div></blockquote> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>С Уважением,<br>Шаров Антон</div></div></div><div> </div></div></BODY></HTML>