How to view a video from an ONVIF camera

I know this has been covered in other posts but I think I am following the instructions and cannot get a video feed.

Running Openhab 5.2.0 in Ubuntu

I have a sonoff IP camera. The IP Camera Binding detects the camera and I can create a thing. here is the code

version: 1
things:
  ipcamera:onvif:FR_Camera:
    label: FR Camera
    config:
      updateImageWhen: "0"
      mjpegUrl: rtsp://user:password@192.168.0.xxx:554/av_stream/ch0
      ffmpegLocation: /usr/bin/ffmpeg
      hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4
      gifOutOptions: "-r 2 -filter_complex scale=480:-2:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen=max_colors=128:stats_mode=diff[p];[o2][p]paletteuse=dither=bayer:bayer_scale=3"
      mp4OutOptions: -c:v copy -c:a copy
      mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
      snapshotOptions: -an -vsync vfr -q:v 2 -update 1
      ipAddress: 192.168.0.107
      port: 80
      username: sonoff
      password: 60wgmw17
      onvifPort: 80
      onvifMediaProfile: 0
      onvifEventServiceType: 0
      ipWhitelist: DISABLE
      pollTime: 1000
      ptzContinuous: false
      gifPreroll: 0
    channels:
      startStream:
        type: startStream
      pollImage:
        type: pollImage
      createSnapshots:
        type: createSnapshots
      image:
        type: image
      recordingGif:
        type: recordingGif
      gifHistory:
        type: gifHistory
      gifHistoryLength:
        type: gifHistoryLength
      recordingMp4:
        type: recordingMp4
      mp4History:
        type: mp4History
      mp4HistoryLength:
        type: mp4HistoryLength
      lastMotionType:
        type: lastMotionType
      ffmpegMotionControl:
        type: ffmpegMotionControl
      ffmpegMotionAlarm:
        type: ffmpegMotionAlarm
      thresholdAudioAlarm:
        type: thresholdAudioAlarm
      audioAlarm:
        type: audioAlarm
      externalMotion:
        type: externalMotion
      motionAlarm:
        type: motionAlarm
      cellMotionAlarm:
        type: cellMotionAlarm
      lineCrossingAlarm:
        type: lineCrossingAlarm
      fieldDetectionAlarm:
        type: fieldDetectionAlarm
      faceDetected:
        type: faceDetected
      parkingAlarm:
        type: parkingAlarm
      itemLeft:
        type: itemLeft
      itemTaken:
        type: itemTaken
      tamperAlarm:
        type: tamperAlarm
      tooDarkAlarm:
        type: tooDarkAlarm
      storageAlarm:
        type: storageAlarm
      sceneChangeAlarm:
        type: sceneChangeAlarm
      tooBrightAlarm:
        type: tooBrightAlarm
      humanAlarm:
        type: humanAlarm
      animalAlarm:
        type: animalAlarm
      carAlarm:
        type: carAlarm
      tooBlurryAlarm:
        type: tooBlurryAlarm
      pan:
        type: pan
      tilt:
        type: tilt
      zoom:
        type: zoom
      gotoPreset:
        type: gotoPreset
      mjpegUrl:
        type: mjpegUrl
      rtspUrl:
        type: rtspUrl
      imageUrl:
        type: imageUrl
      hlsUrl:
        type: hlsUrl

The mjpegUrl works in VLC

I then create an item linked to channel MJPEGURL ipcamera:onvif:FR_Camera:mjpegUrl

version: 1
items:
  FR_Camera:
    type: String
    label: FR Camera
    icon: Camera
    tags:
      - Point

I add this item to a sitemap

          - type: Video
            item: FR_Camera
            label: Camera
            url: ""
            encoding: mjpeg

And this is what I get when I open the sitemap

What am I missing?

Thank you

The url is empty. You don’t need an item.

Textual sitemap config:

Text label="Video" icon="camera" {
Video url="http://192.168.2.212:8080/ipcamera/dahua2/ipcamera.mjpeg" encoding="mjpeg"
}

This is how it looks in the code tab of MainUI (which I don’t use and know nothing about) :

- type: Video
  url: http://192.168.2.212:8080/ipcamera/dahua2/ipcamera.mjpeg
  encoding: mjpeg

BTW, removing the password from your post would make sense.

Thank you. I thought the item had the URL information so we could use the item or add the url to the definition. I’ll try doing it the way you suggest.
I changed the actual user and password for the generic ones before posting to avoid giving the impression that the error came from not having the user and password in the url. But thank you for the warning.