mpromonet / v4l2rtspserver

RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9
The Unlicense
1.85k stars 427 forks source link

RTSP stream slows down #127

Open ekavet opened 5 years ago

ekavet commented 5 years ago

Hello, at the moment I am using RPi 3 a+. When I start v4l2rtspserver to stream video to my dahua nvr, everything works fine for couple of hours. In the evening I left camera at work to stream video to nvr, when I came back in the morning stream was working but very slow like 1 frame every 2 min or so. I restarted RPi and everything came back to normal stream delay was close to none 1080p 30 frames.

I am using official V4L2 driver bcm2835-v4l2.

To start rtspserver: sudo v4l2rtspserver /dev/video0 -W 1920 -H 1080 -F 30 -U admin:pass &

mpromonet commented 5 years ago

Hi ekavet, Did you look to CPU, memory consumpsion ? Did you test to connect using another RTSP client, like VLC, ffplay or whatever. Best Regards, Michel.

ekavet commented 5 years ago

Will try to repeat everything. Now just added a bash script to reboot every 4h.

ekavet commented 5 years ago

I think it is not v4l2rtspserver problem. At night in office works fine when I turn lights on it freeze.

Stats when freeze:

%Cpu(s): 0,6 us, 0,4 sy, 0,0 ni, 99,0 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem : 247656 total, 37104 free, 101212 used, 109340 buff/cache KiB Swap: 102396 total, 96252 free, 6144 used. 89420 avail Mem

At the moment it is freeze, if I try to connect with VLC everything works fine. It takes time for NVR to get video back to normal.

nettings commented 4 years ago

Not directly related, but I'm seeing latency increase when using mpv --live . After leaving it running overnight, it can be tens of seconds late. mplayer -nocache is always running at minimal latency, even after many hours. But I guess @ekavet you actually saw the framerate drop, not the latency go up, right?