Snippets collected/distilled from gists/blog posts/etc. Combined here for fellow web-searchers -- goal is to have an easy/minimal sink for in-app use, and then forward that stream in another process.
Read camera, push to UDP sink (usually from appsrc, here v4l2 camera):
$ gst-launch-1.0 -vvvv v4l2src ! 'video/x-raw, width=640, height=480, framerate=30/1' ! videoconvert ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink port=1234
Visualize above:
$ gst-launch-1.0 -vvv udpsrc port=1234 ! "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtph264depay ! h264parse ! decodebin ! videoconvert ! xvimagesink sync=false
Instead of preceding, read UDP stream and republish over network as RTSP stream, using https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c (build: libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-1.0` -L/usr/lib/x86_64-linux-gnu -lgstrtspserver-1.0 test-launch.c -o gst-rtsp-launch
)
GST_DEBUG=1 ./bin/gst-rtsp-launch "udpsrc port=1234 ! application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264 ! rtph264depay ! h264parse ! decodebin ! videoconvert ! x264enc ! rtph264pay name=pay0 pt=96 "
Read RTSP stream:
$ gst-launch-1.0 -vvv rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! decodebin ! videoconvert ! xvimagesink sync=false
@bmount you can try something like this
gst-launch-1.0 udpsrc port=5001 ! "application/x-rtp, encoding-name=(string)RAW, sampling=(string)RGB, depth=(string)8, width=(string)1920, height=(string)1080" ! rtpvrawdepay ! queue ! rtpvrawpay mtu=65500 ! udpsink host=127.0.0.1 port=6001 sync=true async=true
you can also have multiple sinks in one pipeline using tee. You may not need two queues like below, that's just to illustrate a way to do it.
[...] source, caps, converting, etc [...]
! tee name=t t. ! queue ! udpsink 127.0.0.1 port=6001 sync=true async=true t. ! queue ! udpsink 127.0.0.1 port=7001 sync=true async=true