Jump to content

WebcamDS (DirectShow webcam)


frank10
 Share

Recommended Posts

Thanks Frank

Maybe you could put webcam position at _WebcamDS_Init($Xtop,$Ytop), as optional parameters. If not given, use your default..

f we could use more then 1 webcam, maybe _WebcamDS_Init($camNumber,$Xtop,$Ytop) or, _WebcamDS_Pos($camNumber,$Xtop,$Ytop), so you could call it for every new webcam.

Jose

here is what I did:

Local $iX = $svidPosX, $iY = $svidPosY ; line of buttons above <-- (line 313)

and

Func _WebcamDS_Init($posX=0, $posY=26)

Global $svidPosX= $posX, $svidPosY= $posY

Edited by joseLB
Link to comment
Share on other sites

Which OS and autoit version do you use?

Do you have latest DirectX installed? Have you installed DirectX 9.0? (it's not sufficient install directly the 11)

EDIT:

Do you have latest video drivers installed? which graphic card?

your udf seems has a lot of requirements

Xp_SP3

AutoIt_v3.3.8.1

DirectX 9.0c

Yes, Mobile Intel® 915GM/GMS,910GML Express Chipset Family

Link to comment
Share on other sites

I'm only asking to find why the bluescreen, as Microsoft says often drivers updated solves it.

The version of Autoit is necessary because they implemented a function to create objects with Interfaces.

DX11 without DX9 is another common problem for a lot of programs, not only mine.

Do you have an integrated notebook webcam or is external?

Maybe XP SP2 that I tested, works, while SP3 has the problem?

At the moment the bluescreen seems only on XP SP3.

ApudAngelorum is the other guy that had bluescreen but he didn't answer if he has SP3.

Try this beta version in which I added a lot of error controls:

WebcamDS_ExampleUDF_1.2_beta.au3

WebcamDS_UDF_1.2_beta.au3

DirectShow_Interfaces_1.2.au3

Before running in Scite, change the path of log file in the Example to your path.

If it exits without bluescreen you will see in Scite Console the error code in the last line: post this @error-@extended.

Otherwise, if BlueScreen, you will get a file log.txt: at the next boot, before running the script again, read the log.txt and post the last line.

btw:

I put two global var:

$iWebXinside and $iWebYinside

for the inside GUI problem: if you don't set them, it put pic at 0,0, if you want to change the inside position, give them the new values at the beginning as in the example.

Link to comment
Share on other sites

Runs fine on my XP PRo SP3.

AutoIT Beta 3.3.9.1

GeForce GTX 460

DirectX 9.0c (4.09.0000.0904)

An old Creative Webcam Pro EX (CCD)

I did get "Stuck" in fullscreen mode for a bit.

I'd assumed "ESC" would get me out.

Resorting to Alt-F4 was necessary.

Link to comment
Share on other sites

To exit from fullscreen you must press F1.

It's written in line 96, but now I added it in the first post.

I didn't choose ESC because it exits from script.

So it can work in SP3, it should be something different...

Who has crash it's necessary they post me error codes.

Link to comment
Share on other sites

Hi Frank, just to tell you that I´m using your routine in a daily basis, togheter with pixelsearch to identify movements, and it works like a charm, sometimes 2-3 days straight. I couldnt find any bug, even with 2 cameras in a laptop.

In an Intel I5, tipically consumes about 1 -3% cpu.

Great job and thanks for share!

Jose

Link to comment
Share on other sites

  • 2 weeks later...

thanks Frank

In the past I looked it, but at first glance seemed a bit complex.

Anyway, if you could post here some ideas or piece of codes you tested together with your webcam udf, that will be great!

Thanks

Jose

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I had no time to develop more this UDF. I will see in the future.

For the motion detection, you should take every x time a snapshot of an area (or more areas) and then look if there is some changes in the Mean values you got in one channel (red, green or blue or all) like this:

FFSnapShot(0,460,130,460, 1, $hWnd)
$aMeanTemp = FFComputeMeanValues(1, $iMeanRed,$iMeanGreen,$iMeanBlue)
$aMean = $aMeanTemp[0]   ; red only
if $aMean > $aMeanRedOld +4 or $aMean < $aMeanRedOld -4 Then  ; some tolerance +-4
     .....you got some movements
endif
$aMeanRedOld = $aMean

In every case, here is OT, if you want more let's see in the Advanced pixel thread.

Hi

Link to comment
Share on other sites

thanks Frank!

On my case, I take off the infrared filter of a webcam, and put a black negative film in front of the camera.

Result: the camera only sees infrared.... So, I did a ring with a 3mm infrared led + a small watch batery cell (1.55v), plus a 47ohms resistor. So, it is very simple and works like a charm. As soon I make a movie of how it works, I put a link here!

Link to comment
Share on other sites

  • 3 weeks later...

Hi jose, interesting videos.

So, do you use the UDF to get the webcam pic of the IR led emitted from the hand's finger?

And using PixelSearch on it to detect movement?

I'm glad you found my UDF useful!

It seems you're the only one, even if 250 people downloaded it... Well, I assume they got it working good. ;)

Link to comment
Share on other sites

  • 1 month later...

You say it is possible to save the audio/video to a file, is it possible to transmit it directly over udp? (like a video chat)

(I am currently working on an encrypted I.M. application, and was wanting to add webcam option)

[sorry if the answer is obvious, I am currently unable to read through all the source, I will when I check back later]

Link to comment
Share on other sites

  • 4 weeks later...

I made this UDF to make a local app.

In DS, it could be used RTSP or ASF write filter, but currently I haven't coded them.

Could you by any chance do this? I am working on an instant messenger, and would love to be able to stream video between users.

But I don't see a reliable way to get the frames without doing a screenshot of the window.

Is there perhaps a way to get the data from the control, and then save that or send it?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...