Skip to content

画面延迟过高 #94

@XcantloadX

Description

@XcantloadX

我用手机有线连接电脑,分别用这个库和 scrcpy 官方的 client 测试画面延迟,结果是

  • py-scrcpy-client:0.1~0.2s
  • scrcpy 官方 client:0.02~0.06s

测试代码:

MBPS = 1000 * 1000
client = Client(
    device=device,
    max_fps=30,
    bitrate=int(1 * MBPS),
    block_frame=False,
)
client.start(threaded=True, daemon_threaded=True)
while True:
    img = client.last_frame
    if img is None:
        time.sleep(0.01)
        continue
    img = np.asarray(img)
    cv2.imshow("img", cv2.resize(img, (0, 0), fx=0.5, fy=0.5))
    cv2.waitKey(1)

另外用 demo ui 结果也差不多。

PyAV 似乎是 CPU 软解,scrcpy client 是硬解,不知道和这个有没有关系。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions