How to check available webcams from the command line?












18















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










share|improve this question

























  • <<<<< lsusb >>>>

    – Qasim
    Sep 22 '13 at 20:33
















18















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










share|improve this question

























  • <<<<< lsusb >>>>

    – Qasim
    Sep 22 '13 at 20:33














18












18








18


7






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










share|improve this question
















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







command-line webcam






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 11 '18 at 14:24









Ciro Santilli 新疆改造中心 六四事件 法轮功

9,99444650




9,99444650










asked Sep 22 '13 at 20:26









marcelosalloummarcelosalloum

200116




200116













  • <<<<< lsusb >>>>

    – Qasim
    Sep 22 '13 at 20:33



















  • <<<<< lsusb >>>>

    – Qasim
    Sep 22 '13 at 20:33

















<<<<< lsusb >>>>

– Qasim
Sep 22 '13 at 20:33





<<<<< lsusb >>>>

– Qasim
Sep 22 '13 at 20:33










3 Answers
3






active

oldest

votes


















23














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






share|improve this answer



















  • 1





    $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11











  • @MonaJalal That means it couldn’t find any devices.

    – JMY1000
    Jan 25 at 22:23



















10














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






share|improve this answer





















  • 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





    $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11











  • This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

    – Mona Jalal
    Jun 21 '18 at 21:13



















0














For Windows you can use the pygrabber library: https://github.com/bunkahle/pygrabber



To check the user friendly names of the connected webcams:



from __future__ import print_function
from pygrabber.dshow_graph import FilterGraph

graph = FilterGraph()
print(graph.get_input_devices())





share|improve this answer








New contributor




bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f348838%2fhow-to-check-available-webcams-from-the-command-line%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    23














    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






    share|improve this answer



















    • 1





      $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • @MonaJalal That means it couldn’t find any devices.

      – JMY1000
      Jan 25 at 22:23
















    23














    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






    share|improve this answer



















    • 1





      $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • @MonaJalal That means it couldn’t find any devices.

      – JMY1000
      Jan 25 at 22:23














    23












    23








    23







    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






    share|improve this answer













    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







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 22 '13 at 20:46









    connie newconnie new

    53235




    53235








    • 1





      $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • @MonaJalal That means it couldn’t find any devices.

      – JMY1000
      Jan 25 at 22:23














    • 1





      $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • @MonaJalal That means it couldn’t find any devices.

      – JMY1000
      Jan 25 at 22:23








    1




    1





    $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11





    $ ls -ltrh /dev/video* ls: cannot access '/dev/video*': No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11













    @MonaJalal That means it couldn’t find any devices.

    – JMY1000
    Jan 25 at 22:23





    @MonaJalal That means it couldn’t find any devices.

    – JMY1000
    Jan 25 at 22:23













    10














    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






    share|improve this answer





















    • 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





      $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

      – Mona Jalal
      Jun 21 '18 at 21:13
















    10














    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






    share|improve this answer





















    • 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





      $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

      – Mona Jalal
      Jun 21 '18 at 21:13














    10












    10








    10







    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






    share|improve this answer















    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







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Oct 11 '17 at 16:43

























    answered Nov 11 '16 at 23:08









    Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

    9,99444650




    9,99444650








    • 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





      $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

      – Mona Jalal
      Jun 21 '18 at 21:13














    • 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





      $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

      – Mona Jalal
      Jun 21 '18 at 21:11











    • This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

      – Mona Jalal
      Jun 21 '18 at 21:13








    3




    3





    On 16.04.1 error: Failed to open /dev/video0: No such file or directory

    – Xaqron
    Jan 3 '17 at 16:41







    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





    @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




    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







    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




    1





    $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11





    $ v4l2-ctl --list-devices Failed to open /dev/video0: No such file or directory

    – Mona Jalal
    Jun 21 '18 at 21:11













    This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

    – Mona Jalal
    Jun 21 '18 at 21:13





    This doesn't work if I have a Sony PS3 eye camera connected to my ubuntu 16.04

    – Mona Jalal
    Jun 21 '18 at 21:13











    0














    For Windows you can use the pygrabber library: https://github.com/bunkahle/pygrabber



    To check the user friendly names of the connected webcams:



    from __future__ import print_function
    from pygrabber.dshow_graph import FilterGraph

    graph = FilterGraph()
    print(graph.get_input_devices())





    share|improve this answer








    New contributor




    bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      For Windows you can use the pygrabber library: https://github.com/bunkahle/pygrabber



      To check the user friendly names of the connected webcams:



      from __future__ import print_function
      from pygrabber.dshow_graph import FilterGraph

      graph = FilterGraph()
      print(graph.get_input_devices())





      share|improve this answer








      New contributor




      bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        For Windows you can use the pygrabber library: https://github.com/bunkahle/pygrabber



        To check the user friendly names of the connected webcams:



        from __future__ import print_function
        from pygrabber.dshow_graph import FilterGraph

        graph = FilterGraph()
        print(graph.get_input_devices())





        share|improve this answer








        New contributor




        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        For Windows you can use the pygrabber library: https://github.com/bunkahle/pygrabber



        To check the user friendly names of the connected webcams:



        from __future__ import print_function
        from pygrabber.dshow_graph import FilterGraph

        graph = FilterGraph()
        print(graph.get_input_devices())






        share|improve this answer








        New contributor




        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 37 mins ago









        bunkusbunkus

        1




        1




        New contributor




        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        bunkus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f348838%2fhow-to-check-available-webcams-from-the-command-line%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            GameSpot

            connect to host localhost port 22: Connection refused

            Getting a Wifi WPA2 wifi connection