GNOME Bugzilla – Bug 767105
timeoverlay: Add time-line property options "clock-time" and "render-time"
Last modified: 2018-11-03 11:46:47 UTC
Created attachment 328880 [details] [review] patch 1/3 timeoverlay: Add time-line property options "clock-time" and "render-time" These are useful for debugging and latency measurements: * clock-time is the time on the `GstPipeline` clock. * render-time is the clock time at which the frame will actually be displayed taking into account the latency of the pipeline. This is relevant for live pipelines. My use-case for this is measuring the latency of video-capture devices and TVs. By using a `GstSystemClock` with a `CLOCK_REALTIME` clock running on a Raspberry Pi I'm hoping to take latency measurements. I couldn't think of a way to create an automated test for this without introducing a bunch of unacceptable dependencies (in stb-tester we would use OCR), so I've tested manually with the below program: int main(int argc, char* argv[]) { GstElement * epipeline; GstPipeline * pipeline; GstClock* clock; struct timespec ts; int res; gst_init(&argc, &argv); epipeline = gst_parse_launch( "videotestsrc is-live=true pattern=white " "! video/x-raw,width=1280,height=720 " "! timeoverlay time-mode=render-time " "! timeoverlay deltay=30 time-mode=clock-time " "! xvimagesink", NULL); g_return_val_if_fail (epipeline != NULL, 1); pipeline = GST_PIPELINE(epipeline); gst_element_set_state(epipeline, GST_STATE_READY); clock = g_object_new (GST_TYPE_SYSTEM_CLOCK, "clock-type", GST_CLOCK_TYPE_REALTIME, NULL); gst_pipeline_use_clock(pipeline, clock); gst_pipeline_set_latency(pipeline, GST_SECOND); res = clock_gettime(CLOCK_REALTIME, &ts); g_return_val_if_fail (res == 0, 1); printf("Start time: %i:%02i:%02i.%03i\n", ts.tv_sec / 60 / 60, ts.tv_sec / 60 % 60, ts.tv_sec % 60, ts.tv_nsec / 1000000); gst_element_set_state(epipeline, GST_STATE_PLAYING); usleep(30*1000000); gst_element_set_state(epipeline, GST_STATE_NULL); }
Created attachment 328881 [details] [review] patch 2/3
Created attachment 328882 [details] [review] patch 3/3
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/271.