Drew
Drew

Reputation: 11

How to take video on a raspberry pi with a usb webcam

Hello I have a usb webcam and am too broke for the picamera, is there anyway I can write a python program that can record video??

Upvotes: 0

Views: 8636

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207758

A few ideas spring to mind...

  1. Identify which webcam you have

  2. Plug it in and see if you can see it with:

    sudo lsusb

  3. Install v4l-utils and see if it is accessible:

    sudo apt-get install v4l-utils

    v4l2-ctl --list-devices

  4. Install ffmpeg and try using it:

    sudo apt install ffmpeg

    ffplay /dev/video0

If this works, you can record with ffmpeg or use OpenCV videocapture() to grab and record frames.

Upvotes: 1

Related Questions