Stream component : unable to display rtsp stream

Hi all,

First, a very big up for your work !

I have been waiting a long time for rtsp support and you did it in 0.90 ! Thanks !

But I have tried to configure it with two different D-Link cameras : a DCS-825L and DCS-7410
They are not new but they both have rtsp support. I can display the stream in VLC without any problem.

I configured it like this

Blockquote

  - platform: generic
    name: cirilla_bedroom
    stream_source: rtsp://user:[email protected]:554/play1.sdp
    still_image_url: http://192.168.0.20/image/jpeg.cgi
    username: !secret username
    password: !secret password

I’ve tried without user and password in url, and with or without the “/play1.sdp” url part.

The error in my logs is

  ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream: 

Do you have an idea of what I could try ?

Thanks for your help !

I have been working the same problem today but with my Dahua nvr.

The video works with ffmpeg (but not streamable) and with VLC

  - platform: ffmpeg
    name: backyard_video
    input: rtsp://user:[email protected]:554/cam/realmonitor?channel=1&subtype=0

but this doesn’t work

  - platform: generic
    name: backyard_video
    still_image_url: http://192.168.2.38/cgi-bin/snapshot.cgi?channel=1  ##user and password at front of url also doesnt work
    stream_source: rtsp://192.168.2.38:554/cam/realmonitor?channel=2&subtype=0 . ##user and password at front of url also doesnt work
    authentication: digest  ##basic also doesnt work
    username: user
    password: password
2 Likes

Have you added stream: to your config yaml?

Not using this yet myself.

Yes, I have. At root level, that means at the same level of “homeassistant:”. Must it be here or under homeassistant: ?

Suspect on its own line. Same as homeassistant: etc.
Sorry fresh out of ideas.

Thanks ! Let us know if you can have one running

Are you seeing any errors per below.

Nope, I have have already check this point.

( I confirm that stream: must be at root level, just tested 2 minutes ago)

so in my testing not all of my cameras worked…my reolink RTSP links did not work while my amcrest ones did…i think each camera is gonna be different here

:frowning: This is what I was afraid of… No luck for me right now so…
Thanks for your feedback !

I get this error which I think means my camera won’t work yet. I think it logs in ok because I see the still image on the camera on the front end.

2019-03-20 17:06:28 ERROR (stream_worker) [libav.h264] error while decoding MB 113 22, bytestream -13
2019-03-20 17:06:29 ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream:

So username/password options only work for the still_image_url for now. Sorry for the confusion. Try putting the feed as rtsp://user:[email protected]:554/cam/realmonitor?channel=2&subtype=0 (same as your FFMPEG config).

I tried that, but it give me the blank media player when I double click the picture and these errors. I can say the picture on the generic camera is better than the video on the ffmpeg camera. Thanks

2019-03-20 17:06:28 ERROR (stream_worker) [libav.h264] error while decoding MB 113 22, bytestream -13
2019-03-20 17:06:29 ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream:

It got the video to work with generic camera but only if I removed stream:

The video plays when I double click but without the media player controls when stream component is not loaded.

Removing stream: causes the camera to fall back to the standard MJPEG feed. Which is fine. It’s possible your camera’s configuration doesn’t yet work. Perhaps we should create a new thread with confirmed working cameras and the URLs required.

2 Likes

Odd thing is I am having the same issue, but on only one of my Home Assistant sites.

Both are using Unifi Protect Cameras, Flex and G3. One site works one does not (same errors as above).

Both installs are similar except one is newer using the default_config: (which I tried removing with no luck) while the other is a much older, but up to date, config with many many more devices.

Both running in docker containers, same setup on both.

This makes me think it may not be camera hardware related as both are using the same Unifi software, same version, it two different locations. One works, one does not. If I got more time tonight to troubleshoot I will post some data.

Please do. Any additional info would be helpful. What is the network setup difference between the two? Is one using NVR and the other direct?

Unfortunately I only had access to my HikVision cameras when developing this component, and cursory access to Paulus’ G3 camera.

@hunterjm Thanks for this! I’ve been working on an upgraded Arlo component and the timing of this is great, you’ve saved me the work of figuring out HLS and streaming!

It looks like it’s working for me with a couple of conditions:

  • It has to be a virtualenv install, ffmpeg doesn’t support rtsps streams in the docker and hassio images.
  • I’ve only tried playing on various Chrome Cast devices.

One more thing. To install stream in virtualenv you need to have the ffmpeg dev libraries installed. Under Ubuntu:

sudo apt install libavformat-dev
sudo apt install libavdevice-dev
2 Likes

Basically identical setups as one another is the odd thing. Both running on the cloudkey gen2 plus (unifi protect) but setup as generic cameras polling the snapshot jpg and the system generated rtsp url, same model cameras. Even the network setups are essentially the same, all unifi just different subnets.

What about the hardware running Home Assistant? Same install method / similar hardware specs?