Hi, I have 8 ip cameras, 5 are supporting Onvif and are actually working well, some via RTSP and some in HTTP (the older two).
3 cameras are not Onvif, and I have defined them as generic. I can reach them in RTSP and view them with mjpegUrl: ffmpeg.
The problem is the snapshot: those cameras do not provide snapshots, and it looks impossible to get via ffmpeg. I do not need snapshots, but OH starts two ffmpeg processes, one for stream and one for snapshot. The snapshot process does not terminate and remains running:
I tried to put a dummy value in
snapshotUrl: http://0.0.0.0
but it gives communication error.
The strange fact is that if I launch ffmpeg by hand to get the snapshot, it works:
If you navigate to the Thing’s page and toggle “show advanced” near the top right you’ll see a field where you can set the ffmpeg command line arguments for snapshots.
Rick, you are my mentor! I know those fields very well. There are fields several controlling the ffmpeg output, both from MJPEG and for Snapshot, but the one that I need to override is “FFmpeg Input Options”. This one sets the parameters for ffmpeg BEFORE the -i rtsp:… parameter.
ffmpegInputOptions
Allows you to specify any options before the -i on the commands for FFmpeg. If you have an ESP32 camera that only has a mjpeg stream then make this equal -f mjpeg.
Unfortunatly the defaults are always set for generic rtsp cameras, and the default in the binding is
-rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner
while I need
-rtsp_transport tcp -threads 1 -hide_banner to have ffmpeg running.
Sending ffmpeg manually it only works without -skip_frame nokey
then I think the only solution is to file an issue and hope the binding author can add the ability to change those parameters too. There is no way I can think of to change those short of changing the code to the binding.
I’m exploring several ways to update my home. I think I’ll move to HomeAssistant for domotics and to ZoneMinder NVR for webcams. RTSP inside Openhab is really too heavy so I think that moving the RTSP managing to another virtual machine with more power would help OH to survive. In the smae time, I’m learning Home Assistant … so many things to learn for a retired man!
I think most people use a special purpose CCTV system for cameras like ZoneMinder, Shinobi, Frigate, etc. for managing cameras. These systems can work with OH/HA etc but will likely have way more options and be easier to set up since they are special purpose for the task.
Not currently possible but would be easy to change this. The -skip_frame nokey lowers CPU load greatly by skipping frames that are not full keyframe/iframes that contain a full picture.
If you do not want a snapshot you could always give it a valid URL that returns a 200 OK http code. Have not tried it but it should work by pointing it to the cameras login page for example. The IP is stripped out of the URL so you can not point it to a different cameras jpg.