IP camera live stream tutorial for beginners?

The idea is to get an IP camera stream to the Basic UI and to the app.

Having gone through numerous links with plenty of information, the basic concept of transferring video streams to the Openhab UI still evades me. Maybe I lack a little grey matter or it’s my limited experience but it would be great if someone could point me at what I’ve missed or maybe a send me a link to a step-by-step tutorial for absolute beginners.

My setup:

Settings:

  • In Things I created ONVIF camera
  • ip: 192.168.20.204
  • http port: 80
  • onvif port: 8899
  • server port: 4001
  • ip whitelist: disable

.items

String MjpegStreamUrl "Mjpeg Stream" { channel="ipcamera:ONVIF:6fcea22c:streamUrl" }
String HlsStreamUrl "HLS Stream" { channel="ipcamera:ONVIF:6fcea22c:hlsUrl" }
String RTSPStreamUrl "RTSP Stream" { channel="ipcamera:ONVIF:6fcea22c:rtspUrl" }

.sitemap

sitemap sweat label="Some day" {

    Frame label="Streams hopefully" {
        
        Text label="Mjpeg Stream" icon="camera"{Video url="http://192.168.20.60:4001/ipcamera.mjpeg" encoding="mjpeg"}

        Text label="HLS Stream" icon="camera"{Webview url="http://192.168.20.60:4001/ipcamera.m3u8" height=15}
    }
}

192.168.20.60 = openhab

What do the logs say in debug and trace mode? Readme for binding tells u how to do this with the logs.

Debug:

2020-02-09 06:08:38.274 [DEBUG] [pcamera.internal.StreamServerHandler] - Stream Server recieved request 	GET:/ipcamera.mjpeg
2020-02-09 06:08:38.280 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:/usr/bin/ffmpeg -rtsp_transport tcp -i rtsp://192.168.20.204:554/user=admin_password=tlJwpbo6_channel=1_stream=1.sdp?real_stream -qscale:v 5 -r 6 -update 1 http://127.0.0.1:4001/ipcamera.jpg
2020-02-09 06:08:38.288 [ERROR] [hab.binding.ipcamera.internal.Ffmpeg] - java.io.IOException: Cannot run program "/usr/bin/ffmpeg": error=2, No such file or directory
...
2020-02-09 06:08:44.427 [DEBUG] [pcamera.internal.StreamServerHandler] - Stream Server recieved request 	GET:/ipcamera.mjpeg
2020-02-09 06:08:44.582 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.20.204http://192.168.20.204/webcapture.jpg?command=snap&channel=1
...
2020-02-09 06:08:59.098 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.20.204:8899
2020-02-09 06:08:59.100 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.20.204http://192.168.20.204/webcapture.jpg?command=snap&channel=1
2020-02-09 06:08:59.105 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler of thing ipcamera:ONVIF:6fcea22c tried updating channel imageUrl although the handler was already disposed.
2020-02-09 06:08:59.107 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler of thing ipcamera:ONVIF:6fcea22c tried updating channel rtspUrl although the handler was already disposed.
2020-02-09 06:08:59.109 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Possible NIC/IP match found:192.168.20.60
2020-02-09 06:08:59.115 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.20.204 has started on port 4005 for all NIC's.
2020-02-09 06:08:59.118 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler of thing ipcamera:ONVIF:6fcea22c tried updating channel streamUrl although the handler was already disposed.
2020-02-09 06:08:59.120 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler of thing ipcamera:ONVIF:6fcea22c tried updating channel hlsUrl although the handler was already disposed.
2020-02-09 06:08:59.122 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler of thing ipcamera:ONVIF:6fcea22c tried updating channel imageUrl although the handler was already disposed.
2020-02-09 06:08:59.123 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler IpCameraHandler tried updating the thing status although the handler was already disposed.
2020-02-09 06:08:59.125 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.20.204http://192.168.20.204/webcapture.jpg?command=snap&channel=1
2020-02-09 06:08:59.125 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.20.204 is now online.
2020-02-09 06:08:59.155 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - We sucessfully connected to a ONVIF SERVICE:be.teletask.onvif.models.OnvifServices@1441cc4
2020-02-09 06:08:59.156 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profiles this camera supports.
2020-02-09 06:08:59.272 [DEBUG] [ab.binding.ipcamera.onvif.PTZRequest] - We got an ONVIF ptz response:<?xml version="1.0" encoding="UTF-8"?>
...

I’m a little swamped with the info in trace logs. Please specify which data would be relevant here.

Top section of the debug mentions missing ffmpeg directory. Is this my hitch? If yes, installing it requires 700Mb of disk space and how would it affect the performance of raspberry pi?

Not sure what caused that but it is easily
Fixed by overriding the snapshot URL.

Yes you need ffmpeg that is why it is in the steps of the readme of how to get HLS working.

If your camera does not have mjpeg then yes once again u need ffmpeg for that too.