assistd / scrcpy

Apache License 2.0
0 stars 1 forks source link

【IOS】scrcpy 客户端第一次运行失败 #1

Closed HEZI0427 closed 1 year ago

HEZI0427 commented 1 year ago

启动iOS scrcpy-runner后,首次启动scrcpy崩溃

$ ./x/app/scrcpy 
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
2022-10-08 20:42:05.435 scrcpy[51651:20686787] INFO: Renderer: metal
2022-10-08 20:42:05.438 scrcpy[51651:20686787] ERROR: Could not open image codec: /usr/local/share/icons/hicolor/256x256/apps/scrcpy.png
2022-10-08 20:42:05.438 scrcpy[51651:20686787] WARN: Could not load icon
2022-10-08 20:42:05.438 scrcpy[51651:20686787] INFO: Initial texture: 400x800
2022-10-08 20:42:05.443 scrcpy[51651:20686817] ERROR: Could not send video packet: bebbb1b7: Invalid data found when processing input
2022-10-08 20:42:05.443 scrcpy[51651:20686817] ERROR: Could not send config packet to sink 0
2022-10-08 20:42:05.443 scrcpy[51651:20686817] ERROR: Could not process packet
2022-10-08 20:42:05.455 scrcpy[51651:20686787] WARN: Device disconnected

再次执行运行成功。

如果此时,旋转手机画面(触发横竖屏),手机会再次崩溃。

prife commented 1 year ago

原因:首次启动时,videotoolbox生成了SEI帧,也就是下面日志中的" [unknown(6)]"`

time="2022-10-08T20:46:46.535922+08:00" level=info msg="frame: pts:0x8000000000000000, len:28"
time="2022-10-08T20:46:46.536732+08:00" level=info msg="  [SPS]"
time="2022-10-08T20:46:46.536747+08:00" level=info msg="  [PPS]"
time="2022-10-08T20:46:46.536763+08:00" level=info msg="frame: pts:0x40000183b7a23d0f, len:34"
time="2022-10-08T20:46:46.536799+08:00" level=info msg="  [unknown(6)]"
time="2022-10-08T20:46:46.537427+08:00" level=info msg="frame: pts:0x40000183b7a23d0f, len:76503"
time="2022-10-08T20:46:46.537765+08:00" level=info msg="  [IDR]"
time="2022-10-08T20:46:46.547602+08:00" level=info msg="frame: pts:0x00000183b7a23d2e, len:30022"
time="2022-10-08T20:46:46.547848+08:00" level=info msg="  [slice]"
time="2022-10-08T20:46:46.597305+08:00" level=info msg="frame: pts:0x00000183b7a23d57, len:10665"
time="2022-10-08T20:46:46.597529+08:00" level=info msg="  [slice]"
time="2022-10-08T20:46:46.634532+08:00" level=info msg="frame: pts:0x00000183b7a23d7d, len:6358"
time="2022-10-08T20:46:46.634672+08:00" level=info msg="  [slice]"

手机/平板,发生旋转时,也生成了SEI帧,导致了scrcpy client崩溃。

prife commented 1 year ago

修复:https://github.com/assistd/WebDriverAgent/commit/3a01276eaf6417bed4bacd272a140b7646d96865

prife commented 1 year ago

相关bug:https://github.com/assistd/assistd/issues/240