Position does not reflect currently displayed video frame

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Position does not reflect currently displayed video frame

Andy Devar
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.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel