Skip to content

Instantly share code, notes, and snippets.

@fagnercarvalho
Last active January 31, 2021 23:53
Show Gist options
  • Save fagnercarvalho/0a8be7c9a1abb93d5e37516aa2424d38 to your computer and use it in GitHub Desktop.
Save fagnercarvalho/0a8be7c9a1abb93d5e37516aa2424d38 to your computer and use it in GitHub Desktop.
Use webcam in Raspberry PI
sudo apt install fswebcam
sudo usermod -a -G video root
fswebcam -r 1280x720 --no-banner image.png
apt install ffmpeg
ffmpeg -t 10 -f v4l2 -framerate 30 -input_format mjpeg -i /dev/video0 output.avi # take picture
ffmpeg -f v4l2 -input_format mjpeg -i /dev/video0 -c:v copy output.avi # record video
ffmpeg -i /dev/video0 -f flv rtmp://griffin.lan/live/test # live streaming
ffmpeg -f v4l2 -list_formats all -i /dev/video0 # check all formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment