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
Host:
GST_DEBUG=3 ./gst-rtsp-launch "nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 ! omxh264enc bitrate=10000000 ! video/x-h264, profile=baseline ! rtph264pay name=pay0 pt=96 "
Desktop Client:
gst-launch-1.0 -vvv rtspsrc location=rtsp://192.168.1.172:8554/test ! rtph264depay ! h264parse ! decodebin ! videoconvert ! xvimagesink