First let’s install some dependencies
sudo apt-get install gstreamer-tools gstreamer1.0-plugins-bad gstreamer1.0-plugins-good
Server will open the raspivid
cli tool and pipe on stdout, streamer will take the input and parse h264 and stream as rtp
1 | raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=0.0.0.0 port=5000 |
Client will open a window displaying the video feedback
1 | gst-launch-1.0 -v tcpclientsrc host=<pi4-ip> port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false |
Credits
Based on the article from raspberry-projects.com