<HTML><BODY><div>Hi!</div><div> </div><div>Thank you for reply!</div><div> </div><div>>just set up appsink to be sync=false, pull preroll / samples (wait for<br>>signals only if you don't want to block), do your processing, rinse /<br>>repeat.</div><div> </div><div>I did as you advised (add sync=false) and call PullPreroll in a loops — <a href="https://gist.github.com/sharov-am/e895575c8d21753b77f2fa73d9b7ba1e">https://gist.github.com/sharov-am/e895575c8d21753b77f2fa73d9b7ba1e</a> and it blocks on appsink.PullPreroll or NewSample.</div><div>I’ve tried to set pipe into playing or paused state — nothing, not a single event raised…</div><div> </div><div>What is the difference between PullPreroll and NewSample in this specific approach?</div><div> </div><div>>frame-stepping doesn't need to enter the picture here,</div><div> </div><div>Then what for it is usefull? I thought it is manual frame iterating, step by step. Than what it is useful</div><div>for?</div><div> </div><div>Thanks in advance.</div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Четверг, 27 июля 2023, 14:49 +03:00 от Mathieu Duponchelle <mathieu@centricular.com>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16904585711573615162_BODY">As Nicolas said, frame-stepping doesn't need to enter the picture here,<br>just set up appsink to be sync=false, pull preroll / samples (wait for<br>signals only if you don't want to block), do your processing, rinse /<br>repeat.<br><br>On Thu, 2023-07-27 at 00:31 +0300, Антон Шаров via gstreamer-devel<br>wrote:<div class="mail-quote-collapse">> Thank you for reply, Nicolas!<br>> <br>> > The question is ambiguous, since MP4 containers can contains<br>> > multiple streams and metadata. Do you want to read each >video<br>> > frame of the first video frame ? Do you want these to be coded or<br>> > decoded ? All this is important, because before >pulling this data<br>> > into your application (I would suggesting using appsink element),<br>> > you will have to design the right pipeline.<br>> <br>> I don’t quite understand your clarification because I’m quite new to<br>> this domain. I split rtsp stream into mp4 files via<br>> rtsp ! h264depay ! h264parse ! splitmuxsink location=… max-time-<br>> size=5 seconds .<br>> Given camera with 15 fps and ~5 sec. video I suppose that I need to<br>> iterate over 75 frames. So it is unclear to me what you mean by<br>> «video frame of the first frame». Keyframe and it’s subframes or I-<br>> frame and sequential p-frames or all GOP’s in a file. I need to<br>> extract timestamp for each frame and find the most accurate frame<br>> for a given timestamp.<br>> My pipe for this is filesrc ! decodebin ! appsink, where I hope to<br>> handle new-sample or preroll event for each frame (buffer contents ==<br>> frame).<br>> <br>> > Frame stepping is unlikely what you are a looking for.<br>> <br>> I supposed that it means just manual iteration over frames in video<br>> file — step by step. Like loop with opencv. <br>> <br>> > Среда, 26 июля 2023, 22:42 +03:00 от Nicolas Dufresne<br>> > <<a href="/compose?To=nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>>:<br>> > <br>> > Hi,<br>> > <br>> > Le mercredi 26 juillet 2023 à 18:48 +0300, Антон Шаров via<br>> > gstreamer-devel a écrit :<br>> > > Hi.<br>> > > <br>> > > Where I can find example of reading mp4 file frame by frame, so<br>> > > it was equivalent to OpenCv code like:<br>> ><br>> > <br>> > The question is ambiguous, since MP4 containers can contains<br>> > multiple streams and metadata. Do you want to read each video frame<br>> > of the first video frame ? Do you want these to be coded or decoded<br>> > ? All this is important, because before pulling this data into your<br>> > application (I would suggesting using appsink element), you will<br>> > have to design the right pipeline.<br>> > <br>> > Nicolas<br>> > <br>> > > <br>> > > while(cap.isOpened()):<br>> > > # Capture frame-by-frame<br>> > > ret, frame = cap.read()<br>> > > <br>> > > I saw this frame stepping<br>> > > example https://fossies.org/linux/gstreamer/tests/examples/steppi<br>> > > ng/framestep1.c<br>> > > and . I’ve tried to recreate this example on gstreamer-sharp and<br>> > > here is my approach:<br>> > > <a href="https://gist.github.com/sharov-am/78949b8866235ca14112818385893152" target="_blank">https://gist.github.com/sharov-am/78949b8866235ca14112818385893152</a><br>> ><br>> > <br>> > Frame stepping is unlikely what you are a looking for.<br>> > <br>> > > <br>> > > And of course it doesn’t work. I’ve read this doc<br>> > > (<a href="https://gstreamer.freedesktop.org/documentation/additional/desig" target="_blank">https://gstreamer.freedesktop.org/documentation/additional/desig</a><br>> > > n/framestep.html?gi-language=c#frame-stepping)<br>> > > and got from it that there are two main very important<br>> > > parameters like flush and intermediate and sequnce of events:<br>> > > 2 step start and 1 step done. Also I expected that appsink<br>> > > preroll or new-sample event would be raised, but nothing<br>> > > happens.<br>> > > <br>> > > My expectations are: I raise step event, some machinery happens<br>> > > and eventually I handle appsink preroll or new-sample<br>> > > events with needed frame buffer with actual frame. And it<br>> > > continues till EOS (end of file).<br>> > > So, what I’m doing wrong?<br>> > > <br>> > > Also, I’ve noticed that my pipe has WARN messages like<br>> > > <br>> > > WARN basesrc<br>> > > gstbasesrc.c:3132:gst_base_src_loop:<filesrc> error: Internal<br>> > > data stream error.<br>> > > WARN basesrc<br>> > > gstbasesrc.c:3132:gst_base_src_loop:<filesrc> error: streaming<br>> > > stopped, reason not-linked (-1)<br>> > > but I’m not sure that this is the cause…<br>> > ><br>> > > Thanks in advance.<br>> > > <br>> > > <br>> > > <br>> ><br>> > <br>> > <br>> <br>> <br>> --<br>> С Уважением,<br>> Шаров Антон<br>> </div></div></div></div></div></blockquote><div> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>С Уважением,<br>Шаров Антон</div></div></div><div> </div></div></BODY></HTML>