Time over RTSP h.264 video stream

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

Time over RTSP h.264 video stream

bomba
I'm streaming live h.264 video from a raspberrypi using gst-rtsp-server to a remote computer, which is saving the stream in multiple .ts segments.
What can I do to get the time instant at which the frame in the .ts segment was acquired by the sensor?
Reply | Threaded
Open this post in threaded view
|

Re: Time over RTSP h.264 video stream

Nicolas Dufresne-4
Le mardi 17 mai 2016 à 01:42 -0700, bomba a écrit :
> I'm streaming live h.264 video from a raspberrypi using gst-rtsp-
> server to a
> remote computer, which is saving the stream in multiple .ts
> segments. 
> What can I do to get the time instant at which the frame in the .ts
> segment
> was acquired by the sensor?

If you create those using splitmuxsink, you can implement the format-
location signal to choose the name of the files you want. The provided
timestamp in that callback (arg0) is (if I remember well) in running
time. There is various way to convert this, though it will remain an
approximation due to how RTP work. To get a little more procise, you'd
need to use a shared network clock between your client and server.

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time over RTSP h.264 video stream

bomba
Hello,

I'm now using a shared network clock between server and client.
On the RTSP server side:

GstClock *global_clock;
...
        /* clock init */
        global_clock = gst_system_clock_obtain ();
        g_object_set (global_clock, "clock-type", GST_CLOCK_TYPE_REALTIME, NULL);
        gst_net_time_provider_new (global_clock, "0.0.0.0", 8554);
...
        gst_rtsp_media_factory_set_clock (factory, global_clock);

I can catch it with no problem on a LAN client and use it to produce STARTING_REC_TIME-END_REC_TIME.mkv filenames. Good.

My problem now is that gst_net_time_provider_new() binds an UDP port.
UDP doesn't work for me, my server side will never be on the same LAN and will never have a public IP,
so I'm tunnelling the RTSP stream over SSH.

Is there any gst_net_time_provider_new()-like function that binds the clock on a TCP port?
What would you suggest?
Reply | Threaded
Open this post in threaded view
|

Re: Time over RTSP h.264 video stream

Sebastian Dröge-3
On Di, 2016-05-31 at 07:19 -0700, bomba wrote:

> Is there any gst_net_time_provider_new()-like function that binds the clock
> on a TCP port?
> What would you suggest?

There is currently no TCP based clock protocol implemented in
GStreamer, but you could implement your own of course.

What might work for you is using the GStreamer NTP clock support. You
could then use a common NTP clock somewhere on the network (or on the
Internet) and the clients wouldn't have to bind to an UDP port
themselves. Of course that requires that the NTP protocol works
properly in your network.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment