Camera widget throwing in Image format Error

Sorry, I cannot add any reply to the other thread, as a new user, hence starting this new and also it’s on different topic.

The only issue I have atm is with camera feed - throwing in Image format Error. It’s HikVision IP cams and working okay on Home Assistant but not here. This is my camera config:

  - platform: generic
    name: "Front Door"
    username: admin
    password: xxxxxx
    still_image_url: "http://admin:xxxxxx@10.1.xx.xx:8081/ISAPI/Streaming/channels/2/picture"
    stream_source: "rtsp://admin:xxxxxx@10.1.xx.xx:554/Streaming/Channels/101"

Any idea what’s the issue?

Just answering to my question (in case some one finds its useful): I found that the best way to get the RTSP stream to use ffmpeg platform. The moment I change the HA config with this:

  - platform: ffmpeg
    name: "Front Door"
    input: "rtsp://<user>:<pass>@<camerra_ip>:554/Streaming/Channels/101"

camera stream appeared on HH straight away ^^^

@Santanu_Das you might also try putting rtsp URL in camera widget config as video-uri using Remote Config editor. However, some users had issues with some RTSP streams on some Android devices, so it might not work as is.

I see a different issue now. With direct RTSP endpoint as the video-uri, the streaming gets a lot better for me but it takes over 10 Sec. to get the feed from tapping on the icon to the full-screen. First two times I thought it’s not actually working.

With binding configuration, it goes into full-screen mode within 3 sec. but the actual feed is about 10sec. delayed.

@Santanu_Das that’s the buffering for the stream, the timing will depend on the stream size and speed of processing. This is the default Android behavior, and cannot be configured as far as I know. It most likely also slower than it would be on more powerful tablet. So yes, with that delay, it might not be ideal for quick camera live view.

I have tried adding a camera feed from Blue iris using remote config editor. The image displays fin and refreshes every few seconds. However when I click on the image it opens a blank window and displays connecting. The URL used works fine in a web browser but not in HH unfortunately.

@Col8 what is the video stream format/codec?

Here’s a screen shop from the remote editor

Sorry it’s a screenshot but my browser wouldn’t let me grab the text

@Col8 can you try opening live camera view again and then upload debug logs right after (from the Support screen)?

Uploaded. Many thanks.

my MJPEG stream works just fine on the browser but on HH, it gives me image format error. My config is very much the same as @Col8, except for the video-uri, which has user/pass in it.

My cam doesn’t require a user / pass so I don’t think that’s what is causing my problem.

It’s very strange for me now - on the widget screen, it always: image format error but if I tap on the camera, the full-screen window comes up, showing it’s LIVE and displays the stream correctly. Response is also near real-time but nothing on the format error on the first screen.

Hi Igor - Did you manage to find anything that might help?

It looks similar to several other user logs, where there are no errors, but no video data coming in either. A lot of smart home cameras don’t follow MJPEG protocol correctly, so this might be one of those cases. This is not something that could be reproduce in testing so far, so there is no solution.
Update for camera stream processing might resolve this, so I would suggest waiting for that.
I will post updates here when it is available.

@igor, my camera (HikVision) doesn’t allow un-authenticated MJPEG stream, so I need to pass that info in the form of http://user:pass@IP/..... as the stream URL - that doesn’t seem to work with HH? I can get the stream on the browser but on HH it’s always Image format error - any idea why?

@Santanu_Das auth in URL is supported, so most likely that’s not the issue. Is this the camera you uploaded the logs for previously in another thread?

I have about 5 of 'em, so probably yes. Two of 'em atm I’m trying out with HH using MJPEG stream. I can upload the log again, if that helps.

Yes, just to make sure it is not a different problem.

@igor, Does the logging send the username and Password or reduct those info before sending?