News:

The Latest electronic and computer Tips that work!

Main Menu

Shoot Video and playback with USB Cam

Started by branx86, December 08, 2016, 03:18:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

branx86

Shoot video:
sudo apt-get update
sudo apt-get install ffmpeg
  ffmpeg avconv -f video4linux2 -r 7 -s 640x480 -i /dev/video0 video0.avi
ls  /dev/v4l/by-id/    will list all USB cams
v4l2-ctl --list-formats will show all formats cams will do
ffmpeg -f v4l2 -video_size 1280x720 -i /dev/video0 -frames 1 out.jpg   - Takes a picture
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -input_format mjpeg -i /dev/video0 -c copy out.mkv  - Make Video


play video:
sudo apt-get install omxplayer
omxplayer -o hdmi video0.avi



ls  /dev/v4l/by-id/    will list all USB cams
lsusb   will give the address of cams

sudo modprobe bcm2835-v4l2   -If you see a grey picture from camera or no picture at all