<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 14 févr. 2020 14 h 15, Ilya Aleshkov <<a href="mailto:ilya.aleshkov@gmail.com">ilya.aleshkov@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'd like to make my seeking process as interactive as possible.</div><div>In general everything works. I'm able to preview and record streams from webcams from my C++ code.</div><div>Recording pipeline equivalent looks like:<br></div><div><br></div><div>gst-launch-1.0 -e v4l2src device=/dev/video0 ! "video/x-raw, ..." ! videoconvert ! x264enc ! matroskamux ! filesink location=filename.mkv</div><div><br></div><div>or (using NVIDIA's hardware-accelerated NVENC encoder API)<br></div><div><br></div><div>gst-launch-1.0 -e v4l2src device=/dev/video0 ! "video/x-raw, ..." ! videoconvert ! nvh264enc ! h264parse ! matroskamux ! filesink location=filename.mkv</div><div><br></div><div>It's not hard to playback my recordings with playbin and seek:</div><div><br>gst_element_get_state(m_pipeline, nullptr, nullptr, GST_CLOCK_TIME_NONE); // This trick make seeking much more interactive</div><div>gst_element_seek(m_pipeline, 1.0, GST_FORMAT_TIME,<br>                  (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),<br>                  GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);</div><div><br></div><div></div><div>But even using <span>NVDEC I'm not happy with performance. It's not bad at all, but not smartphone-like smooth. </span>What can I do to dramatically improve it?</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The trick you use make sense, at least is simple. Each time you do a flushing seek, there is a lost state, so you end up ensuring that last seek is completed before issuing next one. You could do the same by using bus messages, that would allow for better compression of the seek location.</div><div dir="auto"><br></div><div dir="auto">My usual approach is to have a state, so when user grabs the seek handle, I enable scrubbing mode. In this mode I issue a seek each time the previous seek completes, I usually don't select accurate seek for speed. Then when the seek handle is released, I issue a flushing seek immediately with accurate flag this time.</div><div dir="auto"><br></div><div dir="auto">That being said, GStreamer often lack a bit of optimization in term of seek performance, contribution are welcome.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span><i><br></i></span></div><div><span><i><br></i></span></div><div>Environment: Ubuntu 19.10 / Intel Core i7-2600 / GeForce GTX 1050 Ti / SSD</div><div><br></div><div>Thanks,</div><div>Ilya<br></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>