blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.21k stars 1.76k forks source link

[Support]: Event playback in 0.10.x freezes and buffers #2497

Closed jasonpstokes closed 2 years ago

jasonpstokes commented 2 years ago

Describe the problem you are having

Event playback freezes and buffers in 0.9 and 0.10, at the same timecode (spot) every time I play the clip. I'm seeing this on many/most clips whereas the downloaded clip plays perfectly. Happens on all (6) cameras.

Playback was fluent and never buffered in 0.8.4 (over 6+ months), running same recommended FFMpeg arguments as per docs. Experienced same playback issues in 0.9, when running that for a few days.

e.g.

rlc-520a-main_stream

Version

0.10.0-DB1255A

Frigate config file

database:
  path: /media/frigate/database/frigate.db

detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: 192.168.1.5
  port: 1883
  user: mqtt
  password: "{FRIGATE_MQTT_PASSWORD}"

birdseye:
  mode: continuous
  width: 1792
  height: 1344

detect:
  width: 896
  height: 672
  fps: 5

ffmpeg:
  hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
  input_args: -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 # https://github.com/blakeblackshear/frigate/issues/1713#issuecomment-932976305
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy

live:
  height: 672
  quality: 12

motion:
  mask:
    - 265,650,265,625,630,625,630,650

record:
  enabled: True
  retain:
    days: 0
  events:
    retain:
      default: 14
      mode: active_objects

rtmp:
  enabled: False

snapshots:
  enabled: true
  clean_copy: false
  bounding_box: true
  retain:
    default: 14

timestamp_style:
  format: "%d/%m/%Y %H:%M:%S"

cameras:
  Driveway:
    ffmpeg:
      inputs:
        - path: http://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - vehicle
        - dog
      filters:
        dog:
          max_area: 30000
        person:
          mask: 
            - 510,120,540,120,540,160,510,160

  Entrance:
    ffmpeg:
      inputs:
        - path: http://192.168.1.72/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.72/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          mask: 72,449,106,568,209,569,214,449

  Rumpus:
    ffmpeg:
      inputs:
        - path: http://192.168.1.73/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.73/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - dog

  Deck:
    ffmpeg:
      inputs:
        - path: http://192.168.1.74/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.74/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person

  Laundry:
    ffmpeg:
      inputs:
        - path: http://192.168.1.75/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.75/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person

  Balcony:
    ffmpeg:
      inputs:
        - path: http://192.168.1.76/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - detect
        - path: http://192.168.1.76/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
          roles:
            - record
    objects:
      track:
        - person
        - vehicle

Relevant log output

no warnings or errors in logs

FFprobe output from your camera

**RTSP stream, which I don't use.

ffprobe version 4.4-full_build-www.gyan.dev Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 6 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 7 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 9 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 4 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 6 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 7 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 5 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 9 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[h264 @ 00000223019f6100] left block unavailable for requested intra4x4 mode -1
[h264 @ 00000223019f6100] error while decoding MB 0 98, bytestream 75495
[h264 @ 00000223019f6100] concealing 3569 DC, 3569 AC, 3569 MV errors in I frame
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 7 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 7 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 10 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 8 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[h264 @ 00000223019f6100] concealing 18267 DC, 18267 AC, 18267 MV errors in P frame
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 7 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[h264 @ 00000223019f6100] concealing 15891 DC, 15891 AC, 15891 MV errors in P frame
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 5 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 4 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 6 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 5 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 2 packets
[h264 @ 00000223019f6100] concealing 18386 DC, 18386 AC, 18386 MV errors in P frame
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 4 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 15 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 14 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 3 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
[h264 @ 00000223019f6100] concealing 10311 DC, 10311 AC, 10311 MV errors in P frame
[rtsp @ 00000223019da980] max delay reached. need to consume packet
[rtsp @ 00000223019da980] RTP: missed 1 packets
Input #0, rtsp, from 'rtsp://user:pass@192.168.1.71:554//h264Preview_01_main':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_main
  Duration: N/A, start: 0.000500, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 2560x1920, 30 fps, 30 tbr, 90k tbn, 180k tbc
  Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Frigate stats

{"Balcony":{"camera_fps":5.1,"capture_pid":266,"detection_fps":5.5,"pid":234,"process_fps":5.0,"skipped_fps":0.0},"Deck":{"camera_fps":5.0,"capture_pid":249,"detection_fps":0.0,"pid":231,"process_fps":5.0,"skipped_fps":0.0},"Driveway":{"camera_fps":5.0,"capture_pid":236,"detection_fps":4.0,"pid":224,"process_fps":5.0,"skipped_fps":0.0},"Entrance":{"camera_fps":5.1,"capture_pid":240,"detection_fps":0.0,"pid":228,"process_fps":5.1,"skipped_fps":0.0},"Laundry":{"camera_fps":5.1,"capture_pid":257,"detection_fps":1.2,"pid":233,"process_fps":5.1,"skipped_fps":0.0},"Rumpus":{"camera_fps":5.1,"capture_pid":243,"detection_fps":0.0,"pid":230,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":10.7,"detectors":{"coral":{"detection_start":0.0,"inference_speed":13.59,"pid":218}},"service":{"storage":{"/dev/shm":{"free":59.0,"mount_type":"tmpfs","total":67.1,"used":8.1},"/media/frigate/clips":{"free":1723469.8,"mount_type":"nfs4","total":1921292.6,"used":197286.0},"/media/frigate/recordings":{"free":1723469.8,"mount_type":"nfs4","total":1921292.6,"used":197286.0},"/tmp/cache":{"free":810.3,"mount_type":"tmpfs","total":1073.7,"used":263.5}},"temperatures":{},"uptime":34626,"version":"0.10.0-db1255a"}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Reolink RLC-520A

Any other information that may be helpful

No response

MrAnonymous722 commented 2 years ago

I definitely think I have noticed this a lot more with recent versions, even with my recording and viewing devices on a gigabit local connection.

blakeblackshear commented 2 years ago

Me too. I'm fairly certain it's the VOD module analyzing and caching some info about the segments.

mr6880 commented 2 years ago

Definitely an issue, can be a little embarrassing at times.

jacobhallgren commented 2 years ago

Same problem here.

Trakkasure commented 2 years ago

Has there been any progress on this? I have the latest bets (0.11) and still see buffering and frame skipping on playback. I'm running this on a dedicated proxmox system with TruNAS storage over an NFS share. I verified that the network was not a bottleneck.

totalitarian commented 2 years ago

Same here, find it very difficult to playback events without freezing / buffering

mannish-kumar commented 2 years ago

Even I am seeing the same issue. Even after downloading and playing on PC same issue is seen. The issue would be while recording I believe.

NickM-27 commented 2 years ago

Even I am seeing the same issue. Even after downloading and playing on PC same issue is seen. The issue would be while recording I believe.

That means you're not seeing the same issue, since it's been confirmed to just be during playback by many users. I'd recommend making your own issue

NickM-27 commented 2 years ago

This particular issue has been fixed in 0.11 RC2

mannish-kumar commented 2 years ago

This particular issue has been fixed in 0.11 RC2

Thank You! I have updated my Frigate installation to 0.11 RC3 and I haven't seen the issue so far.

NickM-27 commented 2 years ago

0.11 is now fully released, this should be fixed now 👍