Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

webcam not saving current frames to file

$
0
0

Hello all, I am working on an instant messenger application, and am working towards adding video call support, however I seem to have a problem, the script only grabs the first frame of the webcam control, and uses that same frame every other time a snapshot is taken, this very same code used to work perfectly when I used it with a small http server script to make a webhosted cam.

 

Below is my test code

AutoIt         
; *** Start added by AutoIt3Wrapper *** #include <GUIConstantsEx.au3> ; *** End added by AutoIt3Wrapper *** #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstants.au3> #include <Webcam.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Memory.au3> $gui = GUICreate("Webcam UDF Test",320,240) _WebcamInit() $camcontrol = _Webcam($gui,320,240,0,0) GUISetState(@SW_SHOW) $timer = TimerInit() While 1  $msg = GUIGetMsg()     If $msg = $GUI_EVENT_CLOSE Then   _WebcamStop()   Exit  EndIf  Sleep(10)  if TimerDiff($timer) > 2000 Then     _WebcamSnapShot()     _GDIPlus_Startup()     Local $hBitmap = _GDIPlus_BitmapCreateFromFile($snapfile)     ; This is the binary data of your image.     FileDelete(@ScriptDir&"\testing.jpg")     FileWrite(@ScriptDir&"\testing.jpg", _GDIPlus_SaveImage2Binary($hBitmap, 60))     _GDIPlus_Shutdown()      $timer = TimerInit()  EndIf WEnd

This creates a webcam to capture from, then converts the resulting file into a jpeg file, you will notice it;s the same jpeg file over and over

 

oh yeah and here's Attached File  Webcam.au3   8.95KB   2 downloads

 

I don't know if I'm doing something wrong or if perhaps this is an autoit bug?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>