UTC timestamp into H.264 stream

Sebastian Dröge sebastian at centricular.com
Wed Jan 13 12:30:42 PST 2016


Hi,

as discussed in private mail before, basically what you need to do here
is (because you want to get the UTC times of when the frame was
*captured) to convert the buffer PTS of each buffer together with the
segment and the base time to the pipeline's clock time.

If the pipeline is using the system clock and set to the real-time
clock and is using UTC time, then you can use the value directly.
Otherwise you'll have to do the translation as needed.

On Di, 2016-01-12 at 11:09 +0100, Florian Langlois wrote:
> yes, my thought was to create the pipeline, set the system clock in
> REALTIME and develop a GstBaseParse element to insert NAL SEI
> Unregistered with the timestamp into the H.264 stream.
> 
> Bad idea ?
> 
> 2016-01-12 4:26 GMT+01:00 Nicolas Dufresne <nicolas.dufresne at collabor
> a.com>:
> > Le mardi 12 janvier 2016 à 02:29 +0100, Florian Langlois a écrit :
> > > Hmm actually i should inherit from GstBaseParse
> > > Le 12 janv. 2016 1:31 AM, "Florian Langlois" <chamois94 at gmail.com
> > > a
> > > écrit :
> > > > Thx for the answer.
> > > > Can I simply inherit from GstBaseTransform and use the tracked
> > > > segment from it since it keeps a copy of it ?
> > 
> > From an element, you can't assume the application have setup the
> > clock
> > the way you want. So instead, you'll have to translate from one
> > clock
> > to UTC clock to get what you described earlier.
> > 
> > > > Le 12 janv. 2016 12:25 AM, "Nicolas Dufresne"
> > > > <nicolas.dufresne at collabora.com> a écrit :
> > > > > Le lundi 11 janvier 2016 à 23:24 +0100, Florian Langlois a
> > > > > écrit :
> > > > > > Hello,
> > > > > > For a project I need to insert UTC timestamps into a h.264
> > > > > stream
> > > > > > using the MISB ST 604.
> > > > > > I also need to insert Commercial precision timestamp
> > detailled
> > > > > in the
> > > > > > same  MISB.
> > > > > > Frames are captured from a live source v4l2src then encoded
> > > > > using an
> > > > > > imx6 encoder and send with a udpsink.
> > > > > > Before to start I want to know if someone here has  any
> > idea of
> > > > > what
> > > > > > would be a good pipeline architecture for that ?
> > > > > > I wanted to develop a dedicated plugin for that but i dont
> > know
> > > > > how
> > > > > > to get correct UTC timestamp ? Do such a gstclock exist ?
> > > > > > Thx
> > > > > > Florian
> > > > >
> > > > > You can grab the system clock and set the clock-type property
> > to
> > > > > GST_CLOCK_TYPE_REALTIME (instead of default which is
> > > > > GST_CLOCK_TYPE_MONOTONIC). Then you need to force your
> > pipeline
> > > > > into
> > > > > using that clock, see gst_pipeline_use_clock() method.
> > > > >
> > > > > Note that to convert the buffer timestamp into clock time
> > (UTC
> > > > > time),
> > > > > you will have to track the GstSegment structure from the
> > segment
> > > > > event,
> > > > > convert the timestamp to running-time and add the pipeline
> > base
> > > > > time
> > > > > (gst_element_get_base_time(pipeline)).
> > > > >
> > > > > cheers,
> > > > > Nicolas
> > > > > _______________________________________________
> > > > > gstreamer-devel mailing list
> > > > > gstreamer-devel at lists.freedesktop.org
> > > > > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > > >
> > 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160113/3c5b25af/attachment.sig>


More information about the gstreamer-devel mailing list