<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 28, 2019 at 8:10 AM George Hawkins <<a href="mailto:gstreamer@beta-engine.net">gstreamer@beta-engine.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If I use the filesrc element to playback a video file I can retrieve data like this on a per frame basis:<br><br>    index=0, timestamp=832000000, stream-time=0<br>    index=1, timestamp=870000000, stream-time=38000000<br>    ...<br><br>But what is the first timestamp above relative to? How can I retrieve a real-world start time such that I can combine it with this timestamp in order to calculate the real-world time at which the frame was captured?<br><br>I control the original file capture process as well as the playback but I haven't found how to capture and recover the start time that I need for combining with timestamps in this way.<br><br>Currently, I capture the video file like so:<br><br>    gst-launch-1.0 nvarguscamerasrc \<br>        ! 'video/x-raw(memory:NVMM), width=3280, height=2464, framerate=21/1' \<br>        ! nvjpegenc \<br>        ! matroskamux \<br>        ! filesink location=out.mkv<br><br>I can change the container and video format if this makes it easier to encode and recover the start time later. I can obviously get an _approximate_ start time by recording the time at which the pipeline started - but I'd prefer something more precise (and _if possible_ I'd prefer that the value was encoded somewhere in the resulting video file rather than stored separately).<br><br>I've used GST_DEBUG to see if I could see anything that looked like a start time when replaying the file but didn't spot anything.<br><br>And if I look at the file with a tool like mediainfo the only date I see is:<br><br>    Encoded date : UTC 2019-07-24 19:20:42<br><br>TL;DR - when recording my video file how do I capture and later recover a value that can be combined with a relative timestamp value (like the one for index 0 up above) to give the real world time at which the frame was captured.</div></blockquote><div><br></div><div>Why can't you generate an epoch (UTC) on a per frame basis? That's what I do with 'nvcamerasrc' at least. I read its timestamp it stores from the ISP as well as generate my own epoch when the frame is received in the pipeline (see identity's "handoff" signal).<br></div><div><br></div><div>I mean you have to define "start time" precisely here too.<br></div><div><br></div><div>-aps<br></div></div></div>