IpCamera: New IP Camera Binding

@Daniel_Linder you do know there is a hack for Chinese Hikvision cameras to permanently change them to english? I have 4 and I now upgrade with English firmware. It involves changing some hex values. Have done upgrades over the last 6 years now without any issue

Thanks now itā€™s Up!

with this thing definition :slightly_smiling_face:

Thing ipcamera:ONVIF:003
[
    IPADDRESS="192.168.1.40",
    USERNAME="admin",
	PASSWORD="",
    ONVIF_PORT=8001,
    PORT=80,
	FFMPEG_OUTPUT="/etc/openhab2/html/cameras/cam1/",
	SNAPSHOT_URL_OVERRIDE="http://192.168.1.40/onvif/snapshot"
]

but i can see this error in the IP CAM binding log

2020-01-06 23:21:59.229 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:21:59.867 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel status is -1 for URL:/onvif/snapshot
2020-01-06 23:22:00.624 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - initialize() called.
2020-01-06 23:22:01.627 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.1.40:8001
2020-01-06 23:22:01.633 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:01.791 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.1.40 is now online.
2020-01-06 23:22:01.796 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - We got an ONVIF error404:Not Found
2020-01-06 23:22:08.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:10.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:12.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:14.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:16.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:18.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-06 23:22:20.787 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot

And some errors in the openhab.log

2020-01-06 22:52:21.299 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@113851c': String index out of range: 7

	at org.openhab.binding.ipcamera.internal.Ffmpeg.buildFfmpegCommand(Ffmpeg.java:86) ~[?:?]

	at org.openhab.binding.ipcamera.internal.Ffmpeg.<init>(Ffmpeg.java:74) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1076) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.handleCommand(IpCameraHandler.java:1205) ~[?:?]

2020-01-06 22:52:35.018 [vent.ChannelTriggeredEvent] - logreader:reader:openhablog:newErrorEvent triggered 2020-01-06 22:52:21.299 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@113851c': String index out of range: 7

2020-01-06 22:52:35.029 [vent.ItemStateChangedEvent] - openhablogreaderLastError changed from 2020-01-06 22:51:52.718 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'mqtt_sensor_door_LastUpdate': The name 'mqtt_sensor_door_LastUpdate' cannot be resolved to an item or type; line 134, column 2, length 27 to 2020-01-06 22:52:21.299 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@113851c': String index out of range: 7

2020-01-06 22:52:35.070 [vent.ItemStateChangedEvent] - openhablogreaderLastError changed from 2020-01-06 22:52:21.299 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@113851c': String index out of range: 7 to 2020-01-06 22:52:21.632 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'mqtt_sensor_motionf2 update': The name 'mqtt_sensor_motionf2_LastUpdate' cannot be resolved to an item or type; line 103, column 13, length 31

2020-01-06 23:15:51.862 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

	at org.openhab.binding.ipcamera.internal.Ffmpeg.buildFfmpegCommand(Ffmpeg.java:86) ~[?:?]

	at org.openhab.binding.ipcamera.internal.Ffmpeg.<init>(Ffmpeg.java:74) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1076) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.handleCommand(IpCameraHandler.java:1205) ~[?:?]

2020-01-06 23:15:56.938 [vent.ChannelTriggeredEvent] - logreader:reader:openhablog:newErrorEvent triggered 2020-01-06 23:15:51.862 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

2020-01-06 23:15:56.947 [vent.ItemStateChangedEvent] - openhablogreaderLastError changed from 2020-01-06 23:01:04.631 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=423, bundle=273/mvn:org.openhab.binding/org.openhab.binding.weather/1.14.0]: Updating property weather of configuration org.openhab.weather caused a problem: Unable to find any configuration settings for weather binding. Check openhab.cfg. to 2020-01-06 23:15:51.862 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

2020-01-06 23:16:16.337 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

	at org.openhab.binding.ipcamera.internal.Ffmpeg.buildFfmpegCommand(Ffmpeg.java:86) ~[?:?]

	at org.openhab.binding.ipcamera.internal.Ffmpeg.<init>(Ffmpeg.java:74) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1076) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.handleCommand(IpCameraHandler.java:1205) ~[?:?]

2020-01-06 23:16:16.943 [vent.ChannelTriggeredEvent] - logreader:reader:openhablog:newErrorEvent triggered 2020-01-06 23:16:16.337 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

2020-01-06 23:16:16.947 [vent.ItemStateChangedEvent] - openhablogreaderLastError changed from 2020-01-06 23:15:51.862 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7 to 2020-01-06 23:16:16.337 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7

2020-01-06 23:22:31.362 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@1e9d66': String index out of range: 7

	at org.openhab.binding.ipcamera.internal.Ffmpeg.buildFfmpegCommand(Ffmpeg.java:86) ~[?:?]

	at org.openhab.binding.ipcamera.internal.Ffmpeg.<init>(Ffmpeg.java:74) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1076) ~[?:?]

	at org.openhab.binding.ipcamera.handler.IpCameraHandler.handleCommand(IpCameraHandler.java:1205) ~[?:?]

2020-01-06 23:22:36.967 [vent.ChannelTriggeredEvent] - logreader:reader:openhablog:newErrorEvent triggered 2020-01-06 23:22:31.362 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@1e9d66': String index out of range: 7

2020-01-06 23:22:36.976 [vent.ItemStateChangedEvent] - openhablogreaderLastError changed from 2020-01-06 23:16:16.337 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@bb60ca': String index out of range: 7 to 2020-01-06 23:22:31.362 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@1e9d66': String index out of range: 7

Thatā€™s ones outside my knowledge Iā€™m afraid
@nakh_Home have you tried using the url override and setting it to the known working stream url?

Try this as it is your ONVIF_PORT is wrong hence why you got a 404 error right after the onvif was trying to connect. Onvif will give you the rtsp and snapshot urls if it connects and it needs that port to be right.

Thing ipcamera:ONVIF:003
[
    IPADDRESS="192.168.1.40",
    ONVIF_PORT=80,
    PORT=80,
    SERVER_PORT=54321
    FFMPEG_OUTPUT="/etc/openhab2/html/cameras/cam1/"
]

This shows that it is port 80 as the port is missing, hence it is 80.

The FFmpeg errors are probably because it has no RTSP url, the next build of the binding detects this already and puts up an error. This should not happen when onvif connects as it will find the snapshot and the rtsp url on its own.

Thanks for your answer

with the thing definition above. i am getting the errors in the IP binding log

2020-01-07 01:26:40.238 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 01:26:40.295 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to move with new PTZ now
2020-01-07 01:26:40.338 [DEBUG] [ab.binding.ipcamera.onvif.PTZRequest] - We got a ONVIF PTZ ERROR -1:unexpected end of stream on http://192.168.1.40/...
2020-01-07 01:26:40.890 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 01:26:42.238 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 01:26:42.299 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to move with new PTZ now
2020-01-07 01:26:42.321 [DEBUG] [ab.binding.ipcamera.onvif.PTZRequest] - We got a ONVIF PTZ ERROR -1:unexpected end of stream on http://192.168.1.40/...

Yes I have had someone that was having the issue report that it is now solved with the latest build.

Does it have onvif? Currently the only way for a camera to come online is to have a working snapshot or at least the camera needs to accept a http connection as the binding does not wait for the snapshot to actually get sent back. Currently there is no way unless you know of a snapshot url or the camera has ONVIF as snapshots are a requirement for onvif compatibility. It would be very easy to remove the need for a snapshot for cameras to come online and just make them always show as online. I believe I know an easy way to add this to the binding now I have had a change to think it over, I may look at it tonight if I get a chanceā€¦

Home Assistant does have the ability to use FFMPEG to generate a bad/basic motion alarm using ffmpeg to look for changes in the frames of the video stream from rtsp. Is that what u mean?

  1. It means your server will be streaming non stop from the camera chewing network bandwidth and CPU from your openhab server. EDIT: Reports are that it takes 20% of an i5 to process 1 camera. I tried it tonight and found it used 30% of a Pi4 cpu for a single 1080p camera stream and it would not work in realtime. By using a low res stream I could get realtime working and I found a far better method than what HA is using but it is just as CPU hungry. Most cheap cameras donā€™t have the ability to do multiple streams in different formats.

  2. The motion detection is very poor from feedback on their forum so I never looked at doing this. Now I have tried it, it does suck but I found a better method. If you run motion or any of the other camera software packages on a PI you then get far better motion detection with far less false positives and can remove the CPU and network load from Openhab.

  3. The other option is PIR sensors can be had for $40 and they are far better at not generating false alarms. Iā€™m guessing rain at night time would make the ffmpeg method useless where a PIR would still work perfectly.

  4. Cameras that have good motion alarms and an api only cost $30 more than the cameras that are not onvif and have far better picture quality and more features. It really annoys me when I see people recommending X cheap cameras to nnobs without a few warnings that they lack X and X feature and only an extra $30 gets you those features and better quality and ease of use etcā€¦

You can test the ffmpeg detection with this commandā€¦

ffmpeg -i YOUR_RTSP_INPUT -an -filter:v select='gt(scene\,0.03)' -f null -

If you wanted such a feature then by all means request it after running a test or two on your system with the above command, it is probably a 1-3 hour job to add it to the binding. Adjust the 0.03 value up and down to set how sensitive it is.

I have been dabbling on getting Onvif alarms/events working and it is 40% done but I hit a minor road block and all my cameras work so it has been shelved for now. I uploaded my work on it to GitHub if anyone wants to play.

Try using the new goto PRESET channel. Not all cameras support ABSOLUTE movements and if that is the first thing in your logs then the binding probably collected successfully a list of presets that it can move to.

Use Onvif device manager to setup the presets and test that they work first before trying in Openhab. ODM will also allow you to test the absolute move, but if it is missing any you only see RELATIVE and CONTINUOIS options for move then it shows the camera does not have it implemented.

I actually prefer using the presets now, they would be the way I would move my camera as they are simple to use and the need to move a camera remotely in real time is probably what most people wont want. The ability to jump to an exact location from a drop down list is IMHO a better easier way.

@delid4ve
I could be wrong but ezviz are rebranded hikvision and it may work in the binding if you setup the camera as a hikvision worth a try.

Thanks for your help

i have tried to set preset in ONVIF without success

getting an error when trying to save the preset

Continuous move

Absolute

Relative

To summarize:

in ONVIF i can only watch and also move the cam with the green arrows. maybe itā€™s a details but the up arrow moves the camera down and vice versa. the same for right and left arrow

Some additional ONVIF information that might help
image

@matt1 Is there anything I need to specify to select the correct adapter? It still on the wrong subnet: (should be 192.168.6.0/24)

Nope not that I can find and I canā€™t find a snapshot url yet, will get wire shark out when I get a bit of time to test.

I did try this but doesnā€™t accept anything on port 80. As with all these doorbells they want to force you into paying for the subscription, went with this model rather than the ring etc as at least I can record locally due to the rtsp stream being available

So for anyone that has the Hikvision CS-DB1 Doorbell you can hack it to provide onvif support and use within this binding:


and this tool:
https://us.hikvision.com/en/support-resources/downloads/tools

There are multiple brands of this doorbell but they are all hikvisions rebranded. Just make sure you read the post in full before upgrading.

I can confirm it now integrates.
Full model: CS-DB1-A0-1B3WPFR (flashed with LaViews firmware)
snapshot overrride: http://IPADDRESS/onvif/snapshot.jpg

1 Like

One time bumpā€¦

Any thought on this issue? I understand this is voluntary development and I do not want to take more of your time than necessary.

In case the system is not designed to handle 8 cams at a time using an openhabian installation, please let me know and I will remove it.

In case I can provide more information to help tracking what the problem is, please let me know too.

Thank you, Harald

In the latest build it already enters some debug lines like thisā€¦

Stream Server possible connections are:

Can you tell me if the correct IP is listed? Currently the new method is not used unless the old returned 0.0.0.0

I am making a new build tonight and I will log what the new one finds and default to using the newer method instead.

The log for the newer method will look like thisā€¦

Alt Ip finder gives

@nakh_Home
Looks like your camera does not support PRESETS. Try selecting the absolute, moving the sliders to any position and then pressing the move button. If that fails then the camera will only work with Continuous move if the arrows work.
I also noticed that the camera is reporting its pan and tilt MIN and MAX values are ā€œinfinityā€ which that will 100% break the onvif standard. Most cameras report -1 and +1 as values the camera can move between.
Perhaps look for a newer firmware for the camera.

@HarryS1
I already replied, see my reply here. If you follow my advice you can get 8 cameras working just not using the image channel as it floods the event bus. Use the ipcamera.jpg instead as per the readme. The latest versions of the binding now only update the image channel 10% of the time to hopefully make the default setting no longer create OOME.

New build 2020-01-07 has these changes:

  • Allows cameras with no snapshot ability to come online and use the rtsp stream for animated gif and casting to Chromecast. @gman you had a camera that may work now as a httponly device.
  • Change to IP detection and added logging to show what possible connects are in DEBUG logs.
  • More logs that tell you when you setup is wrong and what needs to change.
1 Like
2020-01-07 11:49:49.846 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:Nas/10.0.5.1
2020-01-07 11:49:49.847 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:Nas/10.0.5.1
2020-01-07 11:49:49.848 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:10.0.3.1
2020-01-07 11:49:49.848 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:10.0.3.1
2020-01-07 11:49:49.851 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:Nas/10.0.5.1
2020-01-07 11:49:49.852 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:10.0.3.1
2020-01-07 11:49:49.855 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:Nas/10.0.5.1
2020-01-07 11:49:49.856 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:10.0.3.1
2020-01-07 11:49:49.857 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:Nas/10.0.5.1
2020-01-07 11:49:49.858 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:10.0.3.1
2020-01-07 11:49:49.896 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.20.13 has started on port 50005
2020-01-07 11:49:49.897 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.20.13 is now online.
2020-01-07 11:49:49.900 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.4.4 has started on port 50003
2020-01-07 11:49:49.901 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.4.3 has started on port 50002
2020-01-07 11:49:49.901 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.4.2 has started on port 50001
2020-01-07 11:49:49.902 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.4.5 has started on port 50004
2020-01-07 11:49:49.902 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.4.4 is now online.
2020-01-07 11:49:49.903 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.4.3 is now online.
2020-01-07 11:49:49.904 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.4.2 is now online.
2020-01-07 11:49:49.904 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.4.5 is now online.

@matt1 Nope doesnā€™t even list my NAS IP that openhab is running on (192.168.6.4), its connected on 10.0.3.1 this time

Layout:

Thanks Matt !

i have installed this version.

The thing is online

the logs seem to be clean but i can not see anymore any images in paper UI or basic UI

2020-01-07 15:02:27.215 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.1.40:80
2020-01-07 15:02:27.218 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:02:27.473 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server possible connections are:lily/127.0.1.1
2020-01-07 15:02:27.477 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Alt Ip finder gives:192.168.1.150
2020-01-07 15:02:27.499 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.1.40 has started on port 54321
2020-01-07 15:02:27.517 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.1.40 is now online.
2020-01-07 15:02:27.533 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - We sucessfully connected to a ONVIF SERVICE:be.teletask.onvif.models.OnvifServices@220d59
2020-01-07 15:02:27.535 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profiles this camera supports.
2020-01-07 15:02:34.472 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:19.091 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:/usr/bin/ffmpeg -y -t 8 -rtsp_transport tcp -i rtsp://192.168.1.40:554 -filter_complex fps=4,scale=480:-2:flags=lanczos,setpts=0.25*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse /etc/openhab2/html/cameras/cam1/ipcamera.gif
2020-01-07 15:27:19.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:19.475 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
2020-01-07 15:27:19.477 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
2020-01-07 15:27:19.477 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
2020-01-07 15:27:19.479 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavutil      56. 22.100 / 56. 22.100
2020-01-07 15:27:19.479 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavcodec     58. 35.100 / 58. 35.100
2020-01-07 15:27:19.480 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavformat    58. 20.100 / 58. 20.100
2020-01-07 15:27:19.481 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavdevice    58.  5.100 / 58.  5.100
2020-01-07 15:27:19.482 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavfilter     7. 40.101 /  7. 40.101
2020-01-07 15:27:19.483 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavresample   4.  0.  0 /  4.  0.  0
2020-01-07 15:27:19.484 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libswscale      5.  3.100 /  5.  3.100
2020-01-07 15:27:19.484 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libswresample   3.  3.100 /  3.  3.100
2020-01-07 15:27:19.485 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libpostproc    55.  3.100 / 55.  3.100
2020-01-07 15:27:19.565 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [rtsp @ 0xd052e0] method DESCRIBE failed: 401 Unauthorized
2020-01-07 15:27:19.567 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - rtsp://192.168.1.40:554: Server returned 401 Unauthorized (authorization failed)
2020-01-07 15:27:19.577 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Animated GIF has been created and is ready for use.
2020-01-07 15:27:21.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:23.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:23.667 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:/usr/bin/ffmpeg -y -t 8 -rtsp_transport tcp -i rtsp://192.168.1.40:554 -filter_complex fps=4,scale=480:-2:flags=lanczos,setpts=0.25*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse /etc/openhab2/html/cameras/cam1/ipcamera.gif
2020-01-07 15:27:24.082 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
2020-01-07 15:27:24.084 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
2020-01-07 15:27:24.084 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
2020-01-07 15:27:24.086 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavutil      56. 22.100 / 56. 22.100
2020-01-07 15:27:24.088 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavcodec     58. 35.100 / 58. 35.100
2020-01-07 15:27:24.088 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavformat    58. 20.100 / 58. 20.100
2020-01-07 15:27:24.089 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavdevice    58.  5.100 / 58.  5.100
2020-01-07 15:27:24.090 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavfilter     7. 40.101 /  7. 40.101
2020-01-07 15:27:24.091 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libavresample   4.  0.  0 /  4.  0.  0
2020-01-07 15:27:24.092 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libswscale      5.  3.100 /  5.  3.100
2020-01-07 15:27:24.093 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libswresample   3.  3.100 /  3.  3.100
2020-01-07 15:27:24.094 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] -   libpostproc    55.  3.100 / 55.  3.100
2020-01-07 15:27:24.109 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [rtsp @ 0x103d2e0] method DESCRIBE failed: 401 Unauthorized
2020-01-07 15:27:24.110 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - rtsp://192.168.1.40:554: Server returned 401 Unauthorized (authorization failed)
2020-01-07 15:27:24.122 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Animated GIF has been created and is ready for use.
2020-01-07 15:27:25.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:27.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:29.344 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.40/onvif/snapshot
2020-01-07 15:27:29.417 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to move with new PTZ Absolute move.
2020-01-07 15:27:29.444 [DEBUG] [ab.binding.ipcamera.onvif.PTZRequest] - We got a ONVIF PTZ ERROR -1:unexpected end of stream on http://192.168.1.40/...

Is the update image switch on (check in paperui)

Update imagenow yes
Updategif no. And change to off automatically from basic ui

If you click the refresh button in paperui?
As in the image refresh button