Sign in to follow this  
Followers 0
MadaraUchiha

Enumerate Webcams & Videodevices - Step 1

4 posts in this topic

Yo,

I like to enumerate all connected webcams/videodevices of the computer.

I know all the current Webcam UDF's here, so don't link me to them ;)

I like to try it myself, coding something from scratch

What I like to achieve in the end is make a webcam snapshot by selecting the webcam

by name, and then take a snapshot, without displaying the videosourcedialog.

My first step to achieve this is to grab all webcam devices.

So far, this lists the usb devices, and the last entry is the webcam.

 

ewlcjfx3.jpg

What does it show on your computer?

If you reply, please tell me, how many webcams you have, what os, architecture and the webcam names^^

$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity where DeviceID like 'USB\\%'")

If IsObj($colItems) then
    For $objItem In $colItems
        WriteDevice("--------------------------------------")
        WriteDevice("Caption: " & $objItem.Caption)
        WriteDevice("DeviceId: " & $objItem.DeviceID)
    Next
Endif


Func WriteDevice($sText)
    ConsoleWrite($sText & @LF)
EndFunc

How can I filter that it only displays video devices/webcams?

I have 2 webcams on my pc, so it should show them, by there correct name

Similar to Skype:

gdyj5j2w.jpg

A friend of mine tested my snippet above aswell, and he told me that the last entry is always the webcam.

Can I filter them out somehow?

And what if there are mote than one webcams?

This is only the first step of 3, please only help me about the filtering part, atm i am not interessted in snapshoting yet.

Thats the next step^^

 


Share this post


Link to post
Share on other sites



No ideas?:/


Share this post


Link to post
Share on other sites

I hate this stupid autoit code displayed in forum. If you copy and paste it in the script, it ends up being 1 line so i have to copy each line and paste it into eh script :pirate:

Share this post


Link to post
Share on other sites

I hate this stupid autoit code displayed in forum. If you copy and paste it in the script, it ends up being 1 line so i have to copy each line and paste it into eh script :pirate:

 

this happens with Firefox. There is a workaround, just copy the code by selecting all, but leave out at least one character. Then paste it to SciTE, In this way all @cr will be preserved and you will have to enter by hand only the first (or the last) char.


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0