Stream Component: Confirmed Cameras and Configurations

I just saw that error:

blob:https://something.domain.com/00c…:1:2380 Uncaught ReferenceError: s is not defined

Any thoughts on this ?

Unifi cam with Unifi NVR (pducharme/unifi-video-controller:3.10.1):

- platform: generic
  still_image_url: http://10.0.10.6:7080/api/2.0/snapshot/camera/5c35744ae4b00e065c24865d?force=true&apiKey=yourkeyhere
  stream_source: rtsp://10.0.10.6:7447/5c35744ae4b00e065c24865d_1

Instructions:

  • (If you haven’t already) Turn on RTSP by going to settings (gear icon at the bottom right) scrolling down to streaming ports, and turn on RTSP.
  • Go back to the cameras view, select a camera, and scroll down to “RTSP Service”. Click on it and copy the link for the quality feed you want. That link will be your stream_source
  • Create an API user (if you haven’t already), by going to the users tab in the right menu.
    • Click “Add user”, fill out all the info.
    • Create a new group giving it view video and recording permissions.
    • Select API Access and turn on “Allow API Usage”.
    • Select the user you just created, click on API Usage, and copy the API key

The still_image url will be constructed as follows:
http://<your nvr's IP>:7080/api/2.0/snapshot/camera/<the ID after the slash from the RTSP url, up to the _>?force=true&apiKey=<api key you just copied>

See the example at the top of this post for how it should look when you’re all done.

3 Likes

how did you install HA?

Thanks for all your work on this. My Dahua NVR has been setup like above and I get no errors. The picture is fine but the video stream is blank.

2019-03-21 10:22:42 INFO (MainThread) [homeassistant.components.stream] Started stream: rtsp://admin:[email protected]:554/cam/realmonitor?channel=2&subtype=00&authbasic={dfsdW4=:U2dsfdsh}

  • Version
    Record Channel:4
    Alarm In:4
    Alarm Out:3
    SN:AM003414051125
    System Version:3.200.0005.1.R, Build Date: 2014-04-27

@bmorgan are you just viewing it as a picture entity card in lovelace? If so the static image is used on the main view and updates every 10s. You will need to click on it to view the actual live stream. Make sure your card has the following in it for the click to work.

tap_action:
  action: more-info

Rob, looks like your authbasic isn’t configured correctly. Both values should be encoded together including the colon as the same string value.

1 Like

Yeah, that makes sense. It was so precise I soon figured it wasn’t a coincidence. Apparently even 8 stills per 10 seconds is too big a strain for one lovelace view as they frequently draw a blank. It was that way before, too.

Fixed it but still no video with picture. (I added user2 with password passwo for testing)

  - platform: generic
    name: backyard_video2
    still_image_url: "http://192.168.2.38/cgi-bin/snapshot.cgi?channel=2"
    stream_source: "rtsp://user2:[email protected]:554/cam/realmonitor?channel=2&subtype=00&authbasic={dXNlcjI6cGFzc3dv}"
    username: user2
    password: passwo

although I get error on the image, it appears fine and up to date on the front end.

2019-03-21 12:32:19 ERROR (MainThread) [homeassistant.components.camera.generic] Timeout getting image from: backyard_video2

2019-03-21 12:32:40 ERROR (MainThread) [homeassistant.components.camera.generic] Timeout getting image from: backyard_video2

2019-03-21 12:33:20 ERROR (MainThread) [homeassistant.components.camera.generic] Timeout getting image from: backyard_video2

2019-03-21 12:33:40 ERROR (MainThread) [homeassistant.components.camera.generic] Timeout getting image from: backyard_video2

2019-03-21 12:33:59 ERROR (MainThread) [homeassistant.components.camera.generic] Timeout getting image from: backyard_video2

2019-03-21 12:34:07 INFO (MainThread) [homeassistant.components.stream] Started stream: rtsp://user2:[email protected]:554/cam/realmonitor?channel=2&subtype=00&authbasic={dXNlcjI6cGFzc3dv}

Rob - if you are not getting the picture put this into a browser and see if you get the image.
Since you are using an NVR I’m not sure how many channels you have, but make sure you can get what you need in a browser first to confirm it is working.

Thanks. I don’t think the issue is with the setup or login because if I remove stream: . the camera works perfect, good image and 60 fps on the video. (not streamable and no media player) . I also use the same streaming url for ffmpeg and vlc which works.

  - platform: generic
    name: backyard_video2
    still_image_url: "http://192.168.2.38/cgi-bin/snapshot.cgi?channel=2"
    stream_source: "rtsp://user2:[email protected]:554/cam/realmonitor?channel=2&subtype=00&authbasic={dXNlcjI6cGFzc3dv}"
    username: user2
    password: passwo

Try removing the curly braces in stream_source. If still no luck, try again when 0.90.1 is released. There might be some more detailed logs at that point.

Ok, for Synology I can use the rtsp stream path, but what about the image url ?

You are correct. I removed the {} and I got more logs.

2019-03-21 15:21:09 INFO (MainThread) [homeassistant.components.stream] Started stream: rtsp://user2:[email protected]:554/cam/realmonitor?channel=2&subtype=00&authbasic=dXNlcjI6cGFzc3dv

2019-03-21 15:21:09 ERROR (stream_worker) [libav.h264] error while decoding MB 4 32, bytestream -19

2019-03-21 15:21:10 ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream:

I upgraded to 0.90.1 and I get a video now. Thanks

1 Like

dafang still_image works fine if you use the template from their github. I had to add the username, password, authentication type, and verify_ssl=false

  - platform: generic
    name: Camera
    still_image_url: https://192.168.x.y/cgi-bin/currentpic.cgi
    stream_source: rtsp://192.168.x.y:8554/unicast
    verify_ssl: false
    username: root
    password:  ********
    authentication: basic

Are wyze or blink cameras compatible with this?

1 Like

Want to know too

You may need to experiment with your cams, people may not have yours. If you find working config then post them here for others

1 Like

Would love to see a HomeKit integration… :eyes:

2 Likes

How can we use ffmpeg camera? E.g. for legacy cameras which don’t have HLS stream?