I have deleted the previus Things (HTTPONLY and ONVIF)
I have created by textual config files Things and Items this are my files
ipcamera.things
Thing ipcamera:HTTPONLY:Neye3CHTTPONLY "Neye3CHTTPONLY" @ "Camaras"
[
IPADDRESS="192.168.0.20",
PASSWORD="XXXXXXX",
USERNAME="admin",
PORT=80,
POLL_CAMERA_MS=1000,
SERVER_PORT=50013,
UPDATE_IMAGE=false,
GIF_PREROLL=0,
GIF_POSTROLL=6,
//SNAPSHOT_URL_OVERRIDE="http://192.168.1.181/capture",
//STREAM_URL_OVERRIDE="http://192.168.0.20:80/stream",
FFMPEG_OUTPUT="c:\\cameratmpfs\\camera1\\",
FFMPEG_INPUT="rtsp://admin:XXXXXX@192.168.0.20:8554/profile0",
FFMPEG_LOCATION="C:\\Program Files\\ffmpeg-4.2.2-win64-static\\bin\\ffmpeg.exe",
IMAGE_UPDATE_EVENTS=1
]
ipcamera.items
// Neye3CHTTPONLY "Neye3CHTTPONLY" @ "Camaras"
Image Neye3CHTTPONLYImage "Snaphot" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:image" }
Dimmer Neye3CHTTPONLYMotionControl "Motion Threshold [%d]" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:controlMotionAlarm" }
Switch Neye3CHTTPONLYMotionAlarm "Motion detected" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:motionAlarm" }
Dimmer Neye3CHTTPONLYAudioThreshold "Audio Threshold [%d]" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:thresholdAudioAlarm" }
Switch Neye3CHTTPONLYAudioAlarm "Audio detected" (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:audioAlarm" }
Switch Neye3CHTTPONLYCreateGif "Create animated GIF" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:updateGif" }
String Neye3CHTTPONLYMjpegStreamUrl "Mjpeg Stream" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:streamUrl" }
String Neye3CHTTPONLYRTSPStreamUrl "RTSP Stream" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:rtspUrl" }
String Neye3CHTTPONLYHlsStreamUrl "HLS Stream" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:hlsUrl" }
String Neye3CHTTPONLYImageUrl "Image Url" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:imageUrl" }
Switch Neye3CHTTPONLYUpdateImageNow "Update Image Now" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:updateImageNow" }
String Neye3CHTTPONLYLastMotionType "Last Motion Type" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:lastMotionType" }
Switch Neye3CHTTPONLYStartHLS "Start HLS" <ipcamera> (Camaras) ["Camaras"] { channel="ipcamera:HTTPONLY:Neye3CHTTPONLY:startStream" }
I am analysing the first problem I had with widget Image at HABPanel and the refresh problem
I have the same result that I had with the previus configuration with PanelUI
The configuration of Image Widget
URL: http://192.168.0.165:50013/ipcamera.jpg
Update Interval: 4 sg
No cache utilization
What I can see at log file (Karaf):
Initialy I can see the image in the widget, this is the log:
17:51:52.378 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.jpg
17:51:52.389 [DEBUG] [ipcamera.internal.StreamServerHandler] - Closing a StreamServerHandler.
17:51:52.932 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - frame= 11 fps=0.1 q=24.8 size=N/A time=00:02:05.12 bitra
But 4 seconds later, this is the result:
17:51:56.382 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.jpg?_t=2020-04-19T15:51:56.369Z
17:51:56.391 [WARN ] [ipcamera.internal.StreamServerHandler] - Exception caught from stream server:{}
java.io.FileNotFoundException: c:\cameratmpfs\camera1\ipcamera.jpg?_t=2020-04-19T15:51:56.369Z (El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos)
at java.io.RandomAccessFile.open0(Native Method) ~[?:1.8.0_181]
at java.io.RandomAccessFile.open(Unknown Source) ~[?:1.8.0_181]
at java.io.RandomAccessFile.<init>(Unknown Source) ~[?:1.8.0_181]
My questions are:
- Why the request after the first one has this other format?
GET:/ipcamera.jpg?_t=2020-04-19T15:51:56.369Z
What does it means? Is it requesting the ipcarmera.jpg with a timestamp update?
I am at Spain TimeZone, as you can see in the log when arrives the request, the local hour is 17:51:56.382
I suppose the request is UTC time.
-
Why the server try to find the image at file system and not in the RAM as it does the first time?
-
My I change in same way this behaviour?
Regarding the topic:
With textual config the problem is solved, now the command is created correctly:
19:34:38.280 [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.0012)',metadata=print -f null -
and it work correctly.
Even the Audio Alarm works well.
19:45:27.435 [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=-17dB:d=2 -vn -f null -
Thanks @matt1 for the suggestion.
I appreciate any help you could give me regarding the snapshop update problem.