IpCamera binding - Breaking changes and new features in 3.2 Milestone 3 and newer

Try making sure your user / pass is correct and then restart the camera. Hik has a feature where it will lock you out if you get the password wrong 3 times and only restarting the camera will reset it. Hard to know if the 401 or the 503 is the reason.

Do you have digest or basic auth setup on the camera?

I rebooted the camera, but it didn’t change anything.
Both RTSP Authentication and WEB Authentication are set to digest.
I don’t have issues accessing the camera via the web interface.
Btw, I am using the binding shipped with the milestone, not your updated version.

EDIT: I reverted back to openhab 3.1 release and the old URL: http://192.168.178.20:50001/ipcamera.mjpeg is working again, but the errors in the log file are still there.

Digest has a 401 error every time, that is how it works so each request is made twice with the first one failing. So the 503 has stopped when you reverted? How often did you get the 503? I will need to have a in depth look as the reason is not obvious and your logs do not show the GET request is received so it may not even be from the point in time that the request was made.

The URL in the log is for the snapshot and not the stream.

Indeed, no 503 errors on the 3.1 version. On the M3 snapshot I see an 503 error about every 2 seconds.

I have the exact same issue, except that my openhab instance is served on standard Port 8080.

With log of ipcamera-binding set to “TRACE” i get following error after opening a sitemap with html-embedded .mjpeg stream (dahua cam):

[DEBUG] [amera.internal.servlet.CameraServlet] - Not the first stream requested. Stream from camera already open

Seems there is a multiple acces to the (…):8080/ipcamera/UID/ipcamera.mjpeg -stream

With the older Binding (M2) i had no problems directly accessing the MJPEG-Streams from my Dahua Cams.

best regards

I also encounter the following messages into the log:

[DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.mjpeg, received from 127.0.0.1
[DEBUG] [amera.internal.servlet.CameraServlet] - First stream requested, opening up stream from camera
[TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.120.52:80/ISAPI/Streaming/channels/102/httppreview
[WARN ] [era.internal.handler.IpCameraHandler] - !!!! Camera possibly closed the channel on the binding, cause reported is: Queue full
[WARN ] [era.internal.handler.IpCameraHandler] - !!!! Camera possibly closed the channel on the binding, cause reported is: Queue full

This is the cause of the problem with missing/freeze mjpeg stream mentioned into 11301. In case the stream starts, it works for few (maximum 5) seconds and then freeze.

I confirm that the code from this commit fixed the issue. Thank you, Matt!

No problem, I have created a PR and made a precompiled jar which can be found here:

[ipcamera] Improvements and fix 503 errors go to offline with Hik by Skinah · Pull Request #11419 · openhab/openhab-addons (github.com)

The 503 errors were only appearing on my Hikvision cameras and I was able to reproduce some issues here, they should be fixed in the changes in the PR linked above. If anyone can help test that would be great.

So I was not having any issues (reolink cameras), but wanted to report the new IP camera binding with breaking changes uses less CPU on my Rpi4. Here is a picture of before and after. A little hard to read, but the change is about the middle of the graph. The spikes are when video was triggered.

Thanks @matt1 for all your efforts. I think it is a very important OH binding.

Bob

Good to hear its working and always interesting to see graphs that show things have changed, either in the positive or negative direction. The newer changes not yet merged should further reduce system loads for cameras that use digest auths weather it is enough to be seen on graphs I don’t know. The other big change is that for people that leave streams open on tablets 24-7 the binding is getting some TLC to ensure the camera can go offline for unlimited time and it should still having a working picture on the tablet when the camera comes back online. A lot is changing in the binding at the moment so any help with testing and giving feedback is apricated.

I installed the updated binding, but noticed some strange things:
I can now see again the ipcamer.mjpeg stream in my sitemap view. The weird thing is that if I am not viewing the sitemap, either on my PC or my android app, then I can’t view the ipcamera.mjpeg stream in my browser by using a direct URL. If I open the app on my phone then I can see it in my browser. The snapshots.mjpeg is not affected by this.

What is the name of the zip file you downloaded or is it in milestone 3? I made some changes that may help in the downloadable jar found in first post.

I uninstalled the binding of M3 and downloaded the zip dated 2021-10-20.

Try downloading it again as I made some changes to ipcamera.mjpeg the last few days. The date is the 24th now and those changes got merged and will be in the next milestone so if there is an issue it would be great to know ahead of time so if you can test that would be great. Thanks.

I tried the new version, but no change. If I open the ipcamera.mjpeg stream in my browser I don’t see anything. If I open a new tab, I get the video on this tab. The other tab still doesn’t show the video.
If I refresh the first tab then it also shows the video. I tried it on both chrome and edge, the exact same behavior. For me this is not a real issue since the openhab interface shows it correctly, but it is very strange.

What does the log show in trace mode?

Hi Matt,

Please check the log below. First I opened one browser tab and somewhat later the second tab timestamp 08:19:35.769. Just to remind you, I am running openhab on Windows 10, I don’t know if it can have something to do with it.

2021-10-26 08:18:52.951 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:18:52+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:18:52+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:
2021-10-26 08:19:02.871 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:19:02+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:19:02+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:
2021-10-26 08:19:03.761 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.mjpeg, received from 192.168.178.69
2021-10-26 08:19:03.761 [DEBUG] [amera.internal.servlet.CameraServlet] - First stream requested, opening up stream from camera
2021-10-26 08:19:03.761 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.65:80/ISAPI/Streaming/channels/102/httppreview
2021-10-26 08:19:03.777 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.65:80/ISAPI/Streaming/channels/102/httppreview
2021-10-26 08:19:12.775 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:19:12+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:19:12+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:
2021-10-26 08:19:22.679 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:19:22+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:19:22+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:
2021-10-26 08:19:32.582 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:19:32+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:19:32+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:
2021-10-26 08:19:35.769 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.mjpeg, received from 192.168.178.69
2021-10-26 08:19:42.486 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 832

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.178.65</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:32:51:c8</macAddress>
<channelID>1</channelID>
<dateTime>2021-10-26T08:19:41+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T85FWD-I820180322AAWRC10030500,2021-10-26T08:19:41+01:00,0,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
:

I can reproduce this here and have a work around for you to try. Setup the camera to use ‘basic/digest’ instead of ‘digest’ only.

Three boxes need changing in two different areas…

NETWORK>ADVANCED SETTINGS>

and

SYSTEM>SECURITY>AUTHENTICATION>

When you change from digest to using basic auth you MUST pause and then unpause the camera/s to force a reconnect, it wont work till that is done.

I can not reproduce it on any other camera except Hikvision and only when digest is on.

I changed these settings for both web and rtsp. I can confirm that it is working now. I get a message about a possible security issue when changing to digest/basic, but I don’t think this is really an issue since the camera is not accessible from the outside.
Thanks for your support and time you spend on this binding (and the ESP Milight binding)

I just uploaded a newer jar with a fix in it so digest will work in the newer build. Digest is more secure if someone is on your local network, basic can be reversed in 1 second by an 8 year old kid. If you don’t believe someone can get into your network, what stops someone talking a wired external IP camera off your house and plugging their laptop into that cable that was connected to your camera.

Thanks for reporting the issue and testing it.

thanks, just tested it and it’s working perfectly!