UTC timestamp into H.264 stream
Florian Langlois
chamois94 at gmail.com
Mon Jan 18 09:41:38 PST 2016
Hi,
I implemented this on top of a RTSP server with gst-rtsp-server. Now I'm
facing with an other problem. If the pipeline uses the realtime clock, the
synchronization is affected by system clock changes (backward or forward),
e.g. pipeline runs very fast or is blocked depending clock advanced or went
back. Monotonic clock is not affected. Any idea how to solve this ?
2016-01-13 21:30 GMT+01:00 Sebastian Dröge <sebastian at centricular.com>:
> 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
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160118/5a407757/attachment-0001.html>
More information about the gstreamer-devel
mailing list