v4l2, v4l2src and GstReferenceTimestampMeta

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

v4l2, v4l2src and GstReferenceTimestampMeta

Philippe De Muyter
Hello all,

since gstreamer 1.14, there is a way to associate in a gstreamer pipeline
reference timestamps to each frame.

As expressed by Sebastian (slomo),
[https://marc.info/?l=gstreamer-cvs&m=149458219511878&w=2]

 buffer: Add GstReferenceTimestampMeta
 
 This is a meta that generically allows to attach additional reference
 timestamps to a buffer, that don't have to relate to the pipeline clock
 in any way.
 
 Examples of this could be an NTP timestamp when the media was captured,
 a frame counter on the capture side or the (local) UNIX timestamp when
 the media was captured.
 
 Examples of valid references would be "timestamp/x-drivername-stream"
 for timestamps that are locally generated by some driver named "drivername"
 when generating the stream, e.g. based on a frame counter, or
 "timestamp/x-ntp, host=pool.ntp.org,port=123" for timestamps based on a
 specific NTP server.

I would expect the v4l2src plugin to add such a timestamp to each frame
using information coming from the v4l2 driver, especially if the driver
provides UTC or TAI timestamps generated in the kernel.

How far are we from that goal ?

Best regards

Philippe De Muyter

--
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2, v4l2src and GstReferenceTimestampMeta

Nicolas Dufresne-5
Le jeudi 28 janvier 2021 à 18:12 +0100, Philippe De Muyter a écrit :

> Hello all,
>
> since gstreamer 1.14, there is a way to associate in a gstreamer pipeline
> reference timestamps to each frame.
>
> As expressed by Sebastian (slomo),
> [https://marc.info/?l=gstreamer-cvs&m=149458219511878&w=2]
>
>  buffer: Add GstReferenceTimestampMeta
>  
>  This is a meta that generically allows to attach additional reference
>  timestamps to a buffer, that don't have to relate to the pipeline clock
>  in any way.
>  
>  Examples of this could be an NTP timestamp when the media was captured,
>  a frame counter on the capture side or the (local) UNIX timestamp when
>  the media was captured.
>  
>  Examples of valid references would be "timestamp/x-drivername-stream"
>  for timestamps that are locally generated by some driver named "drivername"
>  when generating the stream, e.g. based on a frame counter, or
>  "timestamp/x-ntp, host=pool.ntp.org,port=123" for timestamps based on a
>  specific NTP server.
>
> I would expect the v4l2src plugin to add such a timestamp to each frame
> using information coming from the v4l2 driver, especially if the driver
> provides UTC or TAI timestamps generated in the kernel.
>
> How far are we from that goal ?

Far, the drivers only provide monotonic timestamp of the end of dma transfer.
The only other similar API is about time code, which relates to GstTimeCodeMeta,
but it's largely unimplement in the Linux kernel.

You could in theory make up some NTP numbers by translating from monotonic to
NTP, but that's no different then translating existing pipeline clock timestamp
imho. Overall, some patches and discussion need to go through the linux-media
mailing list before we can even considering doing something in mainline
GStreamer.

>
> Best regards
>
> Philippe De Muyter
>


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