IpCamera: New IP Camera Binding

The binding fetches a jpg to see if the camera is online hence the first two images are not evenly spaced, that is normal and not worth coding.

As for other reported issue, what is your thing file so I can use the same settings? I would recommend updateimageevents is set to 1 and update image is false. If you have set updateimage events to 0 that could explain why updates are not regular as it stops the snapshot getting fetched at a regular time at the poll rate.

I don’t test it that way and that may be the reason why @sihui has issues, will try testing this way to see the results when I have time.

1 Like

Thing:

I have now changed ‘image update events’ to 1

Thing ipcamera:HTTPONLY:001 "Garage camera" @ "Cams"
[
    IPADDRESS="192.168.x.x",
    USERNAME="xxxx",
    PASSWORD="xxxxx",
    SNAPSHOT_URL_OVERRIDE="http://192.168.x.x/live/0/jpeg.jpg", 
    POLL_CAMERA_MS=10000,
    IMAGE_UPDATE_EVENTS=0,
    UPDATE_IMAGE=false,
    PORT=xxxx,
    SERVER_PORT=xxxxxx
]

On saving the thing with the new image update events I saw this error again:

2020-01-26 10:27:25.866 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Exception occured when starting the streaming server:{}

java.net.BindException: Address already in use

	at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_222]

	at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_222]

	at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_222]

	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_222]

	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:132) ~[?:?]

	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:551) ~[?:?]

	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1346) ~[?:?]

	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:503) ~[?:?]

	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:488) ~[?:?]

With

     //POLL_CAMERA_MS=20000,
    IMAGE_UPDATE_EVENTS=1,
    UPDATE_IMAGE=false,
    PORT=80,
    SERVER_PORT=30001

sitemap

Image url="http://192.168.x.x:x/ipcamera.jpg" refresh=10000

I get performance issues (Raspberry Pi 4 )with refresh less than 15secs. Only every other image is shown. I don’t see any warnings in the logs

Anyhow, I can live with a refresh max of 15secs for the garage camera. The others I set to refresh 30secs. And you will be pleased to know I no longer use rules and image update :slight_smile: At least for now.

M

@matt1 ,

In the examples for the static image methods you have

Image url="http://192.168.0.999:54321/ipcamera.jpg" refresh=900 //Every 15 minutes

but the time is in millisecs and so its 0.9sec not 15mins. That caused me some issues until I tested it.

M

Hi,
Installed the updated version Yesterday.
I must say that the HLS running non stop is excellent. When asking google to stream from a camera, it only takes a few seconds to get the stream presented. Now, with this functionality - using any camera is a viable alternative to the Google Nest Doorbell.
Do you think that sending I-frames more frequently (from the camera) wound be beneficial?

Many many thanks for your efforts.

Glad you like it. You can also use the control to stop HLS if it has auto started and you don’t wish to wait for it to timeout.

That depends on your goal, if it is for lower HLS startup delay and less lag behind realtime then yes. 1 second segments require 1 second iframes and then you can lower the number of segments as well. But it increases the amount of data.

Don’t forget you can always cast a snapshot or gif if you need an instant picture when a doorbell is pressed.

@m4rk
Soz for the mistake my bad. If it is in the readme or somewhere I need to edit please let me know…

You do have each camera with its own SERVER_PORT and nothing else on those ports? try other ports or a reboot, that is not normal and is going to be an issue.

As for the image not always updating correctly, try the poll time slightly lower to give the binding more time to place the jpg into ram before the refresh line requests it. 9500ms for example.

The incorrect time was here >>>

Server ports are all different. I changed them anyway.

Hi Matt,

I went back to my old method. The ipcamera.jpg method is proving to be too unstable. The refresh doesn’t always retrun with an image and now I get this everytime I view the sitemap…
Tried reboot, clear cache but didn’t help.

2020-01-26 16:46:22.183 [WARN ] [pcamera.internal.StreamServerHandler] - Exception caught from stream server:{}

java.lang.NullPointerException: null

	at io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:360) ~[bundleFile:4.1.42.Final]

	at org.openhab.binding.ipcamera.internal.StreamServerHandler.sendSnapshotImage(StreamServerHandler.java:201) ~[?:?]

	at org.openhab.binding.ipcamera.internal.StreamServerHandler.channelRead(StreamServerHandler.java:116) ~[?:?]

New build 2020-01-27 has these changes:

  • Change to HLS feature. HLS streams smoother on some browsers now.
  • Fixed every second ipcamera.jpg request in some browsers was failing.
  • Polling can now go past 1 per minute and is not limited now.

@m4rk
In addition to the above fixes, I tested using the image channel through an item and it worked great when the poll time matched the refresh. I then decided to try this line with the camera still updating more often. I believe this may be a bug in Openhab, as it refreshes way more than every 2 minutes and is very erratic. The refresh is handled by the Openhab core and if it occurs more often than it should, this is something that should be reported at Openhabs GitHub issue tracker. I made a change in the binding to allow for higher poll times, so 15 minutes between poll times should be possible in next build unless it is a foscam as they need the poll time lower for the alarm checking.

Image item=BabyCamImage refresh=120000

Hi, i have a small problem: my image.mjpeg stream stops working after some time. When i make a browser refresh, the stream is running again…

I can see some abnormal messages in the trace-log after the time the stream stops… Hope it is helpful:

2020-01-27 12:37:19.796 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:--myboundary
Content-Type: text/plain
Content-Length:37
Code=AudioAnomaly;action=Stop;index=0

:
2020-01-27 12:37:20.809 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:--myboundary
Content-Type: text/plain
Content-Length:41
Code=VideoMotionInfo;action=State;index=0

:

This lines with :–myboundary only are visible when the stream has stopped. When the stream is running, there are other messages visible, but not like the two above.

I don’t believe they are connected as they look like the results from the alarm stream for Dahua cameras. Maybe they are connected and it is a bug in the camera sending the alarm data out the wrong stream, in which case upgrade your cameras firmware and contact their support. It is possible that some cameras will shutdown the stream if left running for X amount of time. This could be handle in one of two ways…

  1. Use the refresh option added to your video element, from memory I tried this and it worked, but you get a interruption in the picture each time it refreshes.
  2. The binding could be made to auto detect and restart the stream without any interruptions other than the picture appears to freeze whilst the stream is re-opened. Unless your watching the time tick over or there is motion you probably would not notice a 1 second or less freeze occur.

Thanks, would be grade if this could be included in the binding.

I have a cheap dahua china cam, i can´t upgrade the firmware… I will try to remove the audio alarm, because this is useless for me, my frontdoor is some meters near the street and i get false alarms every time a car or a person drives/walks by.

I can´t use refresh in my sitemap with video. I get errors, also in the manual it is no refres option described.


Now i disabled both alarms (audio/motion) and will wait some time, if the stream stops again…

EDIT:
Stream is also stopping after some time…

EDIT2:
MJPEG-Stream from the binding is stopping after some time - but the snapshots-mjpeg (full-hd) stream from the binding seems to be more stable…
My dahua cam is providing a mjpeg stream (at lower resolution - about 700x400) and the cam is serving this without the need of user/password.

I may have been using webview and refresh when testing but the issue is the stream will stay stop until the next refresh comes
Around and if you refresh often you get more glitches. Not optimal like proposed solution.

Yes snapshots.mjpeg is created by the binding and does not come from the camera so interested to hear how it performs long term.

Also don’t rule out the browser being the cause of a stream closing. Do some google searches.

I´m still struggling with my Reolink RCL 410 on my test setup (Rpi4), trying to archive getting the HLS streaming and animated GIF support… But I´m getting alot closer now.

However, I seem to have a permission problem after installing FFMPEG… The binding is not allowed to write the gif file to the output folder I have specified in the things file. I installed FFMPEG according to the readme file, and then created a /tmpfs/camera1/ folder, which I have defined as the output folder in the things file.
Where did I go wrong, and how to fix it? (I am useless regarding Linux and permissions… I simply dont get it :frowning: ).

My cam stops working every few hours - it has something to do with the gif creation. I made some loginfo into my rules and i can see, that sometimes the binding should create a gif and i get this with email - but after that i only get a standing picture in my snapshots.mjpeg stream from the time the gif-creation ended.
–> also the switch “gif creation” still is ON

Today morning at 6 a.m. a cat walked by my frontdoor - i got a gif. And now at 7.30 a.m. i can still only see a not movimg picture with the snapshots.mjpeg-link from the time, the gif was created from - no more new pics. Even browser refresh will not bring back the stream. Also cam-reboot didn´ßt help, only openhab-server reboot was usefull.

I changed the gif creation from standard values to preroll=3 and postroll=20. Will do further testings with standard values, if this caused the problem.

I removed my second cam (cheap china cam) from my things file completely and i disabled audio/motion alarm on my dahua. I also removed the image channel of my dahua from the items-file. But this was no help.

Openhab Service restart didn´t help… I got many of this error messages, when openhab is starting and even after some minutes of running, still no new picture from snapshots.mjpeg

2020-01-29 08:12:02.469 [WARN ] [pcamera.internal.StreamServerHandler] - Exception caught from stream server:{}

java.lang.NullPointerException: null

	at io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:360) ~[bundleFile:4.1.42.Final]

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

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

	at org.openhab.binding.ipcamera.internal.StreamServerHandler.channelRead(StreamServerHandler.java:119) ~[?:?]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]

	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

After that i did an Openhab Server reboot and now it is working again…

Did some more testing:

With gif_preroll set to a value greater then 0 ( in my case 3 seconds) i get this error-messages

2020-01-29 14:48:00.635 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! Camera has closed a channel 	URL: Cause reported is: {}

io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@51a8dbcf(incomplete)

	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:461) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:159) ~[bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:267) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:137) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:30) ~[bundleFile:4.1.42.Final]

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

	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.processAuth(MyNettyAuthHandler.java:177) ~[?:?]

	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:227) ~[?:?]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]

	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

2020-01-29 14:48:00.641 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can't find ch when removing handler 		URL:/cgi-bin/snapshot.cgi?channel=1

2020-01-29 14:48:00.635 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! Camera has closed a channel 	URL: Cause reported is: {}

io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@62309285(incomplete)

	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:461) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:159) ~[bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:267) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:137) ~[bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:30) ~[bundleFile:4.1.42.Final]

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

	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.processAuth(MyNettyAuthHandler.java:177) ~[?:?]

	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:227) ~[?:?]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]

	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [bundleFile:4.1.42.Final]

	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]

	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]

	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]

	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]

	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
2020-01-29 14:48:18.643 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !?! Channel that was found idle could not be located in our tracking. !?!

2020-01-29 14:48:18.643 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !?! Channel that was found idle could not be located in our tracking. !?!

2020-01-29 14:48:18.643 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can't find ch when removing handler 		URL:

2020-01-29 14:48:18.644 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can't find ch when removing handler 		URL:
2020-01-29 14:50:28.095 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 13 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-01-29 14:50:28.095 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.095 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.095 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.096 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.096 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.096 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-01-29 14:50:28.096 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

When i change gif_preroll to 0 it works very good…

I´m not sure how to get past my permission issue… I have tried changing the ffmpeg output folder. But that doesnt change anything…
This is the error I get every time I try to create a animated Gif.

2020-01-29 21:33:28.199 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - FileNotFoundException {}
java.io.FileNotFoundException: /etc/openhab2/html/camera1/snapshot5.jpg (Permission denied)
	at java.io.FileOutputStream.open0(Native Method) ~[?:1.8.0_222]
	at java.io.FileOutputStream.open(FileOutputStream.java:270) ~[?:1.8.0_222]
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213) ~[?:1.8.0_222]
	at java.io.FileOutputStream.<init>(FileOutputStream.java:162) ~[?:1.8.0_222]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.storeSnapshots(IpCameraHandler.java:1082) [bundleFile:?]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1144) [bundleFile:?]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler$3.run(IpCameraHandler.java:1666) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

This is my thing file:

Thing ipcamera:HTTPONLY:Reolink "Frontdoor Camera" @ "Cameras"
[
    IPADDRESS="10.4.28.202",
    USERNAME="username",
    PASSWORD="password",
    PORT=80,
    POLL_CAMERA_MS=1000,
    SERVER_PORT=54321,
    UPDATE_IMAGE=false,
    GIF_PREROLL=1,
    GIF_POSTROLL=6,
    IP_WHITELIST="DISABLE",
//    SNAPSHOT_URL_OVERRIDE="http://192.168.1.181/capture",
//    STREAM_URL_OVERRIDE="http://192.168.1.181:81/stream",
    FFMPEG_OUTPUT="/etc/openhab2/html/camera1/",
    FFMPEG_INPUT="rtsp://username:password@10.4.28.202:554//h264Preview_01_main"
]

Same problem here with my dahua. After few days, Intrusion was detected, GIF creation recieve ON but never return to OFF. I have to restart openhab (not the camera).

I think that is the best option for now till the cause is found. It would be handy if you could capture the moment it happens with TRACE log output to see what was happening.
I use gif with a preroll all the time and no issues.

Please, does anybody make use of the SV3C Camera more over?
What kind of camera type can identify this model? Perheaps only httponly is supported?
Which kind of test can I do with it to verify?
Sorry, very newby with this kind of integration