RTSP generic stream issue from DVR and surveillance camera

Hi,
I have a Kenik KG-5214UVR CCTV DVR recorder and I want to add RTSP stream to my HA.
In configuration of my DVR I found a RTSP setting as:

rtsp://[IP]:[PORT]/mode=real&idc=[]&ids=[]

where idc is a channel and ids is a set of primary or secondary stream

I can successfully connect to this stream via VLC using this adress:

rtsp://ha:[email protected]:554/mode=real&idc=1&ids=1

Configuration of HA is:

camera:

  - platform: generic

    stream_source: "rtsp://ha:[email protected]:554/mode=real&idc=1&ids=1"

    name: "My Camera"

Error figured in HA log:

Logger: homeassistant.components.stream.stream.camera.my_camera


Source: components/stream/__init__.py:340
Integration: Stream ([documentation](https://www.home-assistant.io/integrations/stream), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+stream%22))
First occurred: 22:38:02 (3 occurrences)
Last logged: 22:38:33

Error from stream worker: Error opening stream (HTTP_BAD_REQUEST, Server returned 400 Bad Request) rtsp://****:****@192.168.0.223:554/mode=real&idc=1&ids=1

What I’m doing wrong?

Have you tried setting the generic camera’s authentication to digest? The default is basic. I had a similar problem, it worked in VLC but not HA, and configuring Digest auth was the solution. Apparently my cameras only support that.

Hi, still got 400 Bad Request when config is:

camera:

  - platform: generic

    authentication: digest

    stream_source: "rtsp://ha:[email protected]:554/mode=real&idc=1&ids=1"

    name: "My Camera"

:confused: