[General Questions and Answers] Daniel_Laixer:
Hey! I'm a bit late, but I kind of came across a solution here: https://github.com/Genymobile/scrcpy/issues/1413#issuecomment-640273175

To summarize: create a virtual external display on your phone and connect to it with Scrcpy. Using Taskbar or any other desktop-friendly launcher is recommended.

My setup:​

Redmi Note 9 Pro with Android 11 lineage-18.1-20220902-nightly (not available to download anymore, but I guess it doesn't matter.

Ubuntu 14.04 x64 (yes, on 2023, I'm working on upgrading) running scrcpy (v1.21-2-g5704ec6, Rev: 358, Tracking: latest/edge) via snap.

adb version (added to my $PATH so that snap uses this version of adb)

Android Debug Bridge version 1.0.39

Revision 3db08f2c6889-android

Developer options enabled (aside of adb debugging)

Enabled freeform windows

Forced desktop mode

Basic instructions:​

Create a virtual display​

Vía adb o terminal (without "adb shell", and I did it as root) define one or multiple virtual displays like this:

adb shell settings put global overlay_display_devices "3840x2160/480\;3840x2160/480\;3840x2160/480\;3840x2160/480"

This is my command for a single display at 225 DPI:

adb shell settings put global overlay_display_devices 1915x998/225

You can delete all displays with this command

adb shell settings put global overlay_display_devices \"\"

Find the virtual display number​

You can see all your displays on Android with this command:

adb shell dumpsys display | grep -E 'Display [0-9]{1,2}'

You will get an output like this:

Display 1:
Display 19:
Display 21:

If you added a single display, that will be always the last one, if I'm not mistaken.

Connect to the display​

Add the --display parameter to your connection command:

scrcpy --display 21

Instructions for a script:​

This how I actually connect to my phone:

adb shell settings put global overlay_display_devices \"\"
adb shell settings put global overlay_display_devices 1915x998/225
VirtualExternalDisplay=`adb shell dumpsys display | grep -E 'Display [0-9]{1,2}' | tail -1 | sed s/\:// | awk '{print$2}'`
scrcpy -b24M --display-buffer=5 -S -w --display $VirtualExternalDisplay --encoder OMX.qcom.video.encoder.avc

I use a script to connect that includes the lines above, which do this:

Remove all virtual displays on Android (not critical, but cleaner for a loop)

Define one virtual external display.

Define a variable with the display number digits, assuming it's the last one on the output. My scripts suck but do the job for me; there's probably more efficent ways of getting the digits with regex and sh!t.

Connect to the display using the variable as the display number. There's other parameters on the command because it's the real command I use, I'm still playing around with settings to see how can I get the best quality, but they aren't required for what we're doing here.

Notes:​

Each virtual display appears as a transparent floating window on your device's real screen, what could be annoying if you want to real display while using virtual external displays.

Yes, it works via adb over wifi.

If your scrcpy version doesn't have the -K, --hid-keyboard or it doesn't work, you can use NoKeyboard.

I think that's all, I hope someone finds this helpful...