Skip to content

Video Conversion

Brian Webb edited this page Oct 12, 2019 · 6 revisions

Stream raw h.264 video from UDP to TCP

gst-launch-1.0 -v udpsrc port=5600 ! h264parse ! queue ! matroskamux ! queue leaky=2 ! tcpserversink port=7001 host=0.0.0.0 recover-policy=keyframe sync-method=latest-keyframe

Stream an Insta360 Air to UDP

ffmpeg -r 30 -copytb 0 -f v4l2 -vcodec h264 -s 2560x1280 -i /dev/video0 -vcodec copy -f h264 udp://127.0.0.1:5602

Stream an Insta360 Air to UDP using gstreamer

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-h264,width=2560,height=1280,framerate=30/1 ! h264parse config-interval=3 ! rtph264pay ! udpsink host=127.0.0.1 port=5602

Stream an Insta360 Air to FEC encoded RTP

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! 'video/x-h264,width=2560,height=1280,framerate=30/1,stream-format=byte-stream' ! rtph264pay pt=96 ! rtpulpfecenc percentage=50 pt=122 ! udpsink host=127.0.0.1 port=5700

Decode FEC encoded h.264 RTP packets

gst-launch-1.0 udpsrc port=5700 caps="application/x-rtp, payload=96, clock-rate=90000" ! rtpstorage size-time=220000000 ! rtpssrcdemux ! application/x-rtp, payload=96, clock-rate=90000, media=video, encoding-name=H264 ! rtpjitterbuffer do-lost=1 latency=200 ! rtpulpfecdec pt=122 ! rtph264depay ! h264parse ! rtph264pay name=pay0 pt=96

Play FEC encoded RTP packets from gstreamer

gst-launch-1.0 udpsrc port=5700 caps="application/x-rtp, payload=96, clock-rate=90000" ! rtpstorage size-time=220000000 ! rtpssrcdemux ! application/x-rtp, payload=96, clock-rate=90000, media=video, encoding-name=H264 ! rtpjitterbuffer do-lost=1 latency=200 ! rtpulpfecdec pt=122 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink