Go to file
Romain Vimont daba00a819 Dissociate virtual display size and capture size
Allow capturing virtual displays at a lower resolution using
-m/--max-size.

In the original implementation in #5370, the virtual display size was
necessarily the same as the capture size. The --max-size value was only
allowed to determine the virtual display size when no explicit size was
provided.

Since the dpi was scaled down accordingly, it is often better to create
a virtual display at the target capture size directly. However, not
everything is rendered according to the virtual display DPI. For
example, a page in Firefox is rendered too big on small virtual
displays. Thus, it makes sense to be able create a virtual display at a
given size, and capture it at a lower resolution with --max-size. This
is now possible using OpenGL filters.

Therefore, change the behavior of --max-size for virtual displays:
 - it does not impact --new-display without size argument anymore (the
   virtual display size is the main display size);
 - it is used to limit the capture size (whether an explicit size is
   provided or not).

This new behavior is consistent with main display capture.

Refs #5370 comment <https://github.com/Genymobile/scrcpy/pull/5370#issuecomment-2438944401>
Refs <https://github.com/Genymobile/scrcpy/pull/5370>
2024-11-20 13:01:57 +01:00
.github Add GitHub Actions release workflow 2024-10-27 20:31:24 +01:00
app Dissociate virtual display size and capture size 2024-11-20 13:01:57 +01:00
assets
config Upgrade Android checkstyle to 10.12.5 2023-11-15 21:13:12 +01:00
doc Dissociate virtual display size and capture size 2024-11-20 13:01:57 +01:00
gradle/wrapper Upgrade Android SDK to 35 2024-10-20 15:26:19 +02:00
server Dissociate virtual display size and capture size 2024-11-20 13:01:57 +01:00
.gitignore Add scrcpy-server to .gitignore 2023-10-21 09:01:50 +02:00
FAQ.md Document UHID 2024-03-01 00:52:28 +01:00
LICENSE Happy new year 2024! 2024-03-02 16:48:21 +01:00
README.md Document virtual display and "start app" features 2024-10-28 18:18:36 +01:00
build.gradle Upgrade Android SDK to 35 2024-10-20 15:26:19 +02:00
bump_version Add script to bump version 2021-12-10 19:50:17 +01:00
cross_win32.txt Improve crossbuild 2023-11-25 21:06:37 +01:00
cross_win64.txt Improve crossbuild 2023-11-25 21:06:37 +01:00
gradle.properties
gradlew Update to Gradle 6.3 2020-04-03 18:11:35 +02:00
gradlew.bat Update to Gradle 6.3 2020-04-03 18:11:35 +02:00
install_release.sh Update links to 2.7 2024-09-15 21:18:15 +02:00
meson.build Bump version to 2.7 2024-09-15 18:59:27 +02:00
meson_options.txt Add compilation flag for USB features 2022-02-12 14:15:07 +01:00
release.mk Rework release.mk for CI 2024-10-27 20:29:13 +01:00
release.sh Rename release.make to release.mk 2021-01-01 15:51:10 +01:00
run Fix icon path in ./run 2022-03-30 14:00:05 +02:00
settings.gradle

README.md

This GitHub repo (https://github.com/Genymobile/scrcpy) is the only official source for the project. Do not download releases from random websites, even if their name contains scrcpy.

scrcpy (v2.7)

scrcpy

pronounced "screen copy"

This application mirrors Android devices (video and audio) connected via USB or over TCP/IP, and allows to control the device with the keyboard and the mouse of the computer. It does not require any root access. It works on Linux, Windows and macOS.

screenshot

It focuses on:

  • lightness: native, displays only the device screen
  • performance: 30~120fps, depending on the device
  • quality: 1920×1080 or above
  • low latency: 35~70ms
  • low startup time: ~1 second to display the first image
  • non-intrusiveness: nothing is left installed on the Android device
  • user benefits: no account, no ads, no internet required
  • freedom: free and open source software

Its features include:

Prerequisites

The Android device requires at least API 21 (Android 5.0).

Audio forwarding is supported for API >= 30 (Android 11+).

Make sure you enabled USB debugging on your device(s).

On some devices (especially Xiaomi), you might get the following error:

java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.

In that case, you need to enable an additional option USB debugging (Security Settings) (this is an item different from USB debugging) to control it using a keyboard and mouse. Rebooting the device is necessary once this option is set.

Note that USB debugging is not required to run scrcpy in OTG mode.

Get the app

Usage examples

There are a lot of options, documented in separate pages. Here are just some common examples.

  • Capture the screen in H.265 (better quality), limit the size to 1920, limit the frame rate to 60fps, disable audio, and control the device by simulating a physical keyboard:

    scrcpy --video-codec=h265 --max-size=1920 --max-fps=60 --no-audio --keyboard=uhid
    scrcpy --video-codec=h265 -m1920 --max-fps=60 --no-audio -K  # short version
    
  • Start VLC in a new virtual display (separate from the device display):

    scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
    
  • Record the device camera in H.265 at 1920x1080 (and microphone) to an MP4 file:

    scrcpy --video-source=camera --video-codec=h265 --camera-size=1920x1080 --record=file.mp4
    
  • Capture the device front camera and expose it as a webcam on the computer (on Linux):

    scrcpy --video-source=camera --camera-size=1920x1080 --camera-facing=front --v4l2-sink=/dev/video2 --no-playback
    
  • Control the device without mirroring by simulating a physical keyboard and mouse (USB debugging not required):

    scrcpy --otg
    
  • Control the device using gamepad controllers plugged into the computer:

    scrcpy --gamepad=uhid
    scrcpy -G  # short version
    

User documentation

The application provides a lot of features and configuration options. They are documented in the following pages:

Resources

Articles

Contact

You can open an issue for bug reports, feature requests or general questions.

For bug reports, please read the FAQ first, you might find a solution to your problem immediately.

You can also use:

Donate

I'm @rom1v, the author and maintainer of scrcpy.

If you appreciate this application, you can support my open source work:

Licence

Copyright (C) 2018 Genymobile
Copyright (C) 2018-2024 Romain Vimont

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.