Skip to content

Fix size constraints for camera capture - #6922

Merged
rom1v merged 2 commits into
devfrom
camera-constraints
Jun 28, 2026
Merged

rom1v merged 2 commits into
devfrom
camera-constraints

Conversation

@rom1v

@rom1v rom1v commented Jun 27, 2026 •

Copy link
Copy Markdown
Collaborator

Only apply alignment constraint for camera

Once the camera size has been selected, do not apply any encoder maximum size constraints. Only adjust the size for alignment.


Use OpenGL for camera to adapt to the target size

The camera stream can only be rendered on a surface matching the input size. If the video constraints change the size, an intermediate OpenGL filter is required.

For example, since 1080 is not a multiple of 16, running scrcpy as follows:

scrcpy --video-source=camera --camera-size=1920x1080 --min-size-alignment=16

resulted in:

ERROR: Camera configuration error

An intermediate OpenGL filter allows adapting the size without error.


Binaries: https://github.com/rom1v/scrcpy/actions/runs/28297540213

Fixes #6919

rom1v added 2 commits June 28, 2026 12:21
Once the camera size has been selected, do not apply any encoder maximum
size constraints. Only adjust the size for alignment.

Refs #6919 <#6919>
PR #6922 <#6922>
The camera stream can only be rendered on a surface matching the input
size. If the video constraints change the size, an intermediate OpenGL
filter is required.

For example, since 1080 is not a multiple of 16, running scrcpy as
follows:

    scrcpy --video-source=camera --camera-size=1920x1080 \
           --min-size-alignment=16

resulted in:

    ERROR: Camera configuration error

An intermediate OpenGL filter allows adapting the size without error.

Fixes #6919 <#6919>
PR #6922 <#6922>
@rom1v
rom1v force-pushed the camera-constraints branch from 2d69c96 to 6f743be Compare June 28, 2026 10:24
@rom1v
rom1v merged commit 6f743be into dev Jun 28, 2026
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

Successfully merging this pull request may close these issues.

1 participant