BreeeZe / rpos

Raspberry Pi Onvif Server
http://breeeze.github.io/rpos
MIT License
659 stars 147 forks source link

v4l2rtspserver - video stream hangs after 65 seconds #90

Open ginkage opened 4 years ago

ginkage commented 4 years ago

I was trying to use rpos as a webcam (you can do that with Windows 2020 May), and after some testing decided to use v4l2rtspserver, since it provided better controls over stream parameters, but ran into an issue that any stream would just hang after exactly 65 seconds. Simply disabling and enabling camera always worked to bring the picture back (without restarting the rpos server). After some debugging I've realized that the stream was ending as a result of Live555's "liveness timeout", which may be set as v4l2rtspserver's command line parameter (-t) and equals 65 by default. Now, the proper solution would be to somehow trigger Live555's noteLiveness() every now and then (via RRP report or something) while the stream is connected, but I don't know how to do that... So, for now I've set the timeout to 7200 (two hours, yes) in lib/camera.ts, but that's a kind of ugly workaround. There must be a better way. Edit: Actually, setting a timeout of zero works just as well, it simply disables all reclamation in Live555.