From ca14764e171e76b20daa81ee65c679a3c64ce246 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 22 Dec 2023 09:13:32 -0800 Subject: [PATCH] wyze: suppress ffmpeg --- plugins/wyze/package-lock.json | 4 ++-- plugins/wyze/package.json | 2 +- plugins/wyze/src/main.py | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/wyze/package-lock.json b/plugins/wyze/package-lock.json index d4e4614f8..6d7d775a5 100644 --- a/plugins/wyze/package-lock.json +++ b/plugins/wyze/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/wyze", - "version": "0.0.34", + "version": "0.0.35", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/wyze", - "version": "0.0.34", + "version": "0.0.35", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/wyze/package.json b/plugins/wyze/package.json index 1e1713b2b..3d2f81895 100644 --- a/plugins/wyze/package.json +++ b/plugins/wyze/package.json @@ -33,5 +33,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.0.34" + "version": "0.0.35" } diff --git a/plugins/wyze/src/main.py b/plugins/wyze/src/main.py index 71b9b98e6..f47802cc1 100644 --- a/plugins/wyze/src/main.py +++ b/plugins/wyze/src/main.py @@ -189,12 +189,9 @@ class WyzeCamera(scrypted_sdk.ScryptedDeviceBase, VideoCamera, Settings, PanTilt ffmpeg = await scrypted_sdk.mediaManager.getFFmpegPath() loop = asyncio.get_event_loop() - class Protocol: - def __init__(self, pt: int) -> None: - self.pt = pt - + class RFC4571Writer: def connection_made(self, transport): - self.transport = transport + pass def datagram_received(self, data, addr): l = len(data) @@ -203,7 +200,7 @@ class WyzeCamera(scrypted_sdk.ScryptedDeviceBase, VideoCamera, Settings, PanTilt writer.write(data) vt, vp = await loop.create_datagram_endpoint( - lambda: Protocol(96), local_addr=("127.0.0.1", 0) + lambda: RFC4571Writer(), local_addr=("127.0.0.1", 0) ) vhost, vport = vt._sock.getsockname() @@ -226,6 +223,8 @@ class WyzeCamera(scrypted_sdk.ScryptedDeviceBase, VideoCamera, Settings, PanTilt "96", f"rtp://127.0.0.1:{vport}?pkt_size=1300", stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.DEVNULL, + stderr=asyncio.subprocess.DEVNULL, ) vprocess.stdin.write(b"\x00\x00\x00\x01") vprocess.stdin.write(info.videoCodecInfo[0]) @@ -235,7 +234,7 @@ class WyzeCamera(scrypted_sdk.ScryptedDeviceBase, VideoCamera, Settings, PanTilt aprocess: asyncio.subprocess.Process = None if not self.getMuted(): at, ap = await loop.create_datagram_endpoint( - lambda: Protocol(97), local_addr=("127.0.0.1", 0) + lambda: RFC4571Writer(), local_addr=("127.0.0.1", 0) ) ahost, aport = at._sock.getsockname() @@ -261,6 +260,8 @@ class WyzeCamera(scrypted_sdk.ScryptedDeviceBase, VideoCamera, Settings, PanTilt "97", f"rtp://127.0.0.1:{aport}?pkt_size=1300", stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.DEVNULL, + stderr=asyncio.subprocess.DEVNULL, ) try: