Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Camera?
#11
[quote pid="10450" dateline="1669142731"]
Quote: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.

[/quote]


Thanks for letting me know about that.   


I'm actually only interested in capturing a single frame or image (maybe 1 per minute, roughly).   If modified, can this code work in that sort of way, or is it strictly a video capture?
Reply
#12
You should be able to modify it for snapping a photo only. I think when I first started working on that API, I started with capturing JPGs. I don't have that code now but I could look at this API some more this week, after Thanksgiving and Black Friday, and see if I can make a nice and stable capture for you.
The noticing will continue
Reply
#13
Alternative...

1) Timer loops 60 seconds.
2) Windows API call to do a screen capture.
3) QB64 routine to save the image.

I suppose a QB64 / WIN API routine could monitor the PID of the webcam routine and if it no longer existed, exit the QB64 image capture loop. Maybe some more research would need to be done to determine if a webcam ap is active.

Pete
Reply
#14
No offense but I don't think that's a great alternative, Pete. It'd be better to just grab the frame straight from the camera rather than trying to do some screenshot of a program that shows the webcam. The code I have already grabs the raw frames. I just have to tweak the code to instead do the logic for a picture rather than a video.
The noticing will continue
Reply
#15
(11-22-2022, 09:38 PM)Spriggsy Wrote: No offense but I don't think that's a great alternative, Pete. It'd be better to just grab the frame straight from the camera rather than trying to do some screenshot of a program that shows the webcam. The code I have already grabs the raw frames. I just have to tweak the code to instead do the logic for a picture rather than a video.

No offense? How do you ever expect to win an argument with no offense? Defense? Big Grin

I agree direct from the webcam is the better approach, and that's why I labeled it as an alternative instead of a better solution. As such, I sincerely doubt anyone other than the API King could code it, even with the code you already provided. (I love it when I post opinions and that guy Murphy shows up to prove me wrong). Anyway, that would also be a win all around, because I seldom stand on my ego... but my avatar does need to stand on a box, otherwise we just see a hat.

Pete
Reply
#16
Quote:You should be able to modify it for snapping a photo only. I think when I first started working on that API, I started with capturing JPGs. I don't have that code now but I could look at this API some more this week, after Thanksgiving and Black Friday, and see if I can make a nice and stable capture for you.


That would be incredible...thank you sir!
Reply
#17
(11-22-2022, 09:07 PM)SpriggsySpriggs Wrote: You should be able to modify it for snapping a photo only. I think when I first started working on that API, I started with capturing JPGs. I don't have that code now but I could look at this API some more this week, after Thanksgiving and Black Friday, and see if I can make a nice and stable capture for you.
I know this was a while ago, but did you ever find your code for capturing a single frame?
Reply
#18
OMG someone else tries to invoke the spirits of Christmas Past!

Edit: I do hope he comes back, he was into interesting stuff!
b = b + ...
Reply
#19
Hey, y'all. I did see your posts. I'm working on this right now. I've got it to save a bmp file and now I just have to get it to work a little better. Thank you for your patience.
The noticing will continue
Reply
#20
(02-26-2025, 02:10 PM)SpriggsySpriggs Wrote: Hey, y'all. I did see your posts. I'm working on this right now. I've got it to save a bmp file and now I just have to get it to work a little better. Thank you for your patience.
Thanks for helping! If there's a way to capture a still image directly to a QB64PE image in memory, that would be useful for trying out "computer vision", but saving a still frame to an image file and loading it in off disk would probably work too, albeit a little bit slower (maybe it could be made faster if there were a way to write to an in-memory "virtual disk"...)
But any still frame capture would be great.
Reply




Users browsing this thread: 9 Guest(s)