blakeblackshear / frigate

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

Some Recordings contain Glitches. Why? #7279

Closed Konrad9789 closed 1 year ago

Konrad9789 commented 1 year ago

Describe the problem you are having

Hello. Over the past few weeks I have worked on my Frigate NVR. I have been able to resolve most of my issues, except this one. Some of my recordings contain glitches as shown in the pictures. Screenshot 2023-07-24 124633

Version

3.9

Frigate config file

database:
  path: /db/frigate.db

mqtt:
  enabled: False

rtmp:
  enabled: False

detectors:
  cpu1:
    type: cpu
    num_threads: 8
    model:
      path: "/cpu_model.tflite"
cameras:
  sideg1: # <------ Name the camera
    ffmpeg:
      inputs:
        - path: rtsp://username:password@192.168.30.74:554/axis-media/media.amp?streamprofile=Detect&audio=0
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://username:password@192.168.30.17:8554/sideg1
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      enabled: True # <---- disable detection until you have a working camera feed
      width: 720 # <---- update for your camera's resolution
      height: 1280 # <---- update for your camera's resolution
    record:
      enabled: True
      retain:
        days: 28
        mode: all
#    motion:
  frontc1: # <------ Name the camera
    ffmpeg:
      inputs:
        - path: rtsp://username:password@192.168.30.17:8554/frontc1_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://username:password@192.168.30.17:8554/frontc1
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      enabled: True # <---- disable detection until you have a working camera feed
      width: 1920 # <---- update for your camera's resolution
      height: 1080 # <---- update for your camera's resolution
    record:
      enabled: True
      retain:
        days: 28
        mode: motion
  sidea1: # <------ Name the camera
    ffmpeg:
      inputs:
        - path: rtsp://username:password@192.168.30.17:8554/sidea1_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://username:password@192.168.30.17:8554/sidea1
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      enabled: True # <---- disable detection until you have a working camera feed
      width: 1080 # <---- update for your camera's resolution
      height: 1920 # <---- update for your camera's resolution
    record:
      enabled: True
      retain:
        days: 28
        mode: motion

Relevant log output

2023-07-24 02:10:29.120587050  [INFO] Starting Frigate...
2023-07-24 02:10:29.681022035  [2023-07-24 02:10:29] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-07-24 02:10:29.694616151  [2023-07-24 02:10:29] frigate.config                 WARNING : Customizing more than a detector model path is unsupported.
2023-07-24 02:10:29.700287682  [2023-07-24 02:10:29] peewee_migrate                 INFO    : Starting migrations
2023-07-24 02:10:29.702585600  [2023-07-24 02:10:29] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-24 02:10:29.708719480  [2023-07-24 02:10:29] detector.cpu1                  INFO    : Starting detection process: 575
2023-07-24 02:10:29.708925512  [2023-07-24 02:10:29] frigate.app                    INFO    : Output process started: 576
2023-07-24 02:10:29.710265207  [2023-07-24 02:10:29] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-24 02:10:29.711362414  [2023-07-24 02:10:29] frigate.app                    INFO    : Camera processor started for sideg1: 580
2023-07-24 02:10:29.713226897  [2023-07-24 02:10:29] frigate.app                    INFO    : Camera processor started for frontc1: 582
2023-07-24 02:10:29.715425221  [2023-07-24 02:10:29] frigate.app                    INFO    : Camera processor started for sidea1: 583
2023-07-24 02:10:29.717548116  [2023-07-24 02:10:29] frigate.app                    INFO    : Capture process started for sideg1: 585
2023-07-24 02:10:29.719911126  [2023-07-24 02:10:29] frigate.app                    INFO    : Capture process started for frontc1: 589
2023-07-24 02:10:29.722224688  [2023-07-24 02:10:29] frigate.app                    INFO    : Capture process started for sidea1: 592

FFprobe output from your camera

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"9:16","height":1280,"width":720}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"22/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"9:16","height":2688,"width":1512}]}}]

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":1080,"width":1920}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"30/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":2160,"width":3840}]}}]

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":1920,"width":1080}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"30/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":1920,"width":1080}]}}]

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Axis: AXIS M2036-LE Bullet Camera; Axis: AXIS P1468-LE Bullet Camera; Axis: AXIS P1465-LE Bullet Camera - 9mm

Any other information that may be helpful

Running Go2RTC In a separate docker container since running it within frigate was causing nothing but issues.

NickM-27 commented 1 year ago

Frigate copies the recordings directly from the source without re-encoding. So glitches like this are coming from the camera.

Running Go2RTC In a separate docker container since running it within frigate was causing nothing but issues.

Frigate supports updating the internal go2rtc, that would likely fix this.

Konrad9789 commented 1 year ago

I see. Is there a possibility it is the write speed of the storage media?

NickM-27 commented 1 year ago

No, write speed does not change the data that is being written. and if there was actual data corruption then the segmennt would not be playable

joaoferreira-git commented 1 year ago

Frigate copies the recordings directly from the source without re-encoding. So glitches like this are coming from the camera.

Running Go2RTC In a separate docker container since running it within frigate was causing nothing but issues.

Frigate supports updating the internal go2rtc, that would likely fix this.

Having the exact same problem and both live feeds don't show any sign of glicthes, only frigate, so its not a source problem. Following pics in either rtsp or rtmp mode:

image image

Found this issue from 2 years ago saying to use rtmp but its not working for some reason in frigate while it works in vlc.

Edit: Forgot to say, this has been happening since I installed the cameras 1 year ago and i always thought it was interference from powerline but for some reason the last couple of days 70 to 90% of the footage is just glitches, the glitches increased a lot and are even bigger covering almost the entire frame.

NickM-27 commented 1 year ago

Which live feed are you watching to say it isn't in the live feed?

You can't compare a camera's own live view to what frigate is receiving because the camera never sends it via rtsp / rtmp for internal use like it does for external services. I have a feeling you are using reolinks which this is a very common problem on reolinks and is well documented.

joaoferreira-git commented 1 year ago

Which live feed are you watching to say it isn't in the live feed?

You can't compare a camera's own live view to what frigate is receiving because the camera never sends it via rtsp / rtmp for internal use like it does for external services. I have a feeling you are using reolinks which this is a very common problem on reolinks and is well documented.

Well that was fast, the rtsp Link in VLC is the exact one in the frigate config, yes I'm using 2 Reolinks RLC-520A. I'm sorry but I'm not understanding the part about the frigate not receiving the live rstp like VLC. Could you please give me a link to the "documentation" of this problem since I was unable to find it and i just want to understand it better.

Bellow is the config used for the camera above aswell as the link used in frigate Thanks

Garagem:

  mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      quality: 100
      height: 1000
  ffmpeg:
   inputs:
    - path: rtsp://admin:pass@192.168.1.40:554//h265Preview_01_main
      roles:
      - record
      - detect   
  motion:
    mask:
      - 1920,369,1920,848,1876,830,1823,792,1776,765,1733,702,1737,604,1768,413,1778,375
  detect:
    enabled: True
    width: 1920
    height: 1080
    fps: 5
  record: # <----- Enable recording
    enabled: True
    retain:
      days: 20 
NickM-27 commented 1 year ago

Here's an example https://www.reddit.com/r/reolinkcam/comments/pu2o7x/why_are_the_films_coming_out_blotchy_and_with/

The recommended configuration for reolinks cameras is https://docs.frigate.video/configuration/camera_specific#reolink-cameras

joaoferreira-git commented 1 year ago

Thanks for the help, I will look into it, just managed to get the rtmp working and its 100x better.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.