blakeblackshear / frigate

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

[Support]: Recorded segments not 10 seconds long #2810

Closed TelepathicWalrus closed 2 years ago

TelepathicWalrus commented 2 years ago

Describe the problem you are having

Hi, The segments that are recorded seem to be less than 10 seconds long, this results an hours worth of recordings being around 59:15 seconds. Is this a problem with config or camera?

Thanks

Version

0.10.0-E5714F5

Frigate config file

mqtt:
    host: 192.168.1.3
    port: 1883
    user: mqtt-user
    password: xxxx

detectors:
  cpu1:
    type: cpu
    num_threads: 3
  cpu2:
    type: cpu
    num_threads: 3

ffmpeg:
  hwaccel_args:
    - -c:v
    - h264_cuvid

objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - cat
  filters:
    person:
      threshold: 0.85

record:
  enabled: True
  retain:
    days: 20
    mode: all

cameras:
  Garden_Side:
    ffmpeg:
      inputs:
        - path: rtsp://admin:xxxxx@192.168.1.5:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
            - rtmp
            - detect
    detect:
      width: 3840
      height: 2160
      fps: 5
    motion:
      mask:
        - 3840,568,3840,0,2851,0,2102,0,2611,90
        - 0,271,624,84,1322,0,0,0
        - 3840,652,3840,477,3668,430,3668,574
  Garden_Shed:
    ffmpeg:
      inputs:
        - path: rtsp://admin:xxxxxxx@192.168.1.4:554
          roles:
            - record
            - rtmp
            - detect
    detect:
      width: 3840
      height: 2160
      fps: 5
    motion:
      mask:
        - 3840,568,3840,0,2851,0,2102,0,2611,90
        - 0,271,624,84,1322,0,0,0
        - 3840,652,3840,477,3668,430,3668,574

Relevant log output

n/a

FFprobe output from your camera

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0x5620d1463f00] max delay reached. need to consume packet
[rtsp @ 0x5620d1463f00] RTP: missed 12 packets
[h264 @ 0x5620d1467dc0] error while decoding MB 70 95, bytestream -5
[h264 @ 0x5620d1467dc0] concealing 9819 DC, 9819 AC, 9819 MV errors in P frame
[rtsp @ 0x5620d1463f00] max delay reached. need to consume packet
[rtsp @ 0x5620d1463f00] RTP: missed 9 packets
[h264 @ 0x5620d1467dc0] error while decoding MB 58 103, bytestream -5
[h264 @ 0x5620d1467dc0] concealing 7911 DC, 7911 AC, 7911 MV errors in P frame
[rtsp @ 0x5620d1463f00] max delay reached. need to consume packet
[rtsp @ 0x5620d1463f00] RTP: missed 2 packets
Input #0, rtsp, from 'rtsp://admin:xxxxx@192.168.1.5:554':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.200000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 3840x2160, 100 tbr, 90k tbn, 180k tbc

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0x564255f69f00] max delay reached. need to consume packet
[rtsp @ 0x564255f69f00] RTP: missed 17 packets
[h264 @ 0x564255f6ddc0] error while decoding MB 62 78, bytestream -7
[h264 @ 0x564255f6ddc0] concealing 13907 DC, 13907 AC, 13907 MV errors in P frame
[rtsp @ 0x564255f69f00] max delay reached. need to consume packet
[rtsp @ 0x564255f69f00] RTP: missed 44 packets
[h264 @ 0x564255f6ddc0] error while decoding MB 48 97, bytestream -7
[h264 @ 0x564255f6ddc0] concealing 9361 DC, 9361 AC, 9361 MV errors in P frame
Input #0, rtsp, from 'rtsp://admin:xxxxx@192.168.1.4:554':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.200000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 3840x2160, 100 tbr, 90k tbn, 180k tbc

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Amcrest IP8M-2496EW-V2

Any other information that may be helpful

less than an hour

blakeblackshear commented 2 years ago

ffmpeg tries its best to create 10s segments, but it can only split on key frames (i-frames). It's not surprising that its not exactly 10s segments.

TelepathicWalrus commented 2 years ago

Ah okay fair enough, i assume this won't result in loss of footage?

blakeblackshear commented 2 years ago

If you see a loss of footage, it won't be because of the splits being not exactly 10s.

TelepathicWalrus commented 2 years ago

Is the 59:22 seconds of footage for an hour reasonable or do you reckon there is something else going on?

blakeblackshear commented 2 years ago

If any 10s segments were dropped, you would see messages in the logs about a corrupt recording segment being discarded.