- Platform information:
- Hardware: _Intel Core i5 -7400/RAM 8GB/700GB
- OS: Windows 10 Pro
- Java Runtime Environment: jre 1.8.0.181
- openHAB version: openhab-2.5.3
- Issue of the topic:
I am trying to configure the Neye3C G6 model with ipcamera binding.
I do not have documentation about this camera and what I have learnt was by trial and error.
I am working in windows 10 and use Paper UI to configure Things and Items. I use HABPanel to create Panels.
I have tried two solutions with different achievements and failures
First trial with HTTPONLY type ID
The configuration that I have:
“SERVER_PORT”: 50011,
“FFMPEG_LOCATION”: “C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe”,
“PORT”: 80,
“FFMPEG_OUTPUT”: “c:\cameratmpfs\camera1\”,
“IPADDRESS”: “192.168.0.20”,
“IP_WHITELIST”: “DISABLE”,
“UPDATE_IMAGE”: true,
“GIF_POSTROLL”: 8,
“FFMPEG_GIF_OUT_ARGUMENTS”: “-r 2 -filter_complex scale\u003d-2:360:flags\u003dlanczos,setpts\u003d0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse”,
“GIF_PREROLL”: 0,
“IMAGE_UPDATE_EVENTS”: 1,
“FFMPEG_MJPEG_ARGUMENTS”: “-qscale:v 5 -r 6 -update 1”,
“PASSWORD”: “xxxxxxx”,
“FFMPEG_INPUT”: “rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0”,
“POLL_CAMERA_MS”: 2000,
“USERNAME”: “admin”,
“FFMPEG_HLS_OUT_ARGUMENTS”: “-strict -2 -f lavfi -i aevalsrc\u003d0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4”
What works well:
- I have been able to configure the widget CameraFed whith the URL http://192.168.0.165:50011/ipcamera.mjpeg and I see the camera images, I see in the log that start ffmpeg whith the commad
18:21:23.064 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -qscale:v 5 -r 6 -update 1 http://127.0.0.1:50011/ipcamera.jpg
And I see that stops when I leave the Panel , Great!!
- Update the Image functionality
When I turn on this functionality a see that start ffmpeg, this is the command
18:34:23.812 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -threads 1 -skip_frame nokey -i rtsp://admin:xxxxxxxx@192.168.0.20:8554/profile0 -an -vsync vfr -update 1 http://127.0.0.1:50011/snapshot.jpg
And I am able to configure the widget Image with the URL http://localhost:50011/ipcamera.jpg. Also when I switch off, then ffmpeg stops. Great!!
Now what doesn’t work:
If I configure the Image widget with an update interval, i.e. 4 sec., I see the image, but after 4 seconds the image disappears, this is the log
18:39:57.617 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.jpg?_t=2020-04-10T16:39:57.610Z
18:39:57.619 [WARN ] [ipcamera.internal.StreamServerHandler] - Exception caught from stream server:{}
java.io.FileNotFoundException: c:\cameratmpfs\camera1\ipcamera.jpg?_t=2020-04-10T16:39:57.610Z (El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos)
It seems that when the widget tries to refresh the image, it send the GET command to OpenHab WebServer, and it try to find the image at c:\cameratmpfs\camera1\ipcamera.jpg.
But in the directory there isn’t. In fact I don’t see any command at log file to order ffmpeg to store the image in this directory.
How can I get that the web server do not search the image at the file system, but at the RAM, as it does the first time?
- Motion Alarm
If I move the Motion Alarm Timer, it starts again ffmpeg and this is the command
19:01:00.729 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -an -vf select='gte(scene,0.0017)',metadata=print -f null –
And it detects the motion, and activate the Motion Alarm, Works well, Great!!!
- Create animated gif, works well, this is the commant in log file:
21:39:52.612 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -y -t 8 -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -r 2 -filter_complex scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse c:\cameratmpfs\camera1\ipcamera.gif
- Pan and tilt: With HTTPONLY type I do not have the possibility to move the camera. It doesn’t have this channels.
With type ID ONVIF
My camera doesn’t have snapshot functionality.
This is the configuration that I have
"SERVER_PORT": 50012,
"FFMPEG_LOCATION": "C:\\Program Files\\ffmpeg-4.2.2-win64-static\\bin\\ffmpeg.exe",
"ONVIF_MEDIA_PROFILE": 0,
"PORT": 80,
"FFMPEG_OUTPUT": "C:\\cameratmpfs\\camera1\\",
"IPADDRESS": "192.168.0.20",
"IP_WHITELIST": "DISABLE",
"UPDATE_IMAGE": false,
"ONVIF_PORT": "80",
"GIF_POSTROLL": 8,
"FFMPEG_GIF_OUT_ARGUMENTS": "-r 2 -filter_complex scale\u003d-2:360:flags\u003dlanczos,setpts\u003d0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse",
"GIF_PREROLL": 0,
"IMAGE_UPDATE_EVENTS": 0,
"FFMPEG_MJPEG_ARGUMENTS": "-qscale:v 5 -r 6 -update 1",
"PASSWORD": "xxxxxxx",
"SNAPSHOT_URL_OVERRIDE": "/onvif/",
"POLL_CAMERA_MS": 2000,
"USERNAME": "admin",
"FFMPEG_HLS_OUT_ARGUMENTS": "-strict -2 -f lavfi -i aevalsrc\u003d0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4"
As the camera do not answer when the Thing try to initialize:
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.
I set the SNAPSHOT_URL_OVERRIDE: /onvif/
Although I now the camera will not answer.
What works well:
- It works the Pan and tilt. Great!!
21:33:33.096 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Trying to move with new PTZ Absolute move.
21:33:33.183 [DEBUG] [hab.binding.ipcamera.onvif.PTZRequest] - We got an ONVIF ptz response:<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:ter="http://www.onvif.org/ver10/error" ><s:Body><tptz:AbsoluteMoveResponse /></s:Body></s:Envelope>
- Doesn’t work Image Update functionality
As it understands that the camera has snapshot functionality, this is the result:
21:36:01.438 [TRACE] [ding.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.20/onvif/
But as I said, the camera doesn’t have this feature, so it will not answer.
Is there a way to configure the Thing with the same behaviour that the Type ID HTTPONLY, I mean, to use ffmpeg to achieve the rtsp thread and send the snapshot to the web server, similar to this command?
18:34:23.812 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -threads 1 -skip_frame nokey -i rtsp://admin:xxxxxxxx@192.168.0.20:8554/profile0 -an -vsync vfr -update 1 http://127.0.0.1:50011/snapshot.jpg
- Create animated gif, works well, this is the command in log file:
21:49:00.788 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -y -t 8 -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -r 2 -filter_complex scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse C:\cameratmpfs\camera1\ipcamera.gif
- Motion Alarm doesn’t work: the command has a mistake
This is the command that create, and it has an error
21:50:39.091 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -an -vf select='gte(scene,0.0013)',metadata=printnull -f null –
The correct one should be: metadata=print -f null –
So the result is this:
21:50:42.264 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Error reinitializing filters!
21:50:42.264 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Failed to inject frame into filter network: Invalid argument
21:50:42.264 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Error while processing the decoded data for stream #0:0
21:50:42.264 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Conversion failed!
There is some way to solve this?
- Audio Alarm: doesn’t work
This is the command that create, an it has an error
21:55:35.884 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:C:\Program Files\ffmpeg-4.2.2-win64-static\bin\ffmpeg.exe -rtsp_transport tcp -i rtsp://admin:xxxxxxx@192.168.0.20:8554/profile0 -af silencedetect=n=-12dB:d=2 -vnnull -f null –
So the result is:
21:55:35.982 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Unrecognized option 'vnnull'.
21:55:35.983 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Error splitting the argument list: Option not found
There is some way to solve this?
Sorry for the message so long but I understand that in this way you will understand better my questions.
I appreciate the help you could give me.