Manual Focus for webcam

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
Graw
Posts: 3
Joined: Fri Mar 03, 2023 10:53 am

Manual Focus for webcam

Post by Graw »

Hello,

I have an old RVCamera Version from 2015.
I want to have the possibility to use an manual Focus for a webcam.
Is this possible with the newer RVCamera Version?

The webcam supports this function. I tried it with the windows camera tool.

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Manual Focus for webcam

Post by Sergey Tkachenko »

In RVMedia from 2015 - no, it is not possible.

RVMedia supports local camera properties in Windows since version 7.2, released in 2020.

The information below is for RVMedia 7.2 and newer.

One of supported camera properties is focus distance (measured in mm). If the camera supports it, you can enable/disable autofocus, and set this distance.
The users can use the camera dialog (TRVWebCamDialog component) to change focus.
There are no documented methods for changing focus in code, but you can do it in the following way.
Select RVCamera.DeviceType = rvdtWebCamera, and choose the camera using VideoDeviceIndex.
Now you can access RVCamera.WebCam object.
Use its methods and properties.
To check if the camera supports focus change, check if rvwcpFocus in AvailableProperties.
Use the methods:
- GetPropertyAutoMode(rvwcpFocus) to get autofocus state
- SetPropertyAutoMode(rvwcpFocus) to set autofocus state
- GetPropertyValue(rvwcpFocus) to get focus distance
- SetPropertyValue(rvwcpFocus) to set focus distance
- GetPropertyRange(rvwcpFocus, ...) to get min and max possible values.
Post Reply