Video seeking. Best practices
Ilya Aleshkov
ilya.aleshkov at gmail.com
Fri Feb 14 18:09:31 UTC 2020
Hi,
I'd like to make my seeking process as interactive as possible.
In general everything works. I'm able to preview and record streams from
webcams from my C++ code.
Recording pipeline equivalent looks like:
gst-launch-1.0 -e v4l2src device=/dev/video0 ! "video/x-raw, ..." !
videoconvert ! x264enc ! matroskamux ! filesink location=filename.mkv
or (using NVIDIA's hardware-accelerated NVENC encoder API)
gst-launch-1.0 -e v4l2src device=/dev/video0 ! "video/x-raw, ..." !
videoconvert ! nvh264enc ! h264parse ! matroskamux ! filesink
location=filename.mkv
It's not hard to playback my recordings with playbin and seek:
gst_element_get_state(m_pipeline, nullptr, nullptr, GST_CLOCK_TIME_NONE);
// This trick make seeking much more interactive
gst_element_seek(m_pipeline, 1.0, GST_FORMAT_TIME,
(GstSeekFlags) (GST_SEEK_FLAG_FLUSH |
GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE,
GST_CLOCK_TIME_NONE);
But even using NVDEC I'm not happy with performance. It's not bad at all,
but not smartphone-like smooth. What can I do to dramatically improve it?
Environment: Ubuntu 19.10 / Intel Core i7-2600 / GeForce GTX 1050 Ti / SSD
Thanks,
Ilya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200214/69904831/attachment.htm>
More information about the gstreamer-devel
mailing list