Open J-N-K opened 1 year ago
From the readme:
pollImage | Switch | This control can be used to manually start and stop using your CPU to create snapshots from a RTSP source. If you have a snapshot URL setup in the binding, only then can this control can be used to update the Image channel.
I agree it is not 100% clear, and also a separate control should be created instead of sharing the switch if people want to do this.
1: A switch to start and stop the CPU load and network traffic of using a RTSP stream to create snapshots. 2: A switch to start and stop the image channel getting updated.
There was a memory leak of some kind occurring when an image item was updated a lot. Have not tested this in a very long time, probably before OH3 so it may be fine to update the image item once a second on a fast system, but it can flood the event bus with the raw image data and I have seen it choke a system up. Data gets sent to the event bus faster than it can get processed and logged etc...
UID: ipcamera:generic:95ee9d211a
label: RTSP/HTTP IP Camera
thingTypeUID: ipcamera:generic
configuration:
mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
ipAddress: 192.168.0.185
mjpegUrl: ffmpeg
updateImageWhen: "1"
gifPreroll: 0
ffmpegLocation: /opt/homebrew/bin/ffmpeg
ipWhitelist: DISABLE
mp4OutOptions: -c:v copy -c:a copy
pollTime: 30000
password: <....>
port: 80
snapshotUrl: ffmpeg
snapshotOptions: -an -vsync vfr -q:v 2 -update 1
ffmpegInput: rtsp://192.168.0.185:554/stream1
gifOutOptions: -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
hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy
-hls_flags delete_segments -hls_time 2 -hls_list_size 4
username: <....>
There is a snapshotUrl
configured, but that get's erased because it is ffmpeg
and then it is not working at all.
ffmpeg is not a URL that counts, it is a keyword that overrides normally for when a camera is ONVIF and the snapshot url is auto found by ONVIF methods. It allows me to test these features by entering in that keyword to force it to ignore the cameras auto found URL.
That's very unexpected: I configure something according to the documentation and it only works sometimes. Why does it make a difference if the image is provided by ffmpeg or the camera itself?
I agree, see my very first reply here.
@J-N-K are you still wanting this feature? I have cleaned up the other issues for the binding, so looking at this can be next if you're still wanting this. I looked and I could not find the reply from @kaikreuzer where he stated that it was not a good use case to update an image channel once a second with what can be a 2 megabyte or more image. From my testing I agree with this.
If someone is willing to assist in dealing with these issues, then I am happy to look into it further otherwise I was hoping to remove the image channel. I did remove it once and a user had a good use case for it so it went back in. I may even have limited it to only 1 update every 8 seconds for the two reasons above.
I agree with your thoughts completely that this is not good and needs to be addressed. I will need guidance on if there is a way to do this that is kind to the event bus and cloud.
STR:
image
andpollImage
channelupdateImageWhen
to1
("Update the Image channel only when the pollImage channel is turned on.")ON
topollImage
image
channel is not updatedOne of the reasons is that
updateImageChannel
is set tofalse
whenpollImage
is set toON
. But this alone does not fix it, at some point it just turns off again.