Python Forum
get webcam name from device manger !!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get webcam name from device manger !!
#1
hello all ...
how i can get my webcam name by python ??

in powershell i can use this command:
Quote: Get-WmiObject Win32_PNPEntity | Select Name | Select-String "Camera"

output :
Quote:@{Name=HP Wide Vision HD Camera}
[Image: Capture.png]

how i can do this in pure python ?
Reply
#2
solved :

import wmi
import re


c = wmi.WMI()
wql = "Select * From Win32_USBControllerDevice"
for item in c.query(wql):
    q = item.Dependent.Caption
    if re.findall("Camera",q):
        print(q)
    
    
Output:
HP Wide Vision HD Camera
Reply
#3
Glad you got the solution, and thanks for coming back to share it!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to receive webcam capture on spout? buzzdarkyear 2 2,592 Jan-12-2022, 02:26 PM
Last Post: buzzdarkyear
  Rotation Effect on live Webcam Feed Leziiy 0 1,576 Sep-12-2020, 04:25 PM
Last Post: Leziiy
  About Arduino and Python usb webcam tuts Simurg 1 2,114 Mar-20-2020, 07:25 PM
Last Post: Larz60+
  Reading UDP from external device without device software ikdemartijn 2 3,336 Dec-03-2019, 04:29 PM
Last Post: Larz60+
  Access webcam via python ArnabRoyBatman 1 4,264 Jun-15-2017, 05:19 AM
Last Post: j.crater
  Display device details i.e connected with more than one device shintonp 6 5,247 May-10-2017, 06:00 AM
Last Post: shintonp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020