v1.22
Genymobile/scrcpyv1.22Jan 29, 2022by rom1v
AI Summary
Introduced HID mouse support and OTG mode, enabled DPI awareness by default on Windows, and implemented automatic downscaling on encoder errors.
Key Highlights
- Added HID mouse support
- Added OTG mode (HID only)
- Enabled DPI awareness by default on Windows
- Automatically retries with a lower definition on MediaCodec error
New Features
- --hid-mouse
- --otg
- Windows DPI awareness
- --no-cleanup
- Raw H.264 video stream support
- Open terminal here script on Windows
Full Release Notes
_To receive a notification on new releases, click on **Watch > Custom > Releases** on the top._ --- **scrcpy v1.22** Changes since v1.21: - Add HID mouse support (#2916) - Add OTG mode (HID only) (#2974) - Enable DPI awareness by default on Windows (#40, #2865) - Automatically retry with a lower definition on MediaCodec error (#2947) - Add a shortcut "open a terminal here" on Windows (#2970) - Add icon to scrcpy.exe (#2815) - Add server options to send raw H.264 video stream (#2971) - Fix process execution (mainly) on Windows 7 (#2838, #2840) - Fix adb server hang due to signal masking (#2870, #2873) - Fix input injection on some custom ROMs (#2250, #2946) - Fix possible overflow on copy-paste (#2859) - Upgrade SDL to 2.0.20 in Windows releases - Upgrade FFmpeg to 5.0 in Windows 64-bit releases (#1753, #2952) - Various technical refactors and fixes --- # Highlights ## Add HID mouse support Similar to the `--hid-keyboard` (or `-K`) added in scrcpy v1.20 (#2632), this release introduces a new option `--hid-mouse` (or `-M`) (#2916): ```bash scrcpy -K # HID keyboard scrcpy -M # HID mouse scrcpy -KM # HID keyboard and mouse ``` The mouse is "captured": the mouse pointer disappears from the computer and appears on the Android device. Special captures keys, either <kbd>Alt</kbd> or <kbd>Super</kbd>, toggle (disable or enable) the mouse capture. Use one of them to give the control of the mouse back to the computer. _These capture keys do not conflict with shortcuts, since a shortcut is always a combination of the <kbd>MOD</kbd> key and some other key, while the capture key triggers an action only if it is pressed and released alone._ Like HID keyboard, it works only when the device is connected via USB, and is only supported on Linux. ## OTG mode A new option `--otg` (#2974) allows to run scrcpy with only physical keyboard (#2632) and mouse (#2916) simulation, without mirroring and without requiring _adb_ (USB debugging), as if the computer keyboard and mouse were plugged directly to the device via an OTG cable. ```bash scrcpy --otg # Pass the serial if several USB devices are available scrcpy --otg -s 0123456789abcdef ``` This opens a window (with just the scrcpy logo, there is no mirroring), which, when focused, fowards the keyboard and mouse to the device:  The mouse capture works the same as explained in the previous section. Since it works even with _USB debugging_ disabled (i.e. without _adb_), it could for example be used to enable _USB debugging_ on a device with a broken touchscreen (to then run scrcpy normally). Like HID keyboard and HID mouse, this feature works only when the device is connected via USB, and is only supported on Linux. ## DPI awareness on Windows With HiDPI scaling on Windows, by default the quality was awful (#40, #2865). The [FAQ](https://github.com/Genymobile/scrcpy/blob/v1.21/FAQ.md#the-quality-is-low) explained how to force correct HiDPI scaling by the application to fix the issue, but it was not convenient (and nobody reads the FAQ anyway). On this new version, DPI awareness is enabled by default. ## "Open a terminal here" on Windows `scrcpy` is a command line application, and is configured with command line arguments. On Windows, the file explorer lacks an "open a terminal here" feature, to open a terminal in the _scrcpy_ directory, ready to execute `adb` or `scrcpy`. The release now contains a file `open_a_terminal_here.bat` (#2970). Just double-click on it. This will simplify passing arguments on Windows, and give a hint to users who don't know [how to use the command line](https://github.com/Genymobile/scrcpy/blob/v1.21/FAQ.md#command-line-on-windows) (remember, nobody reads the FAQ). ## Auto-downscale on MediaCodec error Some devices are not able to encode a video at the device screen definition. In that case, running `scrcpy` without argument just failed with an error. The solution is simple: reduce the resolution (`scrcpy -m1024` for example), as explained in the [FAQ](https://github.com/Genymobile/scrcpy/blob/v1.21/FAQ.md#exception) (did I mention that nobody reads the FAQ?). In this new version, if the encoder fails before the first video frame, then scrcpy automatically retries with a lower definition (#2947), so in most cases it should work without explicitly passing a size argument. It's better when it works out-of-the-box.