Giter Club home page Giter Club logo

py-scrcpy-client's Introduction

Hi there 👋

  • 🔭 I’m currently working on TTS / SVS / SVC models.

py-scrcpy-client's People

Contributors

aentwist avatar dependabot[bot] avatar drryanhuang avatar fieryrms avatar leng-yue avatar milkflavor avatar triwinds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-scrcpy-client's Issues

请问下如何控制

目前启动后只能查看不能控制,还有一个参数名错了client.max_width这是最大尺寸高度

Show "loading" when i run main.py

Hi,when i use a phone connected to my pc, and check adb devices is show the serial number, then i run main.py (v0.3.7), py-client
just show "loading" and have not response. And i use original scrcpy(v1.12) run is ok, Would your help me to debug it? TKS.

phone config:
Android 9
resolution: 1200x800

ps: I have another phone just run py-client OK.

Can I use the repo to send events to scrcpy server on Android from a recorded getevent ?

I have the following recorded scroll:

[  116385.268385] 0003 0039 000002c5
[  116385.268385] 0003 0030 00000008
[  116385.268385] 0003 0035 00000186 -  x
[  116385.268385] 0003 0036 0000029c  - y
[  116385.268385] 0001 014a 00000001  -- finger down
[  116385.268385] 0000 0000 00000000
[  116385.300193] 0003 0035 00000185
[  116385.300193] 0003 0036 000002b0
[  116385.300193] 0000 0000 00000000
[  116385.310616] 0003 0035 00000184
[  116385.310616] 0003 0036 000002d1
[  116385.310616] 0000 0000 00000000
[  116385.321030] 0003 0035 00000183
[  116385.321030] 0003 0036 0000030b
[  116385.321030] 0000 0000 00000000
[  116385.331669] 0003 0030 00000007
[  116385.331669] 0003 0035 00000180
[  116385.331669] 0003 0036 000003a1
[  116385.331669] 0000 0000 00000000
[  116385.342048] 0003 0030 00000006
[  116385.342048] 0003 0035 0000017f
[  116385.342048] 0003 0036 000003c9
[  116385.342048] 0000 0000 00000000
[  116385.352433] 0003 0036 000003f1
[  116385.352433] 0000 0000 00000000
[  116385.363175] 0003 0030 00000005
[  116385.363175] 0003 0035 00000180
[  116385.363175] 0003 0036 0000041c
[  116385.363175] 0000 0000 00000000
[  116385.383405] 0003 0039 ffffffff
[  116385.383405] 0001 014a 00000000  -- finger up
[  116385.383405] 0000 0000 00000000

I want to replay it using scrcpy, can it be done ?

在Mac端运行你的项目报错了

Traceback (most recent call last):
  File "/Users/cfr/PycharmProjects/py-scrcpy-client/scrcpy/core.py", line 184, in __stream_loop
    raw_h264 = self.__video_socket.recv(0x10000)
BlockingIOError: [Errno 35] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cfr/PycharmProjects/py-scrcpy-client/scrcpy_ui/main.py", line 92, in handler
    evt.position().x() / ratio, evt.position().y() / ratio, action
AttributeError: 'QMouseEvent' object has no attribute 'position'

看着好像是引入包的时候报错了
image

image

无法获取视频流

我在我的荣耀9x上,尝试使用"pip install scrcpy-client[ui]、py-scrcpy",他成功运行了,但是没有画面。非常抱歉的是,我只有这一部手机,所以我没法在另外的机器上进行测试(或许可以试一下模拟器)。

我的设备信息:
名称:HONOR9X (荣耀9x)
系统:Harmony2.0.0 (鸿蒙)
型号:HLK-AL00
内存:6.0GB

后来我尝试git拉取源码并调试,确实在调试中发现了一点问题。下面是图片。

首先是使用debug进行调试,发现获取不到视频流,读取到的字节为空。
Snipaste_2022-05-31_22-25-54

这是在使用 py-scrcpy-client 时 scrcpy-server 的显示信息
Snipaste_2022-05-31_22-27-25

这是在使用 scrcpy-client 时 scrcpy-server 的显示信息
Snipaste_2022-05-31_22-29-42

由于我对Android不是很熟悉,暂时不明白时什么原因导致的,根据我搜索的资料来看,可能是因为鸿蒙系统对于Android的定制化程度比较深的原因。
我会尽量想办法解决这个问题 :(

Low text quality

Is there a way to increase the quality of the screen? I am have trouble reading some of the text. Maybe increasing the resolution? How could I go about doing that?

Thank you

Problem with `av` library on macos 13.3.1

Hello,
im using Mac (M2, 13.3.1) and im getting this error when im trying to compile the library (with help of pip)

pip3 install scrcpy-client  
Collecting scrcpy-client
  Using cached scrcpy_client-0.4.1-py3-none-any.whl (55 kB)
Collecting adbutils<0.15.0,>=0.14.1
  Using cached adbutils-0.14.1-py3-none-any.whl
Collecting av<10.0.0,>=9.2.0
  Using cached av-9.2.0.tar.gz (2.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting opencv-python<5.0.0,>=4.5.3
  Using cached opencv_python-4.7.0.72-cp37-abi3-macosx_11_0_arm64.whl (32.6 MB)
Collecting whichcraft
  Using cached whichcraft-0.6.1-py2.py3-none-any.whl (5.2 kB)
Collecting requests
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting deprecation<3.0,>=2.0.6
  Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Collecting retry>=0.9
  Using cached retry-0.9.2-py2.py3-none-any.whl (8.0 kB)
Collecting apkutils2<2.0,>=1.0.0
  Using cached apkutils2-1.0.0-py3-none-any.whl
Collecting numpy>=1.21.2
  Using cached numpy-1.24.3-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
Collecting pyelftools
  Using cached pyelftools-0.29-py2.py3-none-any.whl (174 kB)
Collecting cigam
  Using cached cigam-0.0.3-py3-none-any.whl (3.8 kB)
Collecting xmltodict
  Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Collecting packaging
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting decorator>=3.4.2
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting py<2.0.0,>=1.4.26
  Using cached py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl (121 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Building wheels for collected packages: av
  Building wheel for av (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for av (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [136 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/deprecation.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/datasets.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/about.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__main__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      creating build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      creating build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/codec/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      creating build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      creating build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      creating build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      creating build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      creating build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/sidedata/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      creating build/lib.macosx-10.9-universal2-cpython-311/av/data
      copying av/data/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/data
      copying av/utils.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/frame.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/descriptor.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/logging.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/format.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/error.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/buffer.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/packet.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/bytesource.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/enum.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/option.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/stream.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/dictionary.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/plane.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/video/frame.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/reformatter.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/format.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/codeccontext.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/stream.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/plane.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/codec/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/codec/context.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/codec/codec.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/container/input.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/core.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/pyio.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/output.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/streams.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/audio/frame.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/fifo.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/format.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/layout.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/codeccontext.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/stream.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/resampler.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/plane.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/subtitles/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/codeccontext.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/stream.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/subtitle.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/filter/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/graph.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/context.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/filter.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/pad.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/link.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/sidedata/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/sidedata/motionvectors.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/sidedata/sidedata.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/data/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/data
      copying av/data/stream.pxd -> build/lib.macosx-10.9-universal2-cpython-311/av/data
      running build_ext
      building 'av.plane' extension
      creating build/temp.macosx-10.9-universal2-cpython-311
      creating build/temp.macosx-10.9-universal2-cpython-311/src
      creating build/temp.macosx-10.9-universal2-cpython-311/src/av
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/Cellar/ffmpeg/6.0/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/av/plane.c -o build/temp.macosx-10.9-universal2-cpython-311/src/av/plane.o
      clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g build/temp.macosx-10.9-universal2-cpython-311/src/av/plane.o -L/opt/homebrew/Cellar/ffmpeg/6.0/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-universal2-cpython-311/av/plane.cpython-311-darwin.so
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavformat.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavutil.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavcodec.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libswresample.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libswscale.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavdevice.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavfilter.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavfilter.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavcodec.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libswscale.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libswresample.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavutil.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavdevice.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavformat.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      building 'av.dictionary' extension
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/Cellar/ffmpeg/6.0/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/av/dictionary.c -o build/temp.macosx-10.9-universal2-cpython-311/src/av/dictionary.o
      clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g build/temp.macosx-10.9-universal2-cpython-311/src/av/dictionary.o -L/opt/homebrew/Cellar/ffmpeg/6.0/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-universal2-cpython-311/av/dictionary.cpython-311-darwin.so
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavdevice.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavcodec.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavformat.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavfilter.dylib) was built for newer macOS version (13.0) than being linked (11.0)dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libavutil.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libswresample.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: dylib (/opt/homebrew/Cellar/ffmpeg/6.0/lib/libswscale.dylib) was built for newer macOS version (13.0) than being linked (11.0)
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavcodec.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavutil.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavfilter.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavformat.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libswresample.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libavdevice.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      ld: warning: ignoring file /opt/homebrew/Cellar/ffmpeg/6.0/lib/libswscale.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
      building 'av.stream' extension
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/Cellar/ffmpeg/6.0/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/av/stream.c -o build/temp.macosx-10.9-universal2-cpython-311/src/av/stream.o
      src/av/stream.c:2361:29: error: no member named 'codec' in 'struct AVStream'
        switch (__pyx_v_c_stream->codec->codec_type) {
                ~~~~~~~~~~~~~~~~  ^
      src/av/stream.c:2979:31: error: no member named 'codec' in 'struct AVStream'
        __pyx_t_1 = __pyx_v_stream->codec;
                    ~~~~~~~~~~~~~~  ^
      src/av/stream.c:3099:15: warning: assigning to 'struct AVCodec *' from 'const struct AVCodec *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          __pyx_t_6 = __pyx_v_self->_codec_context->codec;
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/av/stream.c:3884:132: error: no member named 'codec' in 'struct AVStream'
        __pyx_t_7 = __pyx_f_2av_5error_err_check(avcodec_parameters_from_context(__pyx_v_self->_stream->codecpar, __pyx_v_self->_stream->codec), 0, NULL); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 150, __pyx_L1_error)
                                                                                                                  ~~~~~~~~~~~~~~~~~~~~~  ^
      1 warning and 3 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for av
Failed to build av
ERROR: Could not build wheels for av, which is required to install pyproject.toml-based projects

may update the av to version 10 will help, but honestly im not sure what im doing wrong.

Thank you for any advice (-:
M.

error: subprocess-exited-with-error when install python package

C:\Users\Administrator>pip install scrcpy-client[ui]
Collecting scrcpy-client[ui]
Using cached scrcpy_client-0.4.1-py3-none-any.whl.metadata (2.8 kB)
Collecting PySide6<7.0.0,>=6.3.0 (from scrcpy-client[ui])
Using cached PySide6-6.7.0-cp39-abi3-win_amd64.whl.metadata (5.5 kB)
Collecting adbutils<0.15.0,>=0.14.1 (from scrcpy-client[ui])
Using cached adbutils-0.14.1-py3-none-win_amd64.whl.metadata (918 bytes)
Collecting av<10.0.0,>=9.2.0 (from scrcpy-client[ui])
Using cached av-9.2.0.tar.gz (2.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [74 lines of output]
Compiling av\buffer.pyx because it changed.
[1/1] Cythonizing av\buffer.pyx
Compiling av\bytesource.pyx because it changed.
[1/1] Cythonizing av\bytesource.pyx
Compiling av\descriptor.pyx because it changed.
[1/1] Cythonizing av\descriptor.pyx
Compiling av\dictionary.pyx because it changed.
[1/1] Cythonizing av\dictionary.pyx
Compiling av\enum.pyx because it changed.
[1/1] Cythonizing av\enum.pyx
Compiling av\error.pyx because it changed.
[1/1] Cythonizing av\error.pyx
Compiling av\format.pyx because it changed.
[1/1] Cythonizing av\format.pyx
Compiling av\frame.pyx because it changed.
[1/1] Cythonizing av\frame.pyx
performance hint: av\logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare 'log_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on 'log_callback' to allow an error code to be returned.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  cdef const char *log_context_name(void *ptr) nogil:
      cdef log_context *obj = <log_context*>ptr
      return obj.name

  cdef lib.AVClass log_class
  log_class.item_name = log_context_name
                        ^
  ------------------------------------------------------------

  av\logging.pyx:216:22: Cannot assign type 'const char *(void *) except? NULL nogil' to 'const char *(*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'log_context_name'.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  # Start the magic!
  # We allow the user to fully disable the logging system as it will not play
  # nicely with subinterpreters due to FFmpeg-created threads.
  if os.environ.get('PYAV_LOGGING') != 'off':
      lib.av_log_set_callback(log_callback)
                              ^
  ------------------------------------------------------------

  av\logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback' (alias of 'void (*)(void *, int, const char *, va_list) noexcept nogil'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'log_callback'.
  Compiling av\logging.pyx because it changed.
  [1/1] Cythonizing av\logging.pyx
  Traceback (most recent call last):
    File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 157, in <module>
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-_cvakgx9\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: av\logging.pyx
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

screen cropping

Is there a way to call the scrcpy.jar and have a portion on the device screen be cropped?

如何通过tcp连接到设备

您好,我目前想做的是移植一个C#版本的ScrcpyClient。
我首先阅读了Sctcpy仓库的Developer.md,了解了工作机理。
之后查到了您的仓库。阅读了代码之后我产生了一些疑问。希望能够得到您的解答!

期待得到您的回复!

scrcpy from commandline works but scrcpy-client-0.3.5 doesn't

Hi, I am encountering an issue with scrpy-client-0.3.5 (and scrpy-client-0.3.6) and I am not sure how to get it to work. Running scrcpy directly works as expected but using python didn't work for me. Any idea how to solve this?
screencapture video

ADB Logcat
11-22 18:57:56.778 1411 1411 E adbd : failed to connect to socket 'localabstract:scrcpy': could not connect to localabstract address 'localabstract:scrcpy'

ConnectionError: Did not receive Dummy Byte!

I'm trying to write a simplest demo like

from adbutils import adb
import scrcpy


def on_frame(frame):
    if frame is not None:
        print(type(frame))

device = adb.device()

client = scrcpy.Client(
            max_width=540, device=device)
client.start()
client.add_listener(scrcpy.EVENT_FRAME, on_frame)


while client.alive:
    client.start()

for the hardware setting, i only have a phone with USB cable connected.
all run in Ubuntu 16.04, python 3.9.5,

here is the conda list

# packages in environment at /home/alex/anaconda3/envs/tf2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
_openmp_mutex             4.5                       1_gnu    defaults
_tflow_select             2.1.0                       gpu    defaults
absl-py                   0.13.0           py39h06a4308_0    defaults
adbutils                  0.11.0                   pypi_0    pypi
aiohttp                   3.7.4            py39h27cfd23_1    defaults
apkutils2                 1.0.0                    pypi_0    pypi
argon2-cffi               20.1.0           py39h27cfd23_1    defaults
astor                     0.8.1            py39h06a4308_0    defaults
astunparse                1.6.3                      py_0    defaults
async-timeout             3.0.1            py39h06a4308_0    defaults
async_generator           1.10               pyhd3eb1b0_0    defaults
attrs                     21.2.0             pyhd3eb1b0_0    defaults
av                        8.0.3            py39h7b1e1d3_0    conda-forge
backcall                  0.2.0              pyhd3eb1b0_0    defaults
blas                      1.0                         mkl    defaults
bleach                    4.0.0              pyhd3eb1b0_0    defaults
blinker                   1.4              py39h06a4308_0    defaults
brotlipy                  0.7.0           py39h27cfd23_1003    defaults
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h27cfd23_0    defaults
ca-certificates           2021.5.30            ha878542_0    conda-forge
cachetools                4.2.2              pyhd3eb1b0_0    defaults
certifi                   2021.5.30        py39h06a4308_0    defaults
cffi                      1.14.6           py39h400218f_0    defaults
chardet                   3.0.4           py39h06a4308_1003    defaults
cigam                     0.0.3                    pypi_0    pypi
click                     8.0.1              pyhd3eb1b0_0    defaults
coverage                  5.5              py39h27cfd23_2    defaults
cryptography              3.4.7            py39hd23ed53_0    defaults
cudatoolkit               10.1.243             h6bb024c_0    defaults
cudnn                     7.6.5                cuda10.1_0    defaults
cupti                     10.1.168                      0    defaults
cython                    0.29.24          py39h295c915_0    defaults
dbus                      1.13.18              hb2f20db_0    defaults
decorator                 5.0.9              pyhd3eb1b0_0    defaults
defusedxml                0.7.1              pyhd3eb1b0_0    defaults
deprecation               2.1.0                    pypi_0    pypi
entrypoints               0.3              py39h06a4308_0    defaults
expat                     2.4.1                h2531618_2    defaults
ffmpeg                    4.3.2                hca11adc_0    conda-forge
fontconfig                2.13.1               h6c09931_0    defaults
freetype                  2.10.4               h5ab3b9f_0    defaults
gast                      0.4.0                      py_0    defaults
glib                      2.69.0               h5202010_0    defaults
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
google-auth               1.33.0             pyhd3eb1b0_0    defaults
google-auth-oauthlib      0.4.4              pyhd3eb1b0_0    defaults
google-pasta              0.2.0                      py_0    defaults
grpcio                    1.36.1           py39h2157cd5_1    defaults
gst-plugins-base          1.14.0               h8213a91_2    defaults
gstreamer                 1.14.0               h28cd5cc_2    defaults
h5py                      2.10.0           py39hec9cf62_0    defaults
hdf5                      1.10.6               hb1b8bf9_0    defaults
icu                       58.2                 he6710b0_3    defaults
idna                      2.10               pyhd3eb1b0_0    defaults
importlib-metadata        3.10.0           py39h06a4308_0    defaults
importlib_metadata        3.10.0               hd3eb1b0_0    defaults
intel-openmp              2021.3.0          h06a4308_3350    defaults
ipykernel                 5.3.4            py39hb070fc8_0    defaults
ipython                   7.26.0           py39hb070fc8_0    defaults
ipython_genutils          0.2.0              pyhd3eb1b0_1    defaults
ipywidgets                7.6.3              pyhd3eb1b0_1    defaults
jedi                      0.18.0           py39h06a4308_1    defaults
jinja2                    3.0.1              pyhd3eb1b0_0    defaults
jpeg                      9b                   h024ee3a_2    defaults
jsonschema                3.2.0                      py_2    defaults
jupyter                   1.0.0            py39h06a4308_7    defaults
jupyter_client            6.1.12             pyhd3eb1b0_0    defaults
jupyter_console           6.4.0              pyhd3eb1b0_0    defaults
jupyter_core              4.7.1            py39h06a4308_0    defaults
jupyterlab_pygments       0.1.2                      py_0    defaults
jupyterlab_widgets        1.0.0              pyhd3eb1b0_1    defaults
keras-preprocessing       1.1.2              pyhd3eb1b0_0    defaults
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 h3be6417_0    defaults
ld_impl_linux-64          2.35.1               h7274673_9    defaults
libffi                    3.3                  he6710b0_2    defaults
libgcc-ng                 9.3.0               h5101ec6_17    defaults
libgfortran-ng            7.5.0               ha8ba4b0_17    defaults
libgfortran4              7.5.0               ha8ba4b0_17    defaults
libgomp                   9.3.0               h5101ec6_17    defaults
libpng                    1.6.37               hbc83047_0    defaults
libprotobuf               3.17.2               h4ff587b_1    defaults
libsodium                 1.0.18               h7b6447c_0    defaults
libstdcxx-ng              9.3.0               hd4cf53a_17    defaults
libtiff                   4.1.0                h2733197_1    defaults
libuuid                   1.0.3                h1bed415_2    defaults
libxcb                    1.14                 h7b6447c_0    defaults
libxml2                   2.9.12               h03d6c58_0    defaults
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
markdown                  3.3.4            py39h06a4308_0    defaults
markupsafe                2.0.1            py39h27cfd23_0    defaults
matplotlib-inline         0.1.2              pyhd3eb1b0_2    defaults
mistune                   0.8.4           py39h27cfd23_1000    defaults
mkl                       2021.3.0           h06a4308_520    defaults
mkl-service               2.4.0            py39h7f8727e_0    defaults
mkl_fft                   1.3.0            py39h42c9631_2    defaults
mkl_random                1.2.2            py39h51133e4_0    defaults
multidict                 5.1.0            py39h27cfd23_2    defaults
nbclient                  0.5.3              pyhd3eb1b0_0    defaults
nbconvert                 6.1.0            py39h06a4308_0    defaults
nbformat                  5.1.3              pyhd3eb1b0_0    defaults
ncurses                   6.2                  he6710b0_1    defaults
nest-asyncio              1.5.1              pyhd3eb1b0_0    defaults
nettle                    3.6                  he412f7d_0    conda-forge
notebook                  6.4.2            py39h06a4308_0    defaults
numpy                     1.19.5                   pypi_0    pypi
numpy-base                1.20.3           py39h74d4b33_0    defaults
oauthlib                  3.1.1              pyhd3eb1b0_0    defaults
olefile                   0.46               pyh9f0ad1d_1    conda-forge
opencv-python             4.5.3.56                 pypi_0    pypi
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hf7af979_0    conda-forge
openssl                   1.1.1k               h27cfd23_0    defaults
opt_einsum                3.3.0              pyhd3eb1b0_1    defaults
packaging                 21.0               pyhd3eb1b0_0    defaults
pandocfilters             1.4.3            py39h06a4308_1    defaults
parso                     0.8.2              pyhd3eb1b0_0    defaults
pcre                      8.45                 h295c915_0    defaults
pexpect                   4.8.0              pyhd3eb1b0_3    defaults
pickleshare               0.7.5           pyhd3eb1b0_1003    defaults
pillow                    8.3.1            py39h2c7a002_0    defaults
pip                       21.1.3           py39h06a4308_0    defaults
prometheus_client         0.11.0             pyhd3eb1b0_0    defaults
prompt-toolkit            3.0.17             pyh06a4308_0    defaults
prompt_toolkit            3.0.17               hd3eb1b0_0    defaults
protobuf                  3.17.2           py39h295c915_0    defaults
ptyprocess                0.7.0              pyhd3eb1b0_2    defaults
py                        1.10.0                   pypi_0    pypi
pyasn1                    0.4.8                      py_0    defaults
pyasn1-modules            0.2.8                      py_0    defaults
pycparser                 2.20                       py_2    defaults
pyelftools                0.27                     pypi_0    pypi
pygments                  2.9.0              pyhd3eb1b0_0    defaults
pyjwt                     2.1.0            py39h06a4308_0    defaults
pyopenssl                 20.0.1             pyhd3eb1b0_1    defaults
pyparsing                 2.4.7              pyhd3eb1b0_0    defaults
pyqt                      5.9.2            py39h2531618_6    defaults
pyrsistent                0.18.0           py39h7f8727e_0    defaults
pyside6                   6.1.3                    pypi_0    pypi
pysocks                   1.7.1            py39h06a4308_0    defaults
python                    3.9.5                h12debd9_4    defaults
python-dateutil           2.8.2              pyhd3eb1b0_0    defaults
python-flatbuffers        1.12               pyhd3eb1b0_0    defaults
python_abi                3.9                      2_cp39    conda-forge
pyyaml                    5.4.1            py39h27cfd23_1    defaults
pyzmq                     22.2.1           py39h295c915_1    defaults
qt                        5.9.7                h5867ecd_1    defaults
qtconsole                 5.1.0              pyhd3eb1b0_0    defaults
readline                  8.1                  h27cfd23_0    defaults
requests                  2.25.1             pyhd3eb1b0_0    defaults
requests-oauthlib         1.3.0                      py_0    defaults
retry                     0.9.2                    pypi_0    pypi
rsa                       4.7.2              pyhd3eb1b0_1    defaults
scipy                     1.6.2            py39had2a1c9_1    defaults
scrcpy-client             0.3.4                    pypi_0    pypi
send2trash                1.5.0              pyhd3eb1b0_1    defaults
setuptools                52.0.0           py39h06a4308_0    defaults
shiboken6                 6.1.3                    pypi_0    pypi
sip                       4.19.13          py39h2531618_0    defaults
six                       1.16.0             pyhd3eb1b0_0    defaults
sqlite                    3.36.0               hc218d9a_0    defaults
tensorboard               2.4.0              pyhc547734_0    defaults
tensorboard-plugin-wit    1.6.0                      py_0    defaults
tensorflow                2.4.1           gpu_py39h8236f22_0    defaults
tensorflow-base           2.4.1           gpu_py39h29c2da4_0    defaults
tensorflow-estimator      2.5.0              pyh7b7c402_0    defaults
tensorflow-gpu            2.4.1                h30adc30_0    defaults
termcolor                 1.1.0            py39h06a4308_1    defaults
terminado                 0.9.4            py39h06a4308_0    defaults
testpath                  0.5.0              pyhd3eb1b0_0    defaults
tk                        8.6.10               hbc83047_0    defaults
tornado                   6.1              py39h27cfd23_0    defaults
traitlets                 5.0.5              pyhd3eb1b0_0    defaults
typing-extensions         3.10.0.0             hd3eb1b0_0    defaults
typing_extensions         3.10.0.0           pyh06a4308_0    defaults
tzdata                    2021a                h52ac0ba_0    defaults
urllib3                   1.26.6             pyhd3eb1b0_1    defaults
wcwidth                   0.2.5                      py_0    defaults
webencodings              0.5.1            py39h06a4308_1    defaults
werkzeug                  1.0.1              pyhd3eb1b0_0    defaults
wheel                     0.36.2             pyhd3eb1b0_0    defaults
whichcraft                0.6.1                    pypi_0    pypi
widgetsnbextension        3.5.1            py39h06a4308_0    defaults
wrapt                     1.12.1           py39he8ac12f_1    defaults
x264                      1!161.3030           h7f98852_1    conda-forge
xmltodict                 0.12.0                   pypi_0    pypi
xz                        5.2.5                h7b6447c_0    defaults
yaml                      0.2.5                h7b6447c_0    defaults
yarl                      1.6.3            py39h27cfd23_0    defaults
zeromq                    4.3.4                h2531618_0    defaults
zipp                      3.5.0              pyhd3eb1b0_0    defaults
zlib                      1.2.11               h7b6447c_3    defaults
zstd                      1.4.9                ha95c52a_0    conda-forge

[Help] How to attach a callback to a disconnect event?

How do I detect when a device is disconnected? The scrcpy program is able to tell when it gets disconnected and closes the stream with a log WARN: Device disconnected. But when I disconnect when using the python client, the frame feed just stops and there are no logs. I tried using adb.wait_for but it is a blocking function.

ENCODE

EI type 189 size 1776 truncated at 26
SEI type 0 size 144 truncated at 1
sps_id 32 out of range
sps_id 32 out of range
(repeated 12 more times)
sps_id 14 out of range
sps_id 32 out of range
sps_id 32 out of range
sps_id 14 out of range
sps_id 32 out of range
FMO
is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
FMO
is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
(repeated 6 more times)
no frame!
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
missing picture in access unit with size 11
Invalid NAL unit 0, skipping.
no frame!
missing picture in access unit with size 11
Invalid NAL unit 0, skipping.
no frame!
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
(repeated 9 more times)
no frame!
non-existing PPS 3 referenced
Invalid NAL unit 0, skipping.
no frame!
SEI type 8 size 88 truncated at 40
Invalid NAL unit 0, skipping.
SEI type 71 size 1256 truncated at 40
SEI type 134 size 1696 truncated at 40
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
SEI type 197 size 1208 truncated at 40
sps_id 32 out of range
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
sps_id 32 out of range
sps_id 32 out of range
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
sps_id 32 out of range
reference overflow (pps)
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
sps_id 1 out of range
sps_id 8 out of range
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
(repeated 97 more times)
illegal reordering_of_pic_nums_idc 32
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
(repeated 3 more times)
no frame!
missing picture in access unit with size 11
missing picture in access unit with size 11
(repeated 2 more times)
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
no frame!
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
(repeated 7 more times)
non-existing PPS 215 referenced
Invalid NAL unit 0, skipping.
no frame!
SEI type 3 size 1384 truncated at 40
SEI type 68 size 288 truncated at 40
Invalid NAL unit 0, skipping.
Invalid NAL unit 0, skipping.
SEI type 133 size 1696 truncated at 40
SEI type 197 size 1872 truncated at 40

demo演示程序中的client.start问题

hello 作者大大,看了代码之后有几个问题~,不知道是不是我没有看明白的原因
第一个问题是scrcpy_ui/main.py后面的这个while循环应该是没有进入
image

因为在def __stream_loop(self) -> None:里面存在while循环

第二个问题是 scrcpy/core.py 中的 start 方法,如果开启了新的线程来运行,我这里主程序会被卡住,也就是多线程这里其实是无效的
image
卡住如下
image

What is your exact test target

Gday,

I've found that this doesn't build nicely on osx. Rather than bother you to help fix it, what environment (with versions) are you running this on ? I will work to your environment.

Screen showing green artifact with log

hi,
i have problem when trying to run command py-scrcpy, and it shows only green image, but the control is functional.
this happen in network and usb connection

Phone Info (if needed): Samsung S20
here is the screenshot
image

Here is some of the log

negative number of zero coeffs at 0 0
error while decoding MB 0 0
mb_type 35 in P slice too large at 5 0
error while decoding MB 5 0
P sub_mb_type 5 out of range at 56 0
error while decoding MB 56 0
top block unavailable for requested intra mode
error while decoding MB 13 0
mb_type 46 in P slice too large at 4 0
error while decoding MB 4 0
P sub_mb_type 14 out of range at 34 0
error while decoding MB 34 0
cbp too large (102) at 2 0
error while decoding MB 2 0
cbp too large (120) at 2 0
error while decoding MB 2 0
out of range intra chroma pred mode

Full Log: mylog.log

thanks

收到的画面随机性错位

复现条件:pip下的最新版py-scrcpy,抓同一台电脑上跑着的夜神模拟器7.0.5.7里面最新版跑跑卡丁车游戏画面。
运行一段时间后,画面出现异常错位

1684507441140.mp4

Screen showing green artifact with log

first can work,a little while,It can be controlled but the picture turns green

DEVICE:MI8
(Thank you!I love this project😏😏😏)
LOG:
top block unavailable for requested intra mode -1
error while decoding MB 24 0, bytestream 18661
top block unavailable for requested intra mode -1
error while decoding MB 55 0, bytestream 11295
top block unavailable for requested intra mode -1
error while decoding MB 65 0, bytestream 17219
top block unavailable for requested intra mode
error while decoding MB 27 0, bytestream 11799
top block unavailable for requested intra mode
error while decoding MB 36 0, bytestream 18461
top block unavailable for requested intra mode -1
error while decoding MB 55 0, bytestream 11343
top block unavailable for requested intra mode -1
error while decoding MB 31 0, bytestream 18375
top block unavailable for requested intra mode -1
error while decoding MB 13 0, bytestream 12189
top block unavailable for requested intra mode -1
error while decoding MB 25 0, bytestream 18605
top block unavailable for requested intra mode
error while decoding MB 53 0, bytestream 11157
top block unavailable for requested intra mode
error while decoding MB 53 0, bytestream 11125
error while decoding MB 31 8, bytestream -19
top block unavailable for requested intra mode
error while decoding MB 53 0, bytestream 11157

support scrcpy 1.25

作者你好,这个版本在Android 13下 执行触摸指令时, MOVE 还有 UP命令似乎失效了,不知道是不是scrcpy1.20的问题,有计划升级到1.25吗

pyinstaller fatal error

Hello,
I am trying to create an exe with this project via pyinstaller, but I am getting an error:
-Traceback (most recent call last):
File "main.py", line 8, in
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "scrcpy_init_.py", line 6, in
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "scrcpy\core.py", line 12, in
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "av_init_.py", line 9, in
ImportError: DLL load failed while importing _core: The specified procedure could not be found.
[17436] Failed to execute script 'main' due to unhandled exception!

I have been working on it for a couple days now, I believe it is from the av import:
-from av.codec import CodecContext

Not sure what I am doing wrong, any help would be appreciated.
Thanks!

API documentation doesn't have examples

Please, just for respecting humanity, create a proper doc for your code
How in the mars can I find out that what is this int parameter in back_or_turn_screen_on function?
Screenshot_2022-04-29_01-22-58
And you didn't mention anywhere what is that ACTION_DOWN
And its just one function
Thanks very much

demo演示程序中的flip存在问题

运行最新版本的py-scrcpy-client,链接我的AOSP测试手机(Android 11),点击flip按钮的时候存在延迟刷新的效果,具体的效果为,点击了flip按钮后,界面有的时候会直接翻转,有的时候可能会过一两秒才反转;如果取消flip按钮,则不会自动退出翻转模式,需要点击一下界面才会翻转,需要在多界面多测试几次 才会出现该问题,如图所示

(此时按钮为非翻转状态,界面为翻转状态,到达这一步前的路径为:点击翻转 -> 取消翻转)可以看到界面并没有恢复
image

具体测试的过程中,感觉这是一个偶发性的问题,也有可能是界面失焦所导致的

无伤大雅~

Lag

I connected my phone and opened up scrcpy and an opencv window with the inputs form py-scrcpy-client.

When I had them side by side, I noticed that scrcpy was instant while py-scrcpy-client had a roughly 3 to 5 second lag. Why is this the case?

adb 错误

程序打包前正常,打包后提示 adb 错误 (找不到adb.exe,问题是adb.exe已加入PATH了)
[Errno subprocess] .\adb.EXE -s QECDU16E01001589 push C:\Users\ADMINI1\AppData\Local\Temp_MEI184962\scrcpy/scrcpy-server.jar /data/local/tmp/: "adb: error: cannot stat 'C:\Users\ADMINI1\AppData\Local\Temp\_MEI184962\scrcpy/scrcpy-server.jar': No such file or directory\r\n"

找到问题了,不是找不到adb.exe,是找不到scrcpy/scrcpy-server.jar,修改了下路径,搞定了!

scrcpy-client[ui] example resolution

First of all, thank you for your great python scrcpy client on github. I was new to python but not new to programming and so I went through and dissected your client[ui] to figure out the basics of getting your client to work. It's worked great so far, but I was wondering if there was a way to make the video quality better? I have tried changing the bitrate setting but it doesn't seem to change the quality. When I put the client[ui] side-by-side next to scrcpy's client, it's not as clear. Since it's being decoded from the Server, it should just be a matter of codec and bitrate right? What are your thoughts?

Thanks, any help would be appreciated.

Consistent CPU resource usage

Hello! I noticed your comment on the issue on scrcpy.
I work on guiscrcpy, which uses a python UI for scrcpy.

I wanted to integrate your project into mine, because yours is too cool! Thanks for this amazing UI.

One problem I noticed is that, your library uses a lot of cpu, compared to scrcpy. Scrcpy does use CPU only when the phone is not idle. But yours use CPU when the phone is idle too. Is there any optimization we can do?

image

if adb forward err, maybe stop is a good ideal

when adb forward err, did not see nothing... then block...

    for _ in range(self.connection_timeout // 100):
        try:
            self.__video_socket = self.device.create_connection(
                Network.LOCAL_ABSTRACT, "scrcpy"
            )
            break
        except AdbError:
            print('adb forward err.. ')
            sleep(0.1)
            pass

maybe need raise error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.