Skip to content
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

zoom on phone #5885

Open
toto6976 opened this issue Feb 28, 2025 · 7 comments
Open

zoom on phone #5885

toto6976 opened this issue Feb 28, 2025 · 7 comments

Comments

@toto6976
Copy link

Hi,
Is it possible to have a zoom with "--video-source=camera --camera-id=1" ?

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2025

Camera zoom is not implemented. Depending on what you want, --crop=… might fit your needs.

@toto6976
Copy link
Author

I don't know how to use --crop . Can you see me ?

@toto6976
Copy link
Author

with "scrcpy --crop 1752:2800:500:0" i have that error

[server] INFO: Device: [LGE] lge LG-H870 (Android 14)
[server] INFO: Using camera '1'
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.IllegalArgumentException: Crop Rect(500, 0 - 2252, 2800) exceeds the input area (2560x1920)
at com.genymobile.scrcpy.video.VideoFilter.addCrop(VideoFilter.java:59)
at com.genymobile.scrcpy.video.CameraCapture.prepare(CameraCapture.java:129)
at com.genymobile.scrcpy.video.SurfaceEncoder.streamCapture(SurfaceEncoder.java:78)
at com.genymobile.scrcpy.video.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-video-SurfaceEncoder(SurfaceEncoder.java:296)
at com.genymobile.scrcpy.video.SurfaceEncoder$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
ERROR: "adb reverse --remove" exited unexpectedly
ERROR: Could not retrieve device information
ERROR: Server connection failed

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2025

You must specify a rectangle width:height:x:y which is fully inside the input size.

For example, if you capture at 2560x1920, then you can crop 500 pixels on every side: --crop=1560:920:500:500.

https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#crop

@toto6976
Copy link
Author

I would like to enlarge the area located at the top left for example. I don't see how to do it with the --crop command?!

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2025

For the top left quarter: --crop=1280:960:0:0.

@toto6976
Copy link
Author

toto6976 commented Feb 28, 2025

Great ! is it possible to make the top even bigger??

i understand how to do it : --crop=960:720:0:0 is what i want to have.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants