Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Camera?
#31
(02-26-2025, 08:58 PM)SpriggsySpriggs Wrote: Q:  I wonder if there's a way to change camera resolution at the API or software level?
A: YES! If you want to change the settings first, use this code:

This one ran.

(02-26-2025, 09:14 PM)SpriggsySpriggs Wrote: Ignore the previous code. This will be better.

This one returns "Failed to set video format" (see attached screenshot).

(02-26-2025, 09:14 PM)SpriggsySpriggs Wrote: EDIT: The reason why is that this will default the resolution of the video rather than requiring you to enter it in the function call. Because who wants to do that?

But is the default resolution the lowest it can get? 
It seems the first code that explicitly set 640x480 would be preferable for the purpose of going lower res?
(I should see if it'll work if I set those values to 320x240 or 160x120!)

Whenever you get a chance... No biggie... Thanks

PS I cleaned up your code (see attached for all 4 versions all nice and pretty).


Attached Files Image(s)
   

.bas   Webcam1.ToFile.bas (Size: 8.71 KB / Downloads: 4)
.bas   Webcam2.ToMemory.bas (Size: 12.7 KB / Downloads: 4)
.bas   Webcam3.ToMemory.SetResolution.bas (Size: 12.81 KB / Downloads: 5)
.bas   Webcam4.Tomemory.DefaultResolution.bas (Size: 13.2 KB / Downloads: 4)
Reply
#32
Hey, so look at the comment I made in the SetupDriver call. I feel as though you probably ran it with _TRUE there on the one you said didn't run. Also, you MUST choose YUY2 as the type.

Also, at this point, I think the code can be left in your hands.

Here is the link to the relevant MSDN docs: https://learn.microsoft.com/en-us/window...eo-capture
The noticing will continue
Reply
#33
(02-26-2025, 11:51 PM)SpriggsySpriggs Wrote: Hey, so look at the comment I made in the SetupDriver call. I feel as though you probably ran it with _TRUE there on the one you said didn't run. Also, you MUST choose YUY2 as the type.

Also, at this point, I think the code can be left in your hands.

Here is the link to the relevant MSDN docs: https://learn.microsoft.com/en-us/window...eo-capture
Yes, I got it working as low as 320x240 - this is great. Thanks again Spriggsy!


Attached Files
.bas   Webcam5.ToFile.PromptForResolution.bas (Size: 15.94 KB / Downloads: 5)
Reply
#34
You're welcome. Glad you were able to run it successfully. When you get further down the line, let me know if you need some help with this again.
The noticing will continue
Reply




Users browsing this thread: 13 Guest(s)