The commands I posted in the description of the project work perfectly fine; however, when attempting to stream the video from the camera for a real-time application (e.g. controlling a small vehicle via FPV) I found that piping the output of rapivid into gstreamer added a bit of latency. A much better option is to use the rpicamsrc. This can be obtained from the git page of the project: https://github.com/thaytan/gst-rpicamsrc
A winning formula that does UDP streaming is the following:
On the Raspberry Pi side:
gst-launch-1.0 rpicamsrc preview=false ! 'video/x-h264, width=800, height=600, framerate=30/1' ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
On the PC side
gst-launch-1.0 udpsrc port=5000 ! gdpdepay ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
Start the script on the PC side before running the command on the Raspberry Pi.
I still have to figure out a robust way to handle issues with the connection and restart the video once the link betwen the two works.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
If I remember well, video latency was down to about 200-300 ms. I haven't touch this for a long time now, though. Regarding rpicamsrc it is quite easy to download and use, I was skeptical too
Are you sure? yes | no
How much latency did you shave off with this method? Is it hard to install rpicamsrc?
Are you sure? yes | no