IpCamera: New IP Camera Binding

New build 2019-07-16 has these changes:

  • Changed UPDATE_IMAGE config to be how it behaves on startup only.
  • Reworked the config called UPDATE_IMAGE_EVENTS to take over the Image Updating controls along with the channel called updateImageNow, allowing you to start and stop the image on demand. PaperUI has descriptions on what the controls do, readme to be updated shortly… This allows future options to be added via the same config and now ppl have the ability to override the setting with the channel.
  • Fixed mistake in double port :80:554 fix in last build. Thanks presidentio for spotting it and PR.
  • Fixed bug that may have caused commands to be handled wrongly on startup.
  • Logging changes to remove long file missing error when ffmpeg is slow to start.

Also if you use the binding and sitemaps, this thread may be of interest to you…

Hello @matt1,

Thank you so much for the work you’ve put into this binding.

I’m struggling with making it work with the newest version. I’m using HikVision NVR and wanted to add a few RTSP cameras as well.

For a few months I had the following configuration:

Thing ipcamera:HIKVISION:Cam1 "Front Camera" [IPADDRESS="192.168.0.49", USERNAME="XXX", PASSWORD="XXX", ONVIF_PORT=8000, PORT=80, NVR_CHANNEL=1 ]

And it worked perfectly with the items like

Image NVR_Front    "Front"      {channel="ipcamera:HIKVISION:Cam1:image"}

Now I’ve updated the binding to the latest one, and keeping the same *.things and items definitions intact, I get the following errors:

2019-07-17 20:57:39.980 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 166, cap: 166/166, unwrapped: PooledUnsafeDirectByteBuf(ridx: 376, widx: 376, cap: 400)), decoderResult: success)

2019-07-17 20:57:39.975 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/Streaming/channels/301/picture

2019-07-17 20:57:39.986 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<!DOCTYPE html>

<html><head><title>Document Error: Not Found</title></head>

<body><h2>Access Error: 404 -- Not Found</h2>

<p>Can't open URL</p>

</body>

</html>

:

2019-07-17 20:57:39.997 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 166, cap: 166/166, unwrapped: PooledUnsafeDirectByteBuf(ridx: 376, widx: 376, cap: 400)), decoderResult: success)

2019-07-17 20:57:39.998 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 297, cap: 297/297, unwrapped: PooledUnsafeDirectByteBuf(ridx: 530, widx: 530, cap: 1024)), decoderResult: success)

2019-07-17 20:57:39.997 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/ISAPI/System/IO/inputs/2/status

2019-07-17 20:57:40.003 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<!DOCTYPE html>

<html><head><title>Document Error: Not Found</title></head>

<body><h2>Access Error: 404 -- Not Found</h2>

<p>Can't open URL</p>

</body>

</html>

:

2019-07-17 20:57:40.005 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.0.49:80/ISAPI/System/IO/inputs/3/status

2019-07-17 20:57:40.006 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="UTF-8" ?>

<ResponseStatus version="1.0" xmlns="urn:psialliance-org">

<requestURL>/ISAPI/System/IO/inputs/4/status</requestURL>

<statusCode>4</statusCode>

<statusString>Invalid Operation</statusString>

<subStatusCode>invalidOperation</subStatusCode>

</ResponseStatus>

:

2019-07-17 20:57:40.003 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 403 Forbidden

Date: Wed, 17 Jul 2019 20:58:09 GMT

Server: DNVRS-Webs

Cache-Control: no-cache

Content-Length: 297

Content-Type: application/xml; charset="UTF-8"

Connection: keep-alive

Keep-Alive: timeout=60, max=79

2019-07-17 20:57:40.013 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] -    Using the already open channel:2 	GET:/ISAPI/System/IO/inputs/3/status

2019-07-17 20:57:40.014 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 297, cap: 297/297, unwrapped: PooledUnsafeDirectByteBuf(ridx: 530, widx: 530, cap: 1024)), decoderResult: success)

2019-07-17 20:57:40.016 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/ISAPI/System/IO/inputs/3/status

2019-07-17 20:57:40.017 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="UTF-8" ?>

<ResponseStatus version="1.0" xmlns="urn:psialliance-org">

<requestURL>/ISAPI/System/IO/inputs/1/status</requestURL>

<statusCode>4</statusCode>

<statusString>Invalid Operation</statusString>

<subStatusCode>invalidOperation</subStatusCode>

</ResponseStatus>

:

2019-07-17 20:57:40.009 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 403 Forbidden

Date: Wed, 17 Jul 2019 20:58:09 GMT

Server: DNVRS-Webs

Cache-Control: no-cache

Content-Length: 297

Content-Type: application/xml; charset="UTF-8"

Connection: keep-alive

Keep-Alive: timeout=60, max=78

2019-07-17 20:57:40.000 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<!DOCTYPE html>

<html><head><title>Document Error: Not Found</title></head>

<body><h2>Access Error: 404 -- Not Found</h2>

<p>Can't open URL</p>

</body>

</html>

:

2019-07-17 20:57:40.009 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 404 Not Found

Date: Wed, 17 Jul 2019 20:58:09 GMT

Server: DNVRS-Webs

Cache-Control: no-cache

Content-Length: 166

Content-Type: text/html

Connection: keep-alive

Keep-Alive: timeout=60, max=78

2019-07-17 20:57:40.024 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 297, cap: 297/297, unwrapped: PooledUnsafeDirectByteBuf(ridx: 530, widx: 530, cap: 1024)), decoderResult: success)

2019-07-17 20:57:40.028 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 403 Forbidden

Date: Wed, 17 Jul 2019 20:58:09 GMT

Server: DNVRS-Webs

Cache-Control: no-cache

Content-Length: 297

Content-Type: application/xml; charset="UTF-8"

Connection: keep-alive

Keep-Alive: timeout=60, max=78

2019-07-17 20:57:40.032 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 297, cap: 297/297, unwrapped: PooledUnsafeDirectByteBuf(ridx: 530, widx: 530, cap: 1024)), decoderResult: success)

2019-07-17 20:57:40.035 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="UTF-8" ?>

<ResponseStatus version="1.0" xmlns="urn:psialliance-org">

<requestURL>/ISAPI/System/IO/inputs/3/status</requestURL>

<statusCode>4</statusCode>

<statusString>Invalid Operation</statusString>

<subStatusCode>invalidOperation</subStatusCode>

</ResponseStatus>

Reading through this thread I suspect it has to do with ISAPI endpoint?

Questions

  1. Is there a way to have it working as before without the need of rollback? I’m using NVR_CHANNEL params there. Maybe I missed some breaking change
  2. (slightly off-topic) What would be a proper way to have a HTTPONLY Thing declared?
    My only input is a audioless RTSP stream from a Yi camera: rtsp://192.168.0.XX/ch0_0.h264
    Seems like I got it wrong:
Thing ipcamera:HTTPONLY:Driveway "Driveway" [ IPADDRESS="192.168.0.XX", PORT=554, SNAPSHOT_URL_OVERRIDE="rtsp://192.168.0.XX/ch0_0.h264" ]

I’m on openHAB 2.5.0.M1 Milestone Build on RPi3B with openHABian.
Installed ffmpeg manually.
Stopped openhab2 service, cleared cache - all that stuff.

Best regards,
Kuba

Possible this is the cause, you can test it in any browser to see if one of these works or if both do…
ip/Streaming/channels/301/picture
ip/ISAPI/Streaming/channels/301/picture
If there is an issue please let me know as I would prefer newer cameras work and older ones have to override.

This config line can be used to override. Replace the 3 with the NVR channel or if you setup the NVR to use separate ports for each camera it will need to be a 101 in that case. I don’t have an NVR so have not tested a lot of this functionality.

SNAPSHOT_URL_OVERRIDE="/ISAPI/Streaming/channels/301/picture"

For an example httponly thing file this link should be best until I update the examples in the readme…
https://community.openhab.org/t/diy-digital-doorbell-peephole-camera/76417/8
The snapshot url is very important as that is how the camera comes ONLINE, if you give a rtsp link instead of a jpg snapshot url it will fail and not come online. Perhaps I should reconsider this? At the time I thought that all cameras could do a snapshot.
The SERVER_PORT is also important to enable the serving of files on a port of your choice.

1 Like

Great work @matt! I’m on vacation now until the 10th of august so i will test your new version after that. Don’t think i’m not interested in this change due to no reactions on my side:-)

Thanks a lot! My HikVision cameras from NVR are working great now!
Here’s an example for further reference:

Thing ipcamera:HIKVISION:Cam1 "Front Camera"    [
    IPADDRESS="192.168.0.XX",
    USERNAME="XXX",
    PASSWORD="XXX",
    SNAPSHOT_URL_OVERRIDE="/ISAPI/Streaming/channels/101/picture",
    ONVIF_PORT=8000,
    PORT=80,
    NVR_CHANNEL=1,
    IP_WHITELIST="DISABLE",
    FFMPEG_OUTPUT="/tmp/camera-front/",
    FFMPEG_INPUT="rtsp://192.168.0.XX:554/ISAPI/Streaming/channels/101"
]

Yes. that was something I discovered as well.
I’m using two Yi cameras (Yi Outdoor and Yi Dome 720) with this hack. Unfortunately it does not provide a snapshot feature.
I also have an old Yi Home 12CN camera with this hack installed.

One weird thing I noticed with one of them is that when I placed the following thing definition, and then commented out the SNAPSHOT_URL_OVERRIDE, it still stayed Online :wink:

Thing ipcamera:HTTPONLY:Garage "Garage"
[
	IPADDRESS="192.168.0.XX", POLL_CAMERA_MS=1000,
	IP_WHITELIST="DISABLE", IMAGE_UPDATE_EVENTS=0,
	// SNAPSHOT_URL_OVERRIDE="rtsp://192.168.0.XX/capture.jpg", // <- fake URL,  my cameras have no snapshots :(
	STREAM_URL_OVERRIDE="rtsp://192.168.0.XX/ch0_0.h264",
	FFMPEG_OUTPUT="/tmp/camera-garage/", FFMPEG_INPUT="rtsp://192.168.0.XX/ch0_0.h264"
]

I’ll play around with the animated GIF rules. It would be great to have the example rules in the binding docs, so hopefully I can help there too :slight_smile:

My next plan would be to experiment with the Chromecast streaming!

Best regards,
Kuba

I plan to update the readme over the next few days and then any improvements will be welcome, examples are also welcome as you probably know the rules better then I do. I will also have a rethink over the online detection as it should be easy enough just to try and open a netty channel to ensure the camera is reachable. Half the features need a snapshot, the other ones like casting should work without it.

Try this rule below…
You need to request the ipcamera.m3u8 file for ffmpeg to start creating the files and this depends on how slow your camera is to open and send a stream. Also on slower ARM processors you may see the speed is lower than 1x (not fast enough for realtime) and it slowly improves over time until it reaches 1x… Hence the timer delay, with a fast cpu I suspect it will not be needed.

After 1 minute of not needing the ipcamera.m3u8 file, the binding stops the stream and CPU is no longer used until you start the process again.

var Timer tCameraTimer = null

rule "Cast Front Door Cam to TV"
	when
	Item FrontDoorTV received command
	then
	if (receivedCommand == ON){
	//Start generating HLS format to reduce the startup delay
		sendHttpGetRequest("http://192.168.1.2:54063/ipcamera.m3u8")
		tCameraTimer = createTimer(now.plusSeconds(12), [ | // Use timer to allow stream and ffmpeg to stabilise.
		SonyTVCastPlayURI.sendCommand("http://192.168.1.2:54063/ipcamera.m3u8")
		tCameraTimer = null
	])
	}
	else{
		SonyTVCastPlayURI.sendCommand("")
	}
end

1 Like

Hi can anyone tell me the config for reolink camera?
i was able to make the camera come online but in logs i get som nullPointer

01:09:25.350 [WARN ] [ding.ipcamera.handler.IpCameraHandler] - !!!! Camera has closed the channel       URL:/onvifsnapshot/snapshot_channel01.jpg Cause reported is: {}
java.lang.NullPointerException: null

where can i get this URL from ?

@Gad_Ofir

Number one result with google is this faq page by reolink support.

@kubawolanin

Yes that is not a bug, I just looked over the code and it is how I was thinking of changing it to already. The camera will come online if the binding can successfully open a http channel to the camera. The url can be fake as all it needs is the correct IP and PORT and also the camera must be running a http server at that location. The moment a connection is made the camera will come online, this will be because it can take 3-4 seconds for a jpg to be sent back by 4k cameras. I wrote it some time ago now. If you can not trick your cameras to come online yet they have a server that accepts http connections then I would need some trace level log output to work out what is stopping it from working.

Very keen to hear any feedback on how it works, so far I have not gotten anyone to reply with any feedback which makes it harder to improve a feature.

Next version which is not released has a few changes based off your log. It will stop checking the alarm inputs for cameras like yours and mine that are missing the feature. Also I suspect some features are not working for your camera in current builds and the next build should update the controls and status of alarms and the like when the camera first connects.

2 Likes

thank you matt, i came acress this … but it did not work i will play around some more
maybe i got somthing wrong

1 Like

I´m using a Reolink as well RLC410… I´ll pass on my setup. Seem to somehow work, (partly). But I have not tried ffmpeg or motion gif etc…
My config works for grapping an image (snapshot) and show on a sitemap aprox every 4 sec.

.things file

Thing ipcamera:HTTPONLY:001 [ IPADDRESS="10.4.28.202", PASSWORD="xxxxxxxx", USERNAME="openhab", SNAPSHOT_URL_OVERIDE="http://10.4.28.202/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=openhab&password=xxxxxxxxx", PORT=80]

.items file

Switch Cam001Switch      { channel="ipcamera:HTTPONLY:001:updateImageNow" }
Switch Cam001Stream      { channel="ipcamera:HTTPONLY:001:streamVideo" }
Image Cam001Image        { channel="ipcamera:HTTPONLY:001:image" }
String Cam001ImageUrl    { channel="ipcamera:HTTPONLY:001:imageurl" }

.sitemap file

sitemap ipcamera label="IPcamera"
{
	Frame label="Image"{
	Switch item=Cam001Switch
	Switch item=Cam001Stream
	Image item=Cam001Image
	Text item=Cam001ImageUrl
	}
}

1 Like

Thanks Allot! will try this

but i whuld really like motion to motify OH, if anyone can think of a way please!

If you mean the motion detection? It´s not supported by the binding, unfortunatly. And I dont think Matt can change that, cause Reolink does not have an API.

If you camera support FTP image upload when motion is detected (which I think Reolink cameras does), then you can use FTP Upload binding. Binding page contains use case example for network camera motion detection. You can use both IP camera binding and FTP upload binding in parallel.

Thanks Pali i will try it also !

Hi @Kim_Andersen

i am still getting

17:04:48.950 [WARN ] [ding.ipcamera.handler.IpCameraHandler] - !!! Camera has closed the channel URL:/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=******** Cause reported is: {}
java.lang.NullPointerException: null

is there anything else i needed to change but the URL(IP) and pass?
can this error be because i don’t have SD card installed?

Instead of relying on this binding, you could use something like MotionEye to sit between the camera(s) and OH. MotionEye (using Motion underneath) will run a script on motion detection which you can use to trigger an MQTT message, POST to the OH REST interface or whatever else you need. MotionEye’s live feed can then be shown in OH.

I believe you´ll need to create the cmd path (this part: 0&rs=wuuPhkmUCeI9WG7C&) from your device.
As far as I remember, you´ll need to call the URL from the Reolink application (windows), but it has been a few weeks since I made that change…

No, I dont have an SD card installed either.

Platform information:
Hardware: AMD Atlon 2gb
OS: Debian 9.5
Java Runtime Environment: (build 1.8.0_212-8u212-b03-2~deb9u1-b03)
openHAB version: openHAB 2.4.0 Release Build
Camera 50H20L_18EV200_S38
ONVIF Ver 2.41

Good day.

It is necessary to receive a motion presence signal from cameras in OH2, but in the logs I get an error:

