<div dir="ltr"><div>IP cameras are full linux machines and usually run an NTP dameon. some cheat and just force sync every hour.</div><div>The most common transport for video is RTSP which describes a series of RTP streams.</div><div>   This has a standard that within 2 seconds and every 5 seconds after that, sends a SENDER REPORT as part of the rtcp protocol on the channel+1 or port+1</div><div>   In this there is a mapping from NTP time to the streams RTP timestamp which is in a faster clock, for H264/5 it is a 90khz clock.<br></div><div>The RTP client code stores the offset at connect time to the one optionally provided in the Play response or the clients wall clock time.</div><div>The RTCP SR are then used to adjust the offset making the video live, timestamped to the wallclock of the client.</div><div>RTCP allows an ongoing and already connected stream to adjust the timestamps as NTP adjustments come to the camera, thur the rtsp session without needing to re-connect<br></div><div><br></div><div>If you want actual camera side time, other than seeing it in On Screen Display, you need the RTP extension protocol used for replayed video.</div><div><br></div><div>Onvif uses this for example and on page 27 there is a pretty good explanation</div><div><br></div><div><a href="https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf">https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf</a></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 29, 2022 at 12:56 PM Joshua Quesenberry via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</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 class="msg8345836362617373720"><div style="overflow-wrap: break-word;" lang="EN-US"><div class="m_8345836362617373720WordSection1"><p class="MsoNormal">Good Afternoon All,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I’m looking into IP cameras right now and trying to understand how to accurately determine when a frame was captured. Hopefully some of you all have dealt with this and can give me some guidance? I have a couple different scenarios, each of which I want to be able to know the UTC time of when the frame was captured by the camera or at the very least when the packet hits a Linux box’s kernel.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 1: USB Camera -> Linux Box 1 via v4l2src.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 2: USB Camera -> Linux Box 1 via v4l2src -> Network via rtpbin (RTP/RTCP) -> Linux Box 2 via rtpbin.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 3: GigE Camera RAW Stream -> Linux Box 1 via The Imaging Source element (tcamsrc).<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 4: GigE Camera RAW Stream -> Linux Box 1 via The Imaging Source element (tcamsrc) -> Network via rtpbin (RTP/RTCP) -> Linux Box 2 via rtpbin.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 5: IP Camera H264 Stream with NTP Sync every 60min -> Linux Box 1 via rtspsrc element.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Scenario 6: IP Camera H264 Stream with NTP Sync every 60min -> Linux Box 1 via rtspsrc element -> Network via rtpbin (RTP/RTCP) -> Linux Box 2 via rtpbin.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Is what I’m looking for possible in all of these scenarios?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">When using the timeoverlay element, when are time-mode == elapsed-running-time (4) and time-mode == reference-timestamp (5) available?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">When using the identity element with silent=false, is there a way to print to the screen the content of GstBuffers meta data? Seems like from reading this may contain some time elements I’d be interested in?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Can RTP/RTCP/RTSP propagate UTC capture time information or does it get lost early on in the pipeline across multiple Linux boxes?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">All of my systems and the IP Cameras above should be looking at a local NTP Server instance at this point, so hopefully that will help things? It looks like the GigE cameras can’t talk to an NTP server.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks!<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Josh Q<u></u><u></u></p></div></div></div></blockquote></div>