Could you please give a hint with the following:
General goal:
- Create publisher to RTSP server with custom RTP header metadata
( something similar to Instantaneous RTP synchronization & retrieval of absolute sender clock times with GStreamer – coaxion.net – slomo's blog but in the different idea ) - Parse/Get this metadata from the client-side
I’m running the RTSP server like this:
docker run --rm -it --network=host -e RTSP_PROTOCOLS=udp -p 8554:8554 -p 1935:1935 -p 8888:8888 aler9/rtsp-simple-server
Client would look like
I know that rtph264pay
is the good point to make the modifications like:
// pipeline rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! appsink
...
GstPad *pad = gst_element_get_static_pad(data.rtph264depay, "sink");
gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER, pad_probe_callback, &data, NULL);
...
// where
GstPadProbeReturn pad_probe_callback (GstPad *pad,
GstPadProbeInfo *info,
gpointer user_data)
{
GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER(info);
GstRTPBuffer rtp_buffer;
memset(&rtp_buffer, 0, sizeof(GstRTPBuffer));
if (buffer != NULL) {
// for publisher can map with GST_MAP_READWRITE
if (gst_rtp_buffer_map(buffer, GST_MAP_READ, &rtp_buffer)) {
// do anything with GstRTPBuffer
gst_rtp_buffer_unmap(&rtp_buffer);
}
}
return GST_PAD_PROBE_OK;
}
but I could not create valid pipeline for publisher
because rtph264pay
can’t be linked with rtspclientsink
I sucessfully can build pipeline for sender & client with usage of udpsink
& udpsrc
. But it’s the different idea
sender:
gst-launch-1.0 -v filesrc location=$SOME_FILE ! qtdemux ! queue ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=9001
reciever:
gst-launch-1.0 -v udpsrc port=9001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink sync=false
For both rtph264depay is present so adding callback & filtering I think should work.
Question:
How can I achive this with the RTSP publishing model ?