Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.91k stars 10.56k forks source link

Scrcpy works only after adding a manual command each time #4296

Open TheKidRock opened 1 year ago

TheKidRock commented 1 year ago

I installed latest version of Scrcpy (scrcpy-win64-v2.1.1.zip) on my Windows 11 PC. I am trying to connect my Android TV (Android 9).

The problem I am facing is that when I use the command C:\Scrcpy>scrcpy.exe , I get errors.

But when I use the command C:\Scrcpy>scrcpy --video-encoder 'OMX.google.h264.encoder' , scrcpy works and my Android TV is mirrored on my PC.

Here is the screenshot of the commands.

scrcpy

How can I solve this issue? Please help.

rom1v commented 1 year ago

The default encoder does not work on your device, so you have to explicitly pass the encoder as you did.

You can do it in a script, see at the end of https://github.com/Genymobile/scrcpy/blob/master/doc/windows.md#run

TheKidRock commented 1 year ago

The default encoder does not work on your device, so you have to explicitly pass the encoder as you did.

You can do it in a script, see at the end of https://github.com/Genymobile/scrcpy/blob/master/doc/windows.md#run

Thanks for the advice. Checked the above link, but since I am not a technical person, I could not figure out what to do. Is there any video tutorial that I can watch to use the script?

Update: I figured it out. Created a bat file with the command and it worked. Thanks once again.

BTW, do I need to install codec/encoder on my PC so that scrcpy works without having to use the additional script bat file? If yes, where do I download from?