Frigate - delay and errors

Running HA/Frigate/DP/CF/Double-take on containers ,
Intercom Dahua 2mp - set to H264 720P
Salon Camera - Dahua 4mp H264 1080P

On frigate:
would appriciate good advice improving my config file - especially improving the lag
and remove error ,
second ,Is there an option for live view?
even in debug view - there’s huge delay and video is very slow

after few min i see in frigate logs below errors:

[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [swscaler @ 0x55e9e03e4540] [swscaler @ 0x55e9e041d880] deprecated pixel format used, make sure you did set range correctly
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [swscaler @ 0x55e9e0441300] [swscaler @ 0x55e9e03e4540] deprecated pixel format used, make sure you did set range correctly
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [swscaler @ 0x55e9e0441300] [swscaler @ 0x55e9e03f1500] deprecated pixel format used, make sure you did set range correctly
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [swscaler @ 0x55e9e0441300] [swscaler @ 0x55e9e041f540] deprecated pixel format used, make sure you did set range correctly
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 9 expected, 7 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 10 expected, 8 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [h264 @ 0x55e9e0023a80] Increasing reorder buffer to 1
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 11 expected, 9 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 11 expected, 10 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 12 expected, 11 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 14 expected, 12 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 17 expected, 13 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 20 expected, 14 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 21 expected, 15 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 21 expected, 16 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 24 expected, 17 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : More than 1000 frames duplicated
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 31 expected, 18 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 32 expected, 19 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [h264 @ 0x55e9dff80940] Increasing reorder buffer to 10
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 32 expected, 20 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 33 expected, 21 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [rtsp @ 0x55e9dff6abc0] CSeq 35 expected, 22 received.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [flv @ 0x55e9dff82fc0] Failed to update header with correct duration.
[2022-11-22 11:54:52] ffmpeg.intercom.detect         ERROR   : [flv @ 0x55e9dff82fc0] Failed to update header with correct filesize.
[2022-11-22 12:03:18] frigate.video                  ERROR   : intercom: Unable to read frames from ffmpeg process.


frigate.yaml

mqtt:
  host: 192.168.1.113
  port: 1883

cameras:
  intercom:
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
    ffmpeg:
      inputs:
         - path:  rtsp://yyyyy:[email protected]:554/cam/realmonitor?channel=1&subtype=0
           roles:
            - detect
            - rtmp            
    detect:
      height: 720
      width: 1280
      fps: 5
    zones:
      zone_intercom:
        coordinates: 521,40,1170,49,1158,720,525,720
    snapshots:
      enabled: True
      timestamp: True
      retain:
        # Required: Default retention days (default: shown below)
        default: 3

  salon2:
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      # quality: 100
      # height: 500  
    ffmpeg:
      inputs:
         - path:  rtsp://yyyy:[email protected]/cam/realmonitor?channel=1&subtype=0
           roles:
            - detect           
    detect:
      height: 720
      width: 1280
      fps: 5      
    zones:
      zone_salon2:
        coordinates: 0,84,1130,85,1158,720,0,720
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      timestamp: True
      retain:
        # Required: Default retention days (default: shown below)
        default: 3

It looks like you’re using the main stream for detect, is the resolution of that stream actually 1280x720? Otherwise the stream is being resized to the size specified in detect -> height / width which can add delay and CPU overhead.

Either way, in the current version of frigate the live view will always have some delay as it is using the decoded frames. In 0.12 there will be new live view options using MSE and webRTC which offer 1 and < 1 seconds delay respectively.

@crzynik - yes , the resolution of the intercom camera is 720P, the other one is 1080P.
sorry not sure i understand ur suggestion - to remove the detect?

which part of my message are you referring to? if the resolutions are correct then it shouldn’t be an issue and the delay is likely what it is until the next version of frigate