mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.64k stars 162 forks source link

Latency #516

Open bharatsingh430 opened 2 years ago

bharatsingh430 commented 2 years ago

I am seeing a latency of around 5 seconds when accessing the video stream but on the wyze app the latency is negligible (< 0.2 seconds). I am using the following config but changing the quality or the mode doesn't seem to cut the latency. I am looking to develop an application which can access the video stream in real time while running on the cloud, so the few seconds latency would be a problem if this is not due to a config issue (I hope its a config issue!).

Config is attached below and I am running this on Ubuntu 22.04

version: '2.4' services: wyze-bridge: container_name: wyze-bridge restart: unless-stopped image: mrlt8/wyze-bridge:latest ports:

mrlt8 commented 2 years ago

Is that with the HLS stream? RTSP would probably have the least latency. You may also need to check your media player settings as many will try to buffer the video for continuous playback.

bharatsingh430 commented 2 years ago

thanks, that cut the latency down from 5 seconds to around 1 second. Is there a way to bring it down to 0.2 seconds or something? I switched to streaming programmatically to get around media player issues.

import cv2 vcap = cv2.VideoCapture("rtsp://localhost:8554/baby-cam")

while(1): ret, frame = vcap.read() cv2.imshow('VIDEO', frame) cv2.waitKey(1)

mrlt8 commented 2 years ago

Wondering if bypassing rtsp-simple-server could save a little time. Maybe you could use a custom ffmpeg to pipe the video directly?