Is there a terminal command that lists all the webcams connected to my computer, including the native one? Maybe using ffmpeg package?

  • <<<<< lsusb >>>> – Qasim Sep 22 '13 at 20:33
up vote 21 down vote accepted

To list all video devices picked up by the kernel

ls -ltrh /dev/video*

To list all devices attached to USB use lsusb ; to list all devices attached to PCI use lspci

  • 1
    $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory – Mona Jalal Jun 21 at 21:11

v4l2-ctl --list-devices

sudo apt-get install v4l-utils
v4l2-ctl --list-devices

Sample output with a single camera:

Integrated Camera (usb-0000:00:1a.0-1.6):
        /dev/video0

Tested on Ubuntu 16.04.

More details can be found here: https://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c

  • 3
    On 16.04.1 error: Failed to open /dev/video0: No such file or directory – Xaqron Jan 3 '17 at 16:41
  • @Xaqron also try installing libv4l-dev if not already installed. Also give computer model if you can. Cheers. – Ciro Santilli 新疆改造中心 六四事件 法轮功 Jan 3 '17 at 18:00
  • 1
    Just because I keep coming back to this answer, it's now: v4l2-ctl --list-devices. That's lower in the answer but the top in bold text doesn't have the 2. – ksclarke Oct 11 '17 at 16:40
  • 1
    @ksclarke thanks! Fixed. – Ciro Santilli 新疆改造中心 六四事件 法轮功 Oct 11 '17 at 16:43
  • 1
    $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory – Mona Jalal Jun 21 at 21:11

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.