downsizeOnError
Added in Scrcpy 1.22
- Type:
boolean - Default value:
true
Controls whether the server should downsize the video resolution when encountering initial encoding errors during startup.
By default, downsizing on error is enabled in Scrcpy, meaning the server will attempt to retry with a lower resolution when it encounters encoding errors during the initial setup of the video stream.
Encoder errors are commonly caused by unsupported resolutions that are too large for the device's encoder capabilities, especially when Scrcpy defaults to the device's native screen resolution. If you know the device only supports certain resolutions, using the maxSize option can limit the encoding resolution upfront without needing downsizeOnError to retry after failure, which takes additional time.
This only applies to errors encountered during the first attempt to start the video encoding, not to errors that occur later during the streaming session.
If disabled (false), any encoding error during the initial setup will immediately cause the server to quit without attempting to use a lower resolution. Using the maxSize option proactively limits resolution and can prevent these errors entirely.
Related options
maxSize: Sets the maximum width and height of the video stream to prevent encoding errors from unsupported resolutions
Example
import { ScrcpyOptions1_22 } from "@yume-chan/scrcpy";
const options = new ScrcpyOptions1_22({
downsizeOnError: false, // Disable downsizing on error
});