GStreamer on Raspberry Pi – the short answer

What I needed was a live video stream to provide some sort of an FPV experience. Streaming over VLC or ffmpeg turned out to be suffering from too much of a time lag. Streaming over MJPEG Streamer with raspistill is pretty cool, especially for its broad client compatibility, but the lag isn’t any better and a few frames per second aren’t much of an option when it comes to FPV. So the answer is: GStreamer.

Well, since I’m far from being an expert in media encoding, decoding and all applicable options, that answer turned out to be hell. Never mind about the time I spent to get this simple stuff working. To keep the answer short I’ll assume you have GStreamer installed on the Raspberry Pi as well as on your Linux PC. (On Mac it should be similar. On Windows it should be possible as well, somehow.) The IP address of the Pi network interface is 192.168.2.12 in this example.

On the Raspberry Pi:

sudo raspivid -t 0 -w 640 -h 480 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=192.168.2.12 port=5000

On the PC:

gst-launch-1.0 -v tcpclientsrc host=192.168.2.12 port=5000  ! gdpdepay !  rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

One thought on “GStreamer on Raspberry Pi – the short answer”

Comments are closed.