2
votes

I am writing a gstreamer pipeline using command line syntax to send a video-stream and would like to send data with it. One solution I thought was feasible was to send the data as a subtitle file.

I can multiplex both video and subtitle files through rtp using the following pipeline:

gst-launch-1.0 rtpmux name=mux ! udpsink host=127.0.0.1 port=5000 \ 
filesrc location=movie.avi ! decodebin ! videoconvert ! x264enc ! rtph264pay ! mux.sink_0 \
filesrc location=movie.srt ! subparse ! rtpgstpay ! mux.sink_1

I know it arrives as it should because I can view the port receiving the data with netcat. But when I try to read the stream with gstreamer on the receiver side I get "syntax error". The pipeline I am using now is

gst-launch-1.0 udpsrc port=5000 caps = "application/x-rtp" ! rtpptdemux name=demux ! queue ! \
demux.src_0 ! rtph264depay ! decodebin ! videoconvert ! autovideosink \
demux.src_1 ! rtpgstdepay ! fakesink

In it, I try to undo every step took in the sender side, but something is off and I don't know what it is. (I would do something with the subtitles later, the fakesink is only there for debugging)

If there are other ways to do this I would gladly appreciate any help!

Regarding other possible solutions, I understand that RTP has support for text conversation using the rtp payload (RFC 4103) and for Timed Text (RFC 4396) but from what I found at gstreamer plug-ins list for RTP, there is no support for it yet.

My end goal is to send a video from opencv in one computer along with some data and read it synchronously in the receiving end. After the command line works I would adapt it to opencv and continuously rewrite the subtitle file or pass the variable directly.

Thanks so much in advance for the help!

1

1 Answers

1
votes

Command line syntax is incorrect because queue cannot come after demux element (although it seems somehow logical in command line).

In your case, queue element can be used after demux source pads. For example

gst-launch-1.0 udpsrc port=5000 caps = "application/x-rtp" ! rtpptdemux name=demux \
demux.src_0 ! queue ! rtph264depay ! decodebin ! videoconvert ! autovideosink \
demux.src_1 ! queue ! rtpgstdepay ! fakesink