USB Camera? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: USB Camera? (/showthread.php?tid=1163) Pages:
1
2
|
USB Camera? - james2464 - 11-21-2022 I don't know much about this topic of accessing PC/Mac/Linux devices. Is it possible to capture a still image from a USB camera from within a QB64 program? Or would this be incredibly complicated? Obviously the easiest thing to do is just manually capture the image (using the camera software) then _loadimage into QB64. I'm wondering if QB64 could be used to capture a new image at a certain time interval and discard the previous image. RE: USB Camera? - SpriggsySpriggs - 11-21-2022 Yes. In Windows, one can capture an image from the webcam or even a video. It's a complicated API and I'd have to revisit it. If you are not in any rush then I can come back to you at a later date with information on this. RE: USB Camera? - james2464 - 11-21-2022 (11-21-2022, 07:35 PM)Spriggsy Wrote: Yes. In Windows, one can capture an image from the webcam or even a video. It's a complicated API and I'd have to revisit it. If you are not in any rush then I can come back to you at a later date with information on this. Great to know! Absolutely no rush - thank you. RE: USB Camera? - Pete - 11-21-2022 Does the still image appear on your screen? If so, in Windows you hold the Windows key and press the PrtScr key to capture the image and send it to the windows picture folder as a screen shot image. PrtScr by itself would capture the image to the image clipboard. My point is we already have API functions to mimic key presses to do this job in QB64, and QB64 has a keyword to communicate with the Windows clipboard image. As far as actually controlling the USB camera in a QB64 program, no. Nothing I know of posted. If Spriggsy has an interface he'd have to dig into it, as he mentioned. Pete RE: USB Camera? - madscijr - 11-21-2022 (11-21-2022, 07:12 PM)james2464 Wrote: I don't know much about this topic of accessing PC/Mac/Linux devices. I know Spriggsy has the API knowhow to make this work -at least in Windows- but how cool would it be to have some native QB64 commands to work with a Webcam or other such standard devices? RE: USB Camera? - mnrvovrfc - 11-22-2022 https://www.purebasic.fr/english/viewtopic.php?t=61050 https://www.purebasic.fr/english/viewtopic.php?t=61253 https://learn.microsoft.com/en-us/windows/apps/get-started/samples#uwp--winui-2-samples It doesn't look easy. Just throwing around some ideas. Boo hoo nothing for Linux nor Macintosh, always Windows, always Windows! Note: if you're doing searches for this yourself, don't go near any link saying "QBasic" because it's fake, redirects to NSFW+18 stuff! RE: USB Camera? - SpriggsySpriggs - 11-22-2022 So I found my post on the old forum where I did this. Can't remember if this is before or after I started doing only 64 bit code. If you're on 64 bit QB64 and it isn't working, just switch to 32 and try again. https://qb64forum.alephc.xyz/index.php?topic=3077.msg123574#msg123574 However, that code definitely needs cleaning up. But this can help you fiddle around with it in the meantime. RE: USB Camera? - james2464 - 11-22-2022 Thanks! This worked immediately, using 64-bit v3.3 I'll study this code and see if I can make sense of it. Much appreciated - cheers! RE: USB Camera? - Pete - 11-22-2022 And Spriggsy comes through again, +2 Pete RE: USB Camera? - SpriggsySpriggs - 11-22-2022 (11-22-2022, 04:11 PM)james2464 Wrote: Thanks! This worked immediately, using 64-bit v3.3 @james2464 The only warning I can give with this code is that it captures a lossless file. So the file can get quite large if you let it run too long. |