Yeah my NVR doesn’t do mjpeg. It only does h264 or h265. I guess Dahua removed that option on their newer NVRs.
I don’t mind higher CPU usage (right now my server isn’t breaking a sweat doing this) so I prefer having high quality/high FPS stream on all the time.
Speaking of Habpanel though. I am using the image widget for displaying the mjpegs (like I did before in OH2 with ffserver) and I am noticing that while using the binding some streams will just disappear after a few minutes (I get a blank background) or the whole habpanel will crash. Not sure if this is related to the binding or OH3. Just asking if you’ve noticed this before.
EDIT: Hmmm this is fun. This has somehow managed to crash my NVR. No RTSP streams were working and I couldn’t login into the web admin without rebooting the NVR.
EDIT2: I switched to the “generic RTSP” thing instead of using the Dahua specific thing and this seems to help in the stability of the NVR. It’s now running fine and the streams seem to be stable. However… habpanel is still crashing on two different android tablets every few hours. And it’s definitely connected to the mjpeg streams generated by this binding.
Fantastic! Thanks for the info. I installed the fixed version dated 2020-11-15 but initially I couldn’t get the rule that contained the call to getActions to work. Every time that line of code was executed I’d see this error in the log:
Rule 'Create front door camera GIF when front door motion detected': Instance is not a IpCamera class.
I searched the forum and found a few threads with similar issues (for other bindings) that suggested that the rule file containing the affected rule needed to be changed/touched to force it to be reloaded. That didn’t work for me but a restart of the openhab service resolved it.
How long should it take to generate a 6 second GIF on a Raspberry PI 4 with 4GB of RAM running OH 3.0.0? On mine it takes 30-60 seconds, but on my Windows box running 2.5M10 it takes about 10 seconds. I’m new to openHABian, but 60 seconds seems way too long to generate a 6 second GIF. Has anyone else noticed this? I can post the logs, but before I go there I want to make sure this isn’t normal behavior.
Hi,
I have an issue with Foscam FI9926P and PTZ functionalities.
I use OpenHab 3.0.0 with a docker image.
I try to configure it manually with the user interface and with the following config files, but without any success to PTZ:
The AutoLED and LED are functionnal, but the PTZ items are not. I tried everything without any success.
PTZ functionnalities are ok using the ONVIF device Manager (and using the same username and password).
What ONVIF modes did you try and confirm that work in ODM? continuous, relative and absolute as well as using presets, this adds up to 4 different ways and it is common for cameras to not support all 4 ways. I have posted screen shots on how to change between them on this forum if you do not know how.
In OH3 this widget is the easiest to get going IF you use the UI to auto find and add the thing as equipment.
Thanks for your reply. So I made some more tests with ONVIF Device Manager. In fact, only the Continous move mode seems to be supported on this camera (the others generate: nothing for absolute mode, and a SOAP Server error on the Relative mode). So the Continuous mode is OK for pan and tilt (still have some issue with zoom) and presets with ONVIF Device Manager.
So, with the OpenHab UI:
I added a new Thing for this Foscam camera, adding the right parameters (IP, ports, credentials, …)
I switched ON the “Use Continuous PTZ” property
I attached items for IR LEDs, pan, til,t and zoom.
The IR leds are OK (I can switch them on and off, so no credential issues), but I still have the same issue with the PTZ functionalities.
I also confirm that I have the lastest firmware (V-2.x.1.79_p1) for this camera.
Good, just check that in the UI it is showing as turned on it you are using textual to rule to typo/syntax issues.
Can you send me the TRACE level logs of when the camera is connecting? Just do a find and replace on your password first. I am after the ONVIF xml chatter that occurs when the camera first connects. If the handshake is working then I will move onto looking at wireshark logs of what is different when comparing what ODM sends vs the bindings messages.
And moreover, I tried the preset and when I try to at a channel (with link an Item), I’ve got the following error message in the openhab console:
11:07:44.562 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: FoscamCamerawithAPI_GoToPreset
11:07:55.344 [ERROR] [core.common.registry.AbstractRegistry] - Cannot inform the listener "org.openhab.core.thing.internal.ChannelLinkNotifier@6d512" about the "ADDED" event: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:559) ~[?:?]
at java.util.LinkedList.get(LinkedList.java:480) ~[?:?]
at org.openhab.binding.ipcamera.internal.onvif.OnvifConnection.getXml(OnvifConnection.java:288) ~[?:?]
at org.openhab.binding.ipcamera.internal.onvif.OnvifConnection.requestBuilder(OnvifConnection.java:366) ~[?:?]
at org.openhab.binding.ipcamera.internal.onvif.OnvifConnection.sendPTZRequest(OnvifConnection.java:809) ~[?:?]
at org.openhab.binding.ipcamera.internal.handler.IpCameraHandler.handleCommand(IpCameraHandler.java:1178) ~[?:?]
at org.openhab.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:177) ~[?:?]
at org.openhab.core.thing.internal.ChannelLinkNotifier.lambda$3(ChannelLinkNotifier.java:72) ~[?:?]
at org.openhab.core.thing.internal.ChannelLinkNotifier.call(ChannelLinkNotifier.java:96) ~[?:?]
at org.openhab.core.thing.internal.ChannelLinkNotifier.added(ChannelLinkNotifier.java:72) ~[?:?]
at org.openhab.core.thing.internal.ChannelLinkNotifier.added(ChannelLinkNotifier.java:1) ~[?:?]
...
Yes I know. I just captured all the traffic and save it into a wireshark log file.
As I can’t modify the log to remove some potential credential information, I would like to send this log to you directly (and not on this forum). Could you tell me how to proceed.
I’ll PM you my email if that is what you prefer.
Some other things are:
Change your password before taking the log and then change it back afterwards.
I only need the REQUEST and not the RESPONSE, with only half of the traffic the digest method can not be reversed from what I understand. I have seen some cameras do a really stupid things so it is best to do 1. if it concerns you.
Thanks, do I need to recreate the thing or something like that? Because removing the bundle and installing that addon plus restarting OH didn’t change the behavior.
Matt
I have fresh installed OH3, installed IP Camera Binding and tried to add ONVIF UDP camera.
When I play the stream:
rtsp://user:pass@192.168.1.16/onvif1
in VLC all works!
When I add ONVIF camera as a thing with parameters:
IP - 192.168.1.15
ONVIF PORT: 5000
PORT: 2015
MJPEG: rtsp://user:pass@192.168.1.16:554/onvif1
Options before -i: -rtsp_transport udp
OH Log Viewer gives error:
2021-01-12 15:40:12.204 [WARN ] [hab.binding.ipcamera.internal.Ffmpeg] - An error occured trying to process the messages from FFmpeg.
any thoughts?
UPDATE: I have managed kinda make it working, but that is DEAD slow!!! DEAD and unstable!!! and on fresh install did not work at all for some reason…And that is the same with TCP stream by the way - very slow (RPI3B+)
So does this mean you are supplying a H264 stream to the config that is meant for a mjpeg format stream? if so that would explain your issues. If your camera does not do mjpeg, then leave that feild blank. It would be more helpful if you posted the CODE that shows how the thing is configured. Also no need to do user:pass@ in the urls the binding will handle the password correctly for you.