I’ve recently jumped into home assistant and I’m really loving it. My next project is to integrate a few live camera feeds, suitable for a baby monitor / kid in the basement camera. i.e. reliable, good frame rate & night vision
I’d prefer to use a non-cloud based camera solution, since it footage of my kids. I recently picked up a D-Link DCS-2530L and managed to get it running, but am a little disappointed with the result.
First I tried a generic MJPEG camera. It was very stable, but the frame rate was only 1 fps. I’m assuming this is a limitation of the camera / format?
Next I tried FFmpeg camera and fed it the RTSP stream. This improved the frame rate, but reliability became an issue. Frame rate drops, feed cutting out and problems connecting all together. I’m running everything a few year old mac mini, so I’m wondering if it’s having trouble keeping up with the stream transcode possibly? I tired lowering feed resolution and fiddling with FFmepg settings, without much improvement.
The camera appears to support multicasting, which my knowledge is thin on and I’m unsure how to integrate.
I also have a nest camera (which I’m trying to ditch since it’s cloud-based), which is very stable, but the frame rate it terrible. I understand this is a limitation of the nest API.
Anyone have any thoughts on how to move forward?
Tips on optimizing the MJPEG / FFmepg camera?
Could I offload the transcoding to an NVR?
Could multicasting help me out?
Am I wrong about the Nest API?
Is there another camera brand that would be a better fit?
I had a lot of problems getting mjpeg streams working reliably with rtsp. I’d get one frame and that was it. ffmpeg cpu usage would then spike to 60+%. Every once in a while, I’d actually get streaming video if I refreshed. I tried everything I could think of including using ffmpeg and ffserver to transcode from rtsp to mjpeg then accessing the ffmpeg feed directly. Same problem, one still frame only. My streams are h.264 at 30 fps.
The same issue happened on both Linux and Windows. On windows, I can’t even use the latest version of ffmpeg. It looks like it’s working but I get a blank screen with no video in the states view. However, I do get the still on the home assistant overview screen. Through hadashboard, I get a blank box with no video or still. When I switch to an older version of ffmpeg from 2012, I get the still but no video.
I finally came across a post about a vlc issue with mjpeg and there was mention of adjusting output fps to resolve the problem so I gave it a try.
In Linux, with the latest ffmpeg version, I added extra_arguments: -vf fps=15 to each ffmpeg camera definition and they now stream video every time.
In windows, with the older ffmpeg version, -vf fps=15 isn’t available so I ended up adding extra_arguments: -r 15 to each of my ffmpeg delivered cameras. I tried -r 15 with the latest version of ffmpeg on Linux and it worked that same there as -vf fps=15.
Everything has worked perfectly since.
I may play around with transcoding the streams using ffmpeg and ffserver again with the -r 15 option to see if it’ll then work in Home Assistant.