blakeblackshear / frigate

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

[Support]: Recordings reporting more length by hour than the real length #9335

Closed sgrossiP closed 7 months ago

sgrossiP commented 7 months ago

Describe the problem you are having

Hello everyone, how is it going? LOVING FRIGATE MORE EACH DAY HERE

I'm having an issue with my recordings. In cases where the video should be at least 3600 seconds the frigate ui reports more than expected. i know the segment time is used in ffmpeg is 10s but that gives me a maximum error of 20s in extreme cases where the segmentation cannot be exact

see the image below and you will notice that the video length is 1:00:46

https://drive.google.com/file/d/1X5iFMhtUnn6d_AOu6TsO3veC3usKeaTc/view?usp=sharing

that is happening with all my cameras and here it is an example of the camera's configuration and model https://drive.google.com/file/d/1wqGLV733Mf8FUU35QYFq8tvHo2KSyGOq/view?usp=sharing https://drive.google.com/file/d/11npwxDt8drR1ew2T3NSEJHg5O-ZOOkMP/view?usp=sharing

Version

0.12.1

Frigate config file

mqtt:
  host: 192.168.0.28
  user: publico
  password: 12sgrossi34
record:
  enabled: True
  retain_days: 3
  events:
    retain:
      default: 3

snapshots:
  enabled: True
  bounding_box: True
  crop: false
  retain:
    default: 3
cameras:
  bahiauno:
    ffmpeg:
      input_args: preset-rtsp-restream
      output_args:
          record: preset-record-generic-audio-aac-5s
      inputs:
        - path: rtsp://publico:12sgrossi34@192.168.1.145:33162/cam/realmonitor?channel=1&subtype=0
          roles:
            - rtmp
            - record
      hwaccel_args: preset-vaapi
    rtmp:
      enabled: False
    detect:
        enabled: False
  bahiados:
      ffmpeg:
        input_args: preset-rtsp-restream
        output_args:
          record: preset-record-generic-audio-aac
        inputs:
          - path: rtsp://publico:12sgrossi34@192.168.1.145:666/cam/realmonitor?channel=1&subtype=0
            roles:
              - rtmp
              - record
        hwaccel_args: preset-vaapi
      rtmp:
        enabled: False
      detect:
        enabled: False
  bosqueuno:
      ffmpeg:
        input_args: preset-rtsp-restream
        output_args:
          record: preset-record-generic-audio-aac-5s
        inputs:
          - path: rtsp://admin:12publico34@192.168.1.145:554/cam/realmonitor?channel=1&subtype=0
            roles:
              - rtmp
              - record
        hwaccel_args: preset-vaapi
      rtmp:
        enabled: False
      detect:
        enabled: False

Relevant log output

no relevant output

FFprobe output from your camera

Stream 0:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 1920x1080
FPS: 25/1

Audio:

Codec: PCM mu-law / G.711 mu-law

Frigate stats

{"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.5"},"1":{"cpu":"0.0","mem":"0.0"},"103":{"cpu":"1.0","mem":"0.6"},"104":{"cpu":"0.0","mem":"0.0"},"119":{"cpu":"0.0","mem":"0.0"},"134":{"cpu":"0.0","mem":"0.2"},"135":{"cpu":"0.0","mem":"0.0"},"136":{"cpu":"0.0","mem":"0.2"},"137":{"cpu":"0.0","mem":"0.1"},"146":{"cpu":"0.0","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"165":{"cpu":"0.0","mem":"0.1"},"17":{"cpu":"0.0","mem":"0.0"},"182":{"cpu":"0.0","mem":"0.1"},"18734":{"cpu":"0.0","mem":"0.0"},"18762":{"cpu":"0.0","mem":"0.0"},"18764":{"cpu":"0.0","mem":"0.0"},"199":{"cpu":"0.0","mem":"0.1"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"29":{"cpu":"0.0","mem":"0.0"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"426":{"cpu":"0.0","mem":"0.2"},"432":{"cpu":"0.0","mem":"0.0"},"433":{"cpu":"0.3","mem":"0.3"},"435":{"cpu":"0.7","mem":"0.3"},"438":{"cpu":"0.3","mem":"0.3"},"439":{"cpu":"0.0","mem":"0.1"},"440":{"cpu":"0.3","mem":"0.3"},"441":{"cpu":"0.3","mem":"0.3"},"442":{"cpu":"1.0","mem":"0.3"},"443":{"cpu":"0.0","mem":"0.1"},"446":{"cpu":"0.7","mem":"0.3"},"449":{"cpu":"0.7","mem":"0.3"},"451":{"cpu":"3.3","mem":"0.3"},"454":{"cpu":"4.3","mem":"0.3"},"457":{"cpu":"3.7","mem":"0.3"},"459":{"cpu":"0.0","mem":"0.1"},"460":{"cpu":"0.0","mem":"0.1"},"78":{"cpu":"0.0","mem":"0.0"},"79":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"86":{"cpu":"0.0","mem":"0.1"},"MiB":{"cpu":"15989.2","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"average:","mem":"1.85,"}},"detection_fps":0.0,"detectors":{"cpu":{"detection_start":0.0,"inference_speed":10.0,"pid":433}},"gpu_usages":{"intel-vaapi":{"gpu":"22.18 %","mem":"- %"}},"service":{"last_updated":1696017265,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":62.2,"mount_type":"tmpfs","total":67.1,"used":4.9},"/media/frigate/clips":{"free":867714.4,"mount_type":"fuseblk","total":1000203.1,"used":132488.7},"/media/frigate/recordings":{"free":867714.4,"mount_type":"fuseblk","total":1000203.1,"used":132488.7},"/tmp/cache":{"free":992.0,"mount_type":"tmpfs","total":1000.0,"used":8.0}},"temperatures":{},"uptime":18745,"version":"0.12.1-367d724"},"sinaudio":{"camera_fps":5.0,"capture_pid":449,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":454,"pid":441,"process_fps":5.0,"skipped_fps":0.0},"test":{"camera_fps":5.0,"capture_pid":446,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":451,"pid":440,"process_fps":5.0,"skipped_fps":0.0},"testdos":{"camera_fps":5.1,"capture_pid":442,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":457,"pid":438,"process_fps":5.1,"skipped_fps":0.0}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

hikvision DS-2CV1021G0-IDW1

Any other information that may be helpful

No response

NickM-27 commented 7 months ago

The recordings segments have to end and begin on key frames. So if your iframe times are longer that can lead to segments that are longer than 10 seconds.

sgrossiP commented 7 months ago

i forgot to add that osd camera says the recording started at 18:59:56 and finished at 19:59:59

sgrossiP commented 7 months ago

The recordings segments have to end and begin on key frames. So if your iframe times are longer that can lead to segments that are longer than 10 seconds.

hello nick, i m not fully understanding how that can lengthen the video 40 seconds extra

NickM-27 commented 7 months ago

i forgot to add that osd camera says the recording started at 18:59:56 and finished at 19:59:59

if that's the case then it means the player is not getting a perfectly accurate calculation for the video length, is this causing any actual issues or just something that was noticed?

sgrossiP commented 7 months ago

not causing any issues only displaying the wrong duration but trying to fix it and see if i am useful to this project so maybe i can push some code someday if that is the case i am closing this one :) regards

sgrossiP commented 7 months ago

adding more info to study the case cameras with no audio reports the correct length in videojs and vlc