Reolink Camera Configuration W/ FFMPEG or Generic IP Camera

Hey guys, I spent the better part of this morning attempting to move 4 reolink cameras from ZoneMinder to Home Assistant. I wanted to remove ZoneMinder from my device because it can be a resource hog and I wasn’t capturing video with it. When attempting to move these cameras to HA, I ran into problems.

  1. I found that the generic ip camera never worked for me with reolink and RTSP or RTMP feeds. The funny part of this is that the configuration that works on the forums originated from me back when I first implemented the cameras in ZoneMinder. I made a casual mention to @hunterjm that the rstp feed had a specific url found in this post. Turns out, that doesn’t work for me inside Home Assistant. But it does work for some.
  2. I found that RTSP feeds tend to smear. This does not sit well with me. I’m not sure what is causing this but it makes watching the feeds unbearable.

This ultimately made me settle on the FFMPEG integration using an RTMP feed. As I was setting this up, I ran into another odd problem that took quite a bit to figure out. This issue is ultimately what is leading me to make this post. I’m not sure if it affects other camera brands. The 2 cameras that were not working kept hitting the FFMPEG integration timeout. Meaning, the integration wasn’t getting a full response from the camera within the timeout period. So before even setting up FFMPEG, inside reolink a user must set the bitrate on the camera to a high enough amount. From what I can tell, the iOS app no longer has this configuration option. In order to do this, you must log into the camera through a browser on a PC. Expand Basic Settings and the Encode tab, set the Maximum Bitrate(kbps) as high as you can go. 1024 was not high enough and this was ultimately my problem. I’ve noticed that wifi connected cameras have a max rate of 4096 and wired is 6144 to 8192 depending on the camera.

image

Next, these are the URLs for the feeds. These should work for Generic IP Camera Integration or FFMPEG. (I found working results with FFMPEG).


Type Quality url
still image NA http://192.168.x.x/cgi-bin/api.cgi?cmd=Snap&;channel=0&;rs=wuuPhkmUCeI9WG7C&;user=user&;password=password
rtsp clear (high) rtsp://user:[email protected]:554/h264Preview_01_main
rtsp fluent (low) rtsp://user:[email protected]:554/h264Preview_01_sub
rtsp blend (mix) rtsp://user:[email protected]:554/h264Preview_01_ext
rtmp clear (high) rtmp://192.168.x.x/bcs/channel0_main.bcs?channel=0&stream=0&user=user&password=password
rtmp fluent (low) rtmp://192.168.x.x/bcs/channel0_sub.bcs?channel=0&stream=0&user=user&password=password
rtmp blend (mix) rtmp://192.168.x.x/bcs/channel0_ext.bcs?channel=0&stream=0&user=user&password=password

You’d have to change the IP, user, and password in whatever url you are using. For RTMP, change the user and password after the equal sign. Ex: rtmp://192.168.x.x/bcs/channel0_ext.bcs?channel=0&stream=0&user=foo&password=bar

Generic IP Camera Integration

- platform: generic
  name: My Camera
  still_image_url: 'http://192.168.x.x/cgi-bin/api.cgi?cmd=Snap&;channel=0&;rs=wuuPhkmUCeI9WG7C&;user=user&;password=password'
  stream_source: 'rtsp://user:[email protected]:554/h264Preview_01_main'

You can swap stream_source for the RTMP version if you like.

FFMPEG Integration (Best Quality in my opinion)

  - platform: ffmpeg
    name: My Camera
    input: 'rtmp://192.168.x.x/bcs/channel0_main.bcs?channel=0&stream=0&user=user&password=password'

You can swap stream_source for the RTSP version if you like.

3 Likes

Ill check it when I could

I just setup a reolink 410 and just used the onvif component - which seems to be working. Have you tried that?

I did not. Was there smearing? What’s the delay on the camera feed when you open it up to view it live?

Not exactly sure what you mean by smearing so can’t answer that. Delay is 3-5 seconds which is same I get with viewing stream in VLC and in MotionEye.

Have you look at this

1 Like

hi @petro just wondering if you setup your camera to work with homekit? because so far that is the hardest part to have it work. Maybe you can share how you do it? thanks

Sorry, I do not use Homekit.

Alright… btw your RTMP recipe work like a charms, thank you so much. So now all my camera which is Yi and Sonoff work with RTSPtoWebRTC and this single Reolink run on RTMP and work perfectly. Thanks for the setup sharing. :+1:

1 Like