Skip to content

Instantly share code, notes, and snippets.

@rkh932
Last active August 17, 2018 21:48
Show Gist options
  • Save rkh932/fc555413e9dac47b573ef7fe54aab0d0 to your computer and use it in GitHub Desktop.
Save rkh932/fc555413e9dac47b573ef7fe54aab0d0 to your computer and use it in GitHub Desktop.

How to Setup a RaspberryPi to Stream Video to QGroundControl

USB Webcam

Pre-requisites

Install video 4 linux, sudo apt install v4l-utils

Verify /dev/video0 exists

Start Streaming

ffmpeg -i /dev/video0 -map 0:0 -c:v h264_omx -f rtp udp://<destination_ip_address>:<port>

Options / Miscellaneous

To set a bit-rate, use -b:v <bit-rate>. 1000000 seems to give good quality with the Logitech C920.

To enable or disable auto-focus, use v4l2-ctl -c focus_auto=<0 or 1>

CSI (Camera) Port

Pre-requisites

Install video 4 linux, sudo apt install v4l-utils

Enable the camera port, sudo rpi-config

Load the camera module, sudo modprobe bcm2835-v4l2

Verify /dev/video0 exists

Start Streaming

For the GoPro: ffmpeg -i /dev/video0 -map 0:0 -c:v h264_omx -f rtp udp://<destination_ip_address>:<port>

For the FLIR Duo: ffmpeg -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -f rtp udp://<destination_ip_address>:<port>

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment