AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
7.06k stars 505 forks source link

How can i add a 1 second delay/buffer to my rtsp stream? #1441

Closed sphen13 closed 2 weeks ago

sphen13 commented 2 weeks ago

this add-on is fantastic. it works very well for my cameras and home assistant but i have one thing i am curious about which is probably the opposite ask of most people. is there a way in the go2rtc config to add a 1 second delay to the stream? i am just using a simple rtsp stream in the config right now but cant seem to figure out via the docs if this is possible.

the reason i want this is that i have automations that use teh stream and take a snapshot on motion. issue is my motion detection on a camera is a bit delayed so by the time i get a snapshot, nothing is in there. so i figure if i build in a delay in teh video stream itself this will solve the problem.

my sample config right now:

streams:
  charlies_camera: rtsp://192.168.246.1:7447/XhZAVeZzw98s7R68
  wesleys_camera: rtsp://192.168.246.1:7447/W4DKUu417nJtJYr5
  front_door: rtsp://192.168.246.1:7447/hp546ABbWpzBesrc

thank you!

AlexxIT commented 2 weeks ago

Delay or buffer won't helps you. The function of getting a snapshot from the past has been linked to holding an open stream all day long. Beyond that it really needs to keep past frames in some kind of memory buffer. Neither of which go2rtc supports yet. But it's in the plans. Medium/low priority.

sphen13 commented 2 weeks ago

thanks for responding and letting me know :)