Camera Image Problem BASICUI

Hi,

I am using 4 different types of camera but only one is making trouble. This Reolink E1 Pro is supporting ONVIF and RTSP but no HTTP.

So its not directly possible to connect to a website to get a snapshot. I have another instance of AgentDVR running were all 4 cameras are collected and showed without issues.

I am using the HTTP stream to connect to the E1 Pro which is working inside my network without issues. I used this streaming link from AgentDVR http://:8090/grab.jpg?oid=3&size=1280x720 to setup a generic ipcamera topic. Within this topic after activating the switch for updating the Image item the item is updated and can showed in basic ui aswell. But only if I switch it on and off again. I can follow directly the updating if I use the switch to on but then basicui can’t handle it and the page is in a refresh loop.

In the thing there is an image url which points to the Openhab server but If I open up this link I only get an error openhab page but no image.

From my other camera which is configured in Openhab with the same ipcamera binding the Image URL is working and I use this for showing the image in basic ui.

I also tried the link from my AgentDVR in basic ui which is working but only in my internal network and not over mobile network.

Is there anyone who has a hint for me how to solve this?

There really isn’t enough here to pinpoint the specific problem but I can show how I configured my cameras.

  1. Install the IPCamera binding
  2. Create and configure the Thing. Here is one of mine. I don’t have extensive experience with the bindings and different types of cameras. This one is an RTSP stream.
UID: ipcamera:generic:garage_camera
label: Garage Wyze Camera
thingTypeUID: ipcamera:generic
configuration:
  mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
  ipAddress: 10.10.1.112
  mjpegUrl: ffmpeg
  updateImageWhen: "0"
  gifPreroll: 0
  ffmpegLocation: /usr/bin/ffmpeg
  ipWhitelist: DISABLE
  mp4OutOptions: -c:v copy -c:a copy
  pollTime: 1000
  password: password
  port: 8888
  snapshotUrl: ffmpeg
  snapshotOptions: -an -vsync vfr -q:v 2 -update 1
  ffmpegInput: rtsp://user:password@argus.koshak.lan:8554/garage
  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: rlkoshak@gmail.com
location: Garage
channels:
  - id: startStream

I’m not showing the Channels becuase I didn’t make any changes there.

  1. The next steps depends on what you want to show on the UI. I’m OK with images with a one second refresh so that’s what I configured. Link a String Item to the Image URL Channel.
  2. That’s going to give you a URL that only works when you are on the LAN though. The front part of the URL needs to be stripped off to become a relative URL which will work locally and remotely. On the Link apply an ECMA Script and in the “Thing to Item Transformation” put | input.substring(input.indexOf('/', 8)+1).
  3. I use MainUI so I can’t speak specifically to BasicUI. I imagine you’d just use an Image element pointing at the Item. In MainUI I use an Image card.
                - component: oh-image-card
                  config:
                    refreshInterval: 3000
                    style:
                      height: auto
                      width: 100%
                    url: '=(items.GarageCamera_Status.state === "ON") ?
                      items.GarageWyzeCamera_ImageURL.state :
                      "/static/garage.jpg"'

This is an example UI Widget config where I use the Item.

oh man you made my day. The clue was just to add “ffmpeg” for the snapshotURL. Because I have a working RTSP URL my thing instantly switched to online.

PTZ commands are also working and in this thing I used the item for the snapshow URL and added it to my basic ui and suprise –> this is working internally and also externally from my network. Very nice. Thanks!