2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to fetch some information about the Media Profiles from the camera
2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - *********** Media Profile 0 details reported by camera at IP:192.168.1.13 ***********
2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the bindings settings.
2019-07-28 18:09:14.842 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - This can be used to stream HLS with low CPU overhead
2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:VideoE_000
2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder :H_264
2019-07-28 18:09:14.842 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality :4.0
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion :1920 x 1080
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate :2707
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - *********** Media Profile 1 details reported by camera at IP:192.168.1.13 ***********
2019-07-28 18:09:14.843 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - This can be used to stream HLS with low CPU overhead
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:VideoE_001
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder :H_264
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality :3.0
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion :704 x 576
2019-07-28 18:09:14.843 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate :676
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - *********** Media Profile 2 details reported by camera at IP:192.168.1.13 ***********
2019-07-28 18:09:14.844 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - This can be used to stream MJPEG if it is reachable with a HTTP url.
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 2 is named:VideoE_002
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 2 uses video encoder :JPEG
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 2 uses video quality :4.0
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 2 uses video resoltion :704 x 576
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 2 uses video bitrate :512
2019-07-28 18:09:14.844 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to interrogate the camera to see if it supports PTZ.
2019-07-28 18:09:15.831 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF
2019-07-28 18:09:15.831 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ with no errors, now fetching the Video URL for RTSP from the camera.
2019-07-28 18:09:16.130 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.1.13:80/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.132 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for GET:/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.133 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened the closed channel:0 GET:/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.635 [ERROR] [ing.saaj.soap.ver1_2.SOAPPart1_2Impl] - SAAJ0415: InputStream does not represent a valid SOAP 1.2 Message
2019-07-28 18:09:16.637 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.1.13:80/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.638 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for GET:/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.639 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:0 GET:/webcapture.jpg?command=snap&channel=1
2019-07-28 18:09:16.640 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.1.13:80 is now online.
2019-07-28 18:09:16.661 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-type: image/jpeg
Content-Transfer-Encoding: binary
Content-Length: 135490
Connection: close
2019-07-28 18:09:16.662 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 512, cap: 512/512, unwrapped: PooledUnsafeDirectByteBuf(ridx: 512, widx: 512, cap: 512)), decoderResult: success)
2019-07-28 18:09:16.662 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! Camera has closed the channel URL:/webcapture.jpg?command=snap&channel=1 Cause reported is: {}
java.lang.NullPointerException: null

things:

Thing ipcamera:ONVIF:Bedroom
[
    IPADDRESS="192.168.1.13",
    PASSWORD="",
    USERNAME="admin",
    ONVIF_PORT=8899,
    PORT=80,
    SERVER_PORT=-1,
    POLL_CAMERA_MS=2000,
    FFMPEG_OUTPUT="/etc/openhab2/html/cameras/bedroom/",
    IP_WHITELIST="DISABLE",
    ONVIF_MEDIA_PROFILE=0
]

items:

String BedroomCamLastMotionType "Last Motion Type" { channel="ipcamera:ONVIF:Bedroom:lastMotionType" }
DateTime BabyCamLastMotionTime_LastUpdate "Last Update [%1$td-%1$tm-%1$tY %1$tH:%1$tM:%1$tS]" <calendar>

rules:

rule "BedroomCamLastMotionType last movement"
    when
    Item BedroomCamLastMotionType received update
    then
logInfo("BedroomCamLastMotionType last movement", "BedroomCamLastMotionType.state=" + BedroomCamLastMotionType.state)
postUpdate(BabyCamLastMotionTime_LastUpdate, new DateTimeType())
end

If you open the link http://192.168.1.13/webcapture.jpg?command=snap&channel=1 in the browser, it opens the picture from the camera without any questions.

Path FFMPEG_OUTPUT is empty:

root@nas:/etc/openhab2# cd /etc/openhab2/html/cameras/bedroom/
root@nas:/etc/openhab2/html/cameras/bedroom# ls

How to correct the error and and get in the BedroomCamLastMotionType an event when moving in the camera?

i have MotionEye but something is wrong with the stream to it its blurry … anyway i want to go OH native on it and not rely on another system, i also use node-red and its starting to look kind of complicated

@matt1, I noticed that my “live stream” is about 8s behind real time.
Anybody else noticing this?
Here is my setup in my sitemap:

Webview url="http://192.168.1.200:37777/ipcamera.m3u8" height=20