IpCamera: New IP Camera Binding

remove the quotes for numbers, they are only used for Strings.

You need to set a valid port number and then read the docs on how to view a snapshot and streams. You can not see it in PaperUI, use sitemaps and habpanel.

@matt1
After moving to the current openhab stable release and binding, I every now and then get the error message ā€œAlarm stream not running. Restarting it nowā€ on one of my Amcrest/Dahua camerasā€¦ in an endloses loop.
How can this be stopped?

Tested and working perfectly on Hikvision DS-7608NI-I2 / 8P NVR

1 Like

It never stops here, try upgrading your firmware and reporting to support after first testing in a browser. Do the logs give any reason? Trace.

Youā€™re right, Iā€™m an idiot.
everything works now.

ipcamera.things

Thing ipcamera:onvif:001 
[
    ipAddress="10.3.1.11",
    port=80,
    onvifPort=8000,
    serverPort=54321,
    username="admin",
    password="Password",
    onvifMediaProfile=0
]

and myopenhab.sitemap

Text label="MyCamera" icon="camera"{
     Text label="camera001" icon="camera" {
      Video url="http://10.3.1.100:54321/snapshots.mjpeg" encoding="mjpeg"
      }
}

Thank you very much and sorry!

I am trying this binding with a Tapo camera which has almost no onvif features, so I added it as generic.
When I play the RTSP URL with ffplay, it looks decent.
But when I use the ffmpeg-generated .jpg or .mjpeg URLs from openHAB, it looks very blocky.
I already changed the MJPEG options to ā€œ-q:v 2 -r 2 -update 1ā€.
Anything else I can try? Thanks!
Output of ffplay:
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080, 15 fps, 15 tbr, 90k tbn, 30 tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

What about this?
-qmin 1 -q:v 1 -r 2 -update 1

Also are you stretching the video to fill a 4K screen?

Itā€™s not getting better. I am viewing this on a 1920x1200 screen. On the same screen, the original video viewed with ffplay looks OK.

Then you should enable DEBUG log output On the binding (see docs) and then google any output that You see. Iit may be dropping frames then making up the lost details, but that is what logs are for, to help diagnose the issue.

Continuing the discussion from IpCamera: New IP Camera Binding:

Matt, awesome work

Meā€¦old school techo trying to do new school thingsā€¦

Hi all,

OH259
RPi
Dahua NVR + IPC

.things
Thing ipcamera:dahua:002
[
ipAddress=ā€œ192.168.10.200ā€, password=ā€œ",
username="
*ā€,
serverPort=54322,
nvrChannel=1,
onvifMediaProfile=0,
onvifPort=80
//mjpegUrl=ā€œhttp ://192.168.10.200:80/cgi-bin/mjpg/video.cgi?channel=1&subtype=0ā€
]

.sitemaps
Text label=ā€œGarage Rearā€ icon=ā€œcameraā€ {
Video url=ā€œhttp ://192.168.10.221:54322/ipcamera.mjpegā€ encoding=ā€œmjpegā€
}

No video displays in the OH mobile app

Receiving log messages including below. I can get everything to work direct to the IPC but when I put the NVR in the middle I canā€™t get it to work.

13:51:58.712 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http
://192.168.10.200:80/cgi-bin/snapshot.cgi?channel=1
13:51:58.722 [TRACE] [camera.internal.onvif.OnvifConnection] - Onvif reply is:

404 Not Found

13:55:19.719 [INFO ] [mera.internal.handler.IpCameraHandler] - The alarm stream was not running for camera 192.168.10.200, re-starting it now
13:55:19.739 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http
://192.168.10.200:80/cgi-bin/eventManager.cgi?action=attach&codes=[All]

Guys I have bunch of ā€œYOOSEEā€ cameras, any chance to hook them up to OH???
RTSP string I can play in VLC: rtsp://login:pass@IP_ADDRESS:554/onvif1

there is no port 80 connection as there is no web interface for the camera.

ONVIF port is 5000 and discovery port 3702 is all what it has.

When I try to set them up as:

ā€œONVIFā€ Generic IP camera with ONVIF support.

I get: Status: OFFLINE - CONFIGURATION_ERROR Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.

the camera does not have snapshot URL!!!

ANY CHANCE TO USE THIS BINDING TO PLAY THE VIDEO IN OH 2.5.9???

Test the URLs in a browser and if they donā€™t work you will need to find ones that do work behind the nvr and override the built in ones.

@elik745i
Enter in ffmpeg in place of the snapshot URL and this forces the binding to create snapshots from the RTSP feed. Any camera that claims onvif and has no snapshot probably is going to break the standard more then once so be prepared for issues. A snapshot is mandatory in the onvif spec.

I have entered: http://192.168.1.100:8086/ipcamera.mjpeg in SNAPSHOT_URL_OVERRIDE

still nothing, says:
Status: OFFLINE - COMMUNICATION_ERROR Connection Timeout: Check your IP and PORT are correct and the camera can be reached.

I have ran nmap both on TCP and UDP ports and here is what open:

554 -rtsp
5000 - onvif

3702 - UDP

that is it

HomeAssist has option to play just RTSP strings through ffmpeg, why this binding you create canā€™t? HOW TO OVERRIDE SNAPSHOOT and HTTP so I can play RTSP?

Where are you getting that from as it is wrong unless your using old copy of binding. Only get your info from the docs here.

I have checked and looks like that was old binnding. I have hit install ipcamera binding 2.5.9 And nothing changed:

UPDATE: Looks like the binding was really old, I have deleted IPCAM from things and created new one. Camera became online, but URL entered in VLC player does not open streamā€¦neither shown in OH when entered in .sitemap:

Text item=IPC_LAB {Video url=ā€œhttp://192.168.1.100:8086/ipcamera.mjpegā€ encoding=ā€œmjpegā€}

Yes that binding was very old, you should not see anything in ALL CAPS in the newer builds.
The merged binding of 2.5.9 has a bug for recording GIF files and is missing a compatibiity fix I made, so the best build to use is this one as a newer 2.x binding is unlikely to get released.

http://pcmus.com/openhab/IpCameraBinding/ipcamera-2020-09-22.zip

Then clean your cache and tmp to flush out the older bindings, search this forum for how to clean the cache.

That is an output URL, you need to provide WORKING urls that actually work to the binding, so test them in a web browser first and if they dont work, they wont make the binding work.

Is the 5 sec mjpeg-record bug already fixed in the official ipcamera-binding from the openhab-repo? I installed your fixed version manually some weeks ago, when the new binding version had this problem.

Can i remove the manual installed beinding and update to latest openhab 2.5.10 release?

Beside 5 different cameras, a certain type simply does not want to work. It is a Victure PC750 IP Camera. I tried to get it running manually over ffmpeg and noticed that the camera only provides the rtsp stream over UDP. This leads to the following error in openhab:

[DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - rtsp://user:pass@192.168.xxx.xxx: Invalid data found when processing input

Ipcamera-binding is starting ffmpeg with this standard parameters (including rtsp_transport = tcp):

[DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner -loglevel warning -i rtsp://user:pass@192.168.xxx.xxx

When iā€™m trying to overwrite the -rtsp_transport parameter from the item settingsā€¦

ā€¦the parameter is simply added before it. This does not work either.

[DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-rtsp_transport udp -rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner -loglevel warning -i rtsp://user:pass@192.168.xxx.xxx

Is there a way to change the -rtsp_transport parameter for ffmpeg to UDP?
In my case this would be the key to load the rtsp stream of my camera via ffmpeg/ipcamera-binding.

1 Like

I would have liked to buy an Amcrest camera because they seem well supported by this binding and are not that expensive (OK, they are way more expensive in Germany than in US, but still).
Unfortunately, they seem to only sell discontinued models like the IP2M-841B via Amazon Germany. The newer IP2M-841B-V3 is not sold outside the US. The Ultra HD for a few bucks more is also EOL.
Can anyone recommend a similar API camera (indoor, 1080P, Pan/Tilt) that works well with this binding, is available in Europe (or even Germany) and does not cost way over 100 Euro?
Thanks!
Edit: Maybe the Foscam R2M is an option?

I ordered a Reolink E1 zoom the other day. I will share my findings after receiving it.

1 Like