Position does not reflect currently displayed video frame
Andy Devar
andy.devar at gmail.com
Sat Nov 7 18:01:39 UTC 2020
Hi,
Pipeline:
filesrc location=Video.mkv ! matroskademux name=src ! h264parse !
d3d11h264dec ! d3d11convert ! d3d11videosink name=overlay
If this pipeline is paused, and you get the current position, this position
does not reflect the video frame currently displayed by the video sink.
gint64 pos;
gst_element_query_position(pipeline_, GST_FORMAT_TIME, &pos))
If you then do an accurate seek to this position, the next frame displayed
won't be the same as before doing the seek, but a few frames before.
gst_element_seek(pipeline_, 1.0, GST_FORMAT_TIME,
(GstSeekFlags)(GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH),
GST_SEEK_TYPE_SET, pos, GST_SEEK_TYPE_NONE, 0);
I suspect that the sink stops rendering frames later than the time stops
advancing.
I've also observed that whenever you change the pipeline's state from
playing to paused, the next video frame is immediately output - no matter
how much time has elapsed since displaying the previous frame. This is
easily reproducible if the playback rate is low (let's say 0.02) and you
pause the pipeline just after a new frame has been displayed.
So, how can I get a time which reflects exactly the video frame currently
displayed?
And how can I prevent that future frames are output when pausing the
pipeline?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201107/3f6512b6/attachment.htm>
More information about the gstreamer-devel
mailing list