-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: camera optical zoom support #4452
Comments
Yes, technically it's possible.
Yes. It will require some changes in the control code, because currently controls are disabled when video source is camera (as if |
Other camera "PRO" features would be great as well, like focus, exposure and such. I don't know how many camera features are exposed though. |
Most phones accomplish optical zoom with separate cameras. The Pixel 8 Pro has three rear cameras, each with its own lens and and sensor. I wonder if its possible to have them return separate camera-id's. I would want to select the lens being used instead of relying on a continuous camera-zoom parameter and allowing the phone to determine the camera. |
@whatupjeff You might be interested in the whole discussion about physical/logical cameras here: #4392 (comment) (and further comments). |
speaking of zoom, i was wondering if it was possible to switch witch lens was being used to the wide angle lens in my case or the telephoto lens ( not necessarily on the fly ) edit: wait hang on i think thats what jeff asked |
Has anyone else looked into it? Iirc the other day when I was going through the api documentation, there was a mention of an endpoint that allowed you to choose an auto-exposure & antibanding mode from the profiles available... |
@sortedcord Please let me know if you found a solution |
@rom1v Sorry for the ping, but what are the chances of manual exposure and autofocus control coming soon ? |
I don't plan to implement them soon. There are other things to work on. |
Every smartphone camera has some kind of Auto Focus by default, maybe you want Manual Focus (turn off auto focus), is useful to camera don't get confused at leave things out of focus, some thing like a "locked" focus. I want that. Right now I'm recording my desktop table from above with smartphone with Of course I would like a full manual control like Pro Mode in smartphone cameras but maybe it's a niche use. Photography enthusiast here. Talking about zoom ... I did try |
I needed to be able to lock exposure and such manually for my usecase. I don't know if ill make this actually usable via cli options and such since I basically never need them changed but if anyone is in a similar boat and doesnt mind changing source code here is the change I made (in server/src/main/java/com/genymobile/scrcpy/video/CameraCapture.java: private CaptureRequest createCaptureRequest(Surface surface) throws CameraAccessException {
CaptureRequest.Builder requestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);
requestBuilder.addTarget(surface);
// Have to turn this off to be able to control ae, awb, and af separately from what I can tell.
requestBuilder.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_OFF);
// Turn off auto exposure
requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
// Handle white balance automatically
requestBuilder.set(CaptureRequest.CONTROL_AWB_MODE,
CaptureRequest.CONTROL_AWB_MODE_AUTO);
// Auto focus on auto
requestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_VIDEO);
// Setting sensor sensitivity this is basically iso
requestBuilder.set(CaptureRequest.SENSOR_SENSITIVITY, 150);
// Setting sensor exposure time this and frame duration are in nano seconds. So this would be roughly 1/60th of a second
requestBuilder.set(CaptureRequest.SENSOR_EXPOSURE_TIME, 16000000L);
// Frame rate im pretty sure so this is roughly 1/30th of a second or 30fps :P
requestBuilder.set(CaptureRequest.SENSOR_FRAME_DURATION, 33000000L);
if (fps > 0) {
requestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, new Range<>(fps, fps));
}
return requestBuilder.build();
} edit: Keep in mind haven't thoroughly tested this but just wanted to put out there. It seems to work for me but your mileage may vary. Some devices also don't support some of these options from what I can tell. Also ranges vary etc |
Is your feature request related to a problem? Please describe.
This is a feature request! I'd love to be able to use the optical zoom on my cameras when doing
--video-source=camera
!Describe the solution you'd like
--camera-zoom 1.5
would ideally zoom to 1.5x, in my view.Describe alternatives you've considered
I don't know? It'd be neat to be able to change the zoom live. I don't know if scrcpy has any other properties that are potentially dynamic like this?
One wild alternative would be to build a camera app that exposes a way to zoom and to stream the phone output, rather than a video camera. This feels like it would have more latency & overhead, & would require some app dev.
Additional context
Now that we can stream cameras, there's a host of various video settings that would be nice to be able to tune. Maybe there's some android app that can help us do this? Things like contrast, exposure compensation, color balance, even ideally things like having LUTs or log-output control would be incredible to add, especially if we can dynamically adjust some of these settings.
The text was updated successfully, but these errors were encountered: