Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Camera Support]: #5860

Closed
BeardedTek opened this issue Mar 28, 2023 · 15 comments
Closed

[Camera Support]: #5860

BeardedTek opened this issue Mar 28, 2023 · 15 comments
Labels
beta Related to the current beta version of frigate support triage

Comments

@BeardedTek
Copy link

Describe the problem you are having

I have 2 Merkury 1080p outdoor bullet cameras modified to output an rtsp stream. These cameras every once in a while look like the following screenshots:
frigate_screenshot
frigate_screenshot_2

I am using

Version

0.12.0-7D589BD

Frigate config file

go2rtc:
  streams:
    garage:
      - rtsp://wyze-bridge:8554/garage
    livingroom:
      - rtsp://wyze-bridge:8554/livingroom
    backdeck:
      - rtsp://wyze-bridge:8554/back-deck
    driveway:
      - rtsp://wyze-bridge:8554/driveway
    backyard:
      - rtsp://admin:admin@192.168.2.189:8554/Streaming/Channels/101
    side:
      - rtsp://admin:admin@192.168.2.190:8554/Streaming/Channels/101
  webrtc:
    candidates:
      - 192.168.2.241:8555
      - stun:8555

mqtt:
  host: 192.168.2.145

detectors:
  coral0:
    type: edgetpu
    device: usb:0
  coral1:
    type: edgetpu
    device: usb:1

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac

birdseye:
  enabled: True
  mode: continuous
  width: 3840
  height: 2160
  quality: 1
  restream: True

logger:
  default: info
  logs:
    frigate.event: debug

detect:
  width: 1920
  height: 1080
  max_disappeared: 60

objects:
  track:
    - bus
    - person
    - car
    - animal
record:
  enabled: True
  retain:
    days: 3
    mode: all
  events:
    pre_capture: 30
    post_capture: 30
    objects:
      - bus
      - person
      - car
      - animal
    retain:
      default: 7
      mode: motion
snapshots:
  enabled: True
  bounding_box: True
  quality: 100
  retain:
    default: 10
    objects:
      bus: 30
      person: 30
      car: 30
      animal: 30
cameras:
  garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    birdseye:
      enabled: False
    objects:
      track:
        - person
        - animal
      filters:
        animal:
          min_score: 0.70
          threshold: 0.73
        person:
          min_score: 0.70
          threshold: 0.73
  livingroom:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/livingroom
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    birdseye:
      enabled: False
    objects:
      track:
        - person
        - animal
      filters:
        animal:
          min_score: 0.70
          threshold: 0.73
        person:
          min_score: 0.70
          threshold: 0.73
  backdeck:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backdeck
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    objects:
      track:
        - person
        - animal
      filters:
        animal:
          min_score: 0.70
          threshold: 0.73
        person:
          min_score: 0.70
          threshold: 0.73
  driveway:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/driveway
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    motion:
      mask:
        - 1920,0,1697,0,1709,38,1457,29,1464,0,966,0,663,145,545,177,611,124,491,157,392,202,373,284,327,319,0,533,0,0
    objects:
      track:
        - bus
        - person
        - car
        - animal
      filters:
        bus:
          mask:
            - 1920,0,1697,0,1709,38,1457,29,1464,0,966,0,663,145,545,177,611,124,491,157,392,202,373,284,327,319,0,533,0,0
        car:
          mask:
            - 1920,0,1920,111,1680,95,1457,89,1010,128,615,210,373,284,327,319,0,533,0,0
          min_area: 20000
          max_area: 250000
          min_score: 0.70
          threshold: 0.73
        person:
          mask:
            - 1920,0,1920,111,1680,95,1457,89,1010,128,615,210,373,284,327,319,0,533,0,0
          min_area: 6000
          max_area: 90000
          min_score: 0.70
          threshold: 0.73
        animal:
          min_area: 6000
          max_area: 120000
          min_score: 0.70
          threshold: 0.73
    zones:
      driveway-main:
        coordinates: 1133,280,398,1080,1920,1080,1920,377,1856,340,1737,290,1599,233,1494,200,1438,152,1463,99,1094,132,1007,163
        objects:
          - car
          - person
          - animal
  backyard:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backyard
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    motion:
      mask:
        - 1920,270,1920,0,1477,0,0,0,0,53,912,63,1375,146,1389,90,1538,41,1796,210,1760,349,1920,462
    objects:
      track:
        - person
        - car
        - animal
      filters:
        person:
          mask:
            - 1920,270,1920,0,1477,0,0,0,0,53,912,63,1375,146,1389,90,1538,41,1796,210,1760,349,1920,462
          min_area: 25000
          max_area: 150000
          min_score: 0.70
          threshold: 0.78
        car:
          mask:
            - 1920,270,1920,0,1477,0,0,0,0,53,912,63,1375,146,1389,90,1538,41,1796,210,1760,349,1920,462
          min_area: 9000
          max_area: 80000
          min_score: 0.70
          threshold: 0.78

        animal:
          mask:
            - 1920,270,1920,0,1477,0,0,0,0,53,912,63,1375,146,1389,90,1538,41,1796,210,1760,349,1920,462
          min_area: 9000
          max_area: 80000
          min_score: 0.70
          threshold: 0.78
  side:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/side
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    motion:
      mask:
        - 1038,0,1920,0,1920,338,1677,229,1378,111,929,23,707,64,705,111,466,111,332,138,167,210,27,278,74,538,323,1080,0,1080,0,0
    objects:
      track:
        - bus
        - person
        - car
        - animal
      filters:
        car:
          mask:
            - 1038,0,1920,0,1920,338,1677,229,1378,111,929,23,707,64,705,111,466,111,332,138,167,210,27,278,74,538,323,1080,0,1080,0,0
          min_area: 25000
          max_area: 250000
          min_score: 0.70
          threshold: 0.73
        person:
          mask:
            - 1038,0,1920,0,1920,338,1677,229,1378,111,929,23,707,64,705,111,466,111,332,138,167,210,27,278,74,538,323,1080,0,1080,0,0
          min_area: 9000
          max_area: 90000
          min_score: 0.70
          threshold: 0.73
        animal:
          mask:
            - 1038,0,1920,0,1920,338,1677,229,1378,111,929,23,707,64,705,111,466,111,332,138,167,210,27,278,74,538,323,1080,0,1080,0,0
          min_area: 12000
          max_area: 120000
          min_score: 0.70
          threshold: 0.73

Relevant log output

beardedtek@yzma:/usr/local/docker/frigate$ sudo docker-compose logs | grep -E 'backyard|side' | grep -E 'watchdog|ffmpeg|frigate.video'
frigate    | 2023-03-28 15:43:33.908346524  [2023-03-28 15:43:33] watchdog.backyard              INFO    : backyard exceeded fps limit. Exiting ffmpeg...
frigate    | 2023-03-28 15:43:33.909013455  [2023-03-28 15:43:33] watchdog.backyard              INFO    : Waiting for ffmpeg to exit gracefully...
frigate    | 2023-03-28 15:44:33.117897041  [2023-03-28 15:44:33] watchdog.backyard              INFO    : FFmpeg did not exit. Force killing...
frigate    | 2023-03-28 15:44:33.126418487  [2023-03-28 15:44:33] frigate.video                  ERROR   : backyard: Unable to read frames from ffmpeg process.
frigate    | 2023-03-28 15:44:33.126778829  [2023-03-28 15:44:33] frigate.video                  ERROR   : backyard: ffmpeg process is not running. exiting capture thread...
frigate    | 2023-03-28 15:45:27.294006089  [2023-03-28 15:45:27] watchdog.backyard              ERROR   : Ffmpeg process crashed unexpectedly for backyard.
frigate    | 2023-03-28 15:45:27.294527347  [2023-03-28 15:45:27] watchdog.backyard              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate    | 2023-03-28 15:45:27.296073652  [2023-03-28 15:45:27] ffmpeg.backyard.detect         ERROR   : More than 1000 frames duplicated
frigate    | 2023-03-28 15:47:43.953490147  [2023-03-28 15:47:43] watchdog.side                  INFO    : side exceeded fps limit. Exiting ffmpeg...
frigate    | 2023-03-28 15:47:43.955907847  [2023-03-28 15:47:43] watchdog.side                  INFO    : Waiting for ffmpeg to exit gracefully...
frigate    | 2023-03-28 15:48:44.771103993  [2023-03-28 15:48:44] watchdog.side                  INFO    : FFmpeg did not exit. Force killing...
frigate    | 2023-03-28 15:48:44.772332097  [2023-03-28 15:48:44] frigate.video                  ERROR   : side: Unable to read frames from ffmpeg process.
frigate    | 2023-03-28 15:48:44.772509383  [2023-03-28 15:48:44] frigate.video                  ERROR   : side: ffmpeg process is not running. exiting capture thread...
frigate    | 2023-03-28 15:51:04.203829385  [2023-03-28 15:51:04] watchdog.backyard              INFO    : backyard exceeded fps limit. Exiting ffmpeg...
frigate    | 2023-03-28 15:51:04.203962483  [2023-03-28 15:51:04] watchdog.backyard              INFO    : Waiting for ffmpeg to exit gracefully...
frigate    | 2023-03-28 15:51:04.244697273  [2023-03-28 15:51:04] frigate.video                  ERROR   : backyard: Unable to read frames from ffmpeg process.
frigate    | 2023-03-28 15:51:04.252765071  [2023-03-28 15:51:04] frigate.video                  ERROR   : backyard: ffmpeg process is not running. exiting capture thread...
frigate    | 2023-03-28 15:51:14.272678434  [2023-03-28 15:51:14] watchdog.backyard              ERROR   : Ffmpeg process crashed unexpectedly for backyard.
frigate    | 2023-03-28 15:51:14.272769024  [2023-03-28 15:51:14] watchdog.backyard              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate    | 2023-03-28 15:51:14.272832882  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   : rtsp://127.0.0.1:8554/backyard: corrupt decoded frame in stream 0
frigate    | 2023-03-28 15:51:14.272918534  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   :     Last message repeated 2 times
frigate    | 2023-03-28 15:51:14.272980944  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   : [h264 @ 0x558305b47f00] left block unavailable for requested intra4x4 mode -1
frigate    | 2023-03-28 15:51:14.273045780  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   : [h264 @ 0x558305b47f00] error while decoding MB 0 39, bytestream 40872
frigate    | 2023-03-28 15:51:14.273104898  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   : rtsp://127.0.0.1:8554/backyard: corrupt decoded frame in stream 0
frigate    | 2023-03-28 15:51:14.273163701  [2023-03-28 15:51:14] ffmpeg.backyard.detect         ERROR   :     Last message repeated 1 times

FFprobe output from your camera

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

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

Frigate stats

{"backdeck":{"camera_fps":5.0,"capture_pid":472,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":1672,"pid":457,"process_fps":5.0,"skipped_fps":0.0},"backyard":{"camera_fps":5.0,"capture_pid":484,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":1676,"pid":460,"process_fps":5.0,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.5"},"1":{"cpu":"0.0","mem":"0.0"},"101":{"cpu":"0.0","mem":"0.0"},"104":{"cpu":"7.0","mem":"1.2"},"118":{"cpu":"0.0","mem":"0.0"},"134":{"cpu":"0.0","mem":"0.0"},"135":{"cpu":"0.0","mem":"0.0"},"136":{"cpu":"0.0","mem":"0.0"},"137":{"cpu":"0.0","mem":"0.0"},"138":{"cpu":"0.0","mem":"0.0"},"139":{"cpu":"0.0","mem":"0.0"},"144":{"cpu":"0.0","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"152":{"cpu":"0.0","mem":"0.0"},"1668":{"cpu":"19.5","mem":"0.6"},"1669":{"cpu":"19.2","mem":"0.6"},"1672":{"cpu":"15.6","mem":"0.6"},"1674":{"cpu":"10.9","mem":"0.6"},"1676":{"cpu":"16.6","mem":"0.6"},"17":{"cpu":"0.0","mem":"0.0"},"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"},"2807":{"cpu":"0.0","mem":"0.0"},"2813":{"cpu":"0.0","mem":"0.0"},"2817":{"cpu":"0.3","mem":"0.0"},"2821":{"cpu":"0.0","mem":"0.2"},"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"},"429":{"cpu":"0.0","mem":"0.1"},"435":{"cpu":"0.3","mem":"0.0"},"436":{"cpu":"1.0","mem":"0.1"},"438":{"cpu":"0.3","mem":"0.1"},"440":{"cpu":"12.3","mem":"0.7"},"453":{"cpu":"0.0","mem":"0.0"},"454":{"cpu":"1.3","mem":"0.1"},"455":{"cpu":"0.7","mem":"0.3"},"456":{"cpu":"0.0","mem":"0.0"},"457":{"cpu":"0.7","mem":"0.1"},"458":{"cpu":"1.3","mem":"0.2"},"459":{"cpu":"0.0","mem":"0.0"},"460":{"cpu":"6.3","mem":"0.2"},"461":{"cpu":"0.0","mem":"0.0"},"462":{"cpu":"0.0","mem":"0.0"},"463":{"cpu":"6.0","mem":"0.2"},"464":{"cpu":"0.0","mem":"0.0"},"467":{"cpu":"3.0","mem":"0.2"},"471":{"cpu":"0.0","mem":"0.0"},"472":{"cpu":"4.0","mem":"0.2"},"475":{"cpu":"6.0","mem":"0.2"},"480":{"cpu":"72.2","mem":"0.7"},"484":{"cpu":"5.0","mem":"0.2"},"497":{"cpu":"0.0","mem":"0.0"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"89":{"cpu":"3.3","mem":"0.1"},"MiB":{"cpu":"7255.5","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"1"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":0.9,"detectors":{"coral0":{"detection_start":0.0,"inference_speed":13.17,"pid":436},"coral1":{"detection_start":0.0,"inference_speed":15.1,"pid":438}},"driveway":{"camera_fps":4.9,"capture_pid":475,"detection_enabled":1,"detection_fps":0.9,"ffmpeg_pid":1669,"pid":458,"process_fps":4.9,"skipped_fps":0.0},"garage":{"camera_fps":5.1,"capture_pid":463,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":1668,"pid":454,"process_fps":5.1,"skipped_fps":0.0},"livingroom":{"camera_fps":4.0,"capture_pid":467,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":1674,"pid":455,"process_fps":4.0,"skipped_fps":0.0},"service":{"last_updated":1680019322,"latest_version":"0.11.1","storage":{"/dev/shm":{"free":1039.7,"mount_type":"tmpfs","total":1073.7,"used":34.1},"/media/frigate/clips":{"free":368209.6,"mount_type":"nfs4","total":500108.9,"used":131202.0},"/media/frigate/recordings":{"free":368209.6,"mount_type":"nfs4","total":500108.9,"used":131202.0},"/tmp/cache":{"free":994.8,"mount_type":"tmpfs","total":1000.0,"used":5.2}},"temperatures":{},"uptime":1169,"version":"0.12.0-7d589bd"},"side":{"camera_fps":103.1,"capture_pid":497,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":504,"pid":462,"process_fps":96.9,"skipped_fps":0.0}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wireless

Camera make and model

Merkury 1080p Outdoor Camera

Any other information that may be helpful

https://github.com/williamkennyAK/Merkury1080P is used to modify camera to give rtsp output

@NickM-27 NickM-27 added the beta Related to the current beta version of frigate label Mar 28, 2023
@NickM-27
Copy link
Sponsor Collaborator

most likely it is just coming back like this from the camera. You're not using hwaccel so there is nothing that would affect the data coming from the camera I don't think

@BeardedTek
Copy link
Author

BeardedTek commented Mar 28, 2023

That's what I was thinking as well, except I don't have this problem when viewing the rtsp feed directly, It will just run for hours without issue, and this happens fairly regularly with frigate.

Most times within moments of the initial error, I can click on the camera itself and the video is absolutely fine, but birdseye and the snapshot for the camera is not.

I somewhat feel like there could be an optimization for ffmpeg that could overcome this, but don't know where to start.

@BeardedTek
Copy link
Author

BeardedTek commented Mar 28, 2023

Additionally, after about an hour this time, sometimes less, sometimes more, I get just a white area where the camera should be when I click on the camera from the main camera screen
frigate_screenshot_3

and get the following output from the logs:

beardedtek@yzma:/usr/local/docker/frigate$ sudo docker-compose logs -f | grep -E 'side' | grep -v 'GET'
frigate    | 2023-03-28 15:42:33.843823681  [2023-03-28 15:42:33] frigate.app                    INFO    : Camera processor started for side: 462
frigate    | 2023-03-28 15:42:33.889484402  [2023-03-28 15:42:33] frigate.app                    INFO    : Capture process started for side: 497
frigate    | 2023-03-28 15:47:43.953490147  [2023-03-28 15:47:43] watchdog.side                  INFO    : side exceeded fps limit. Exiting ffmpeg...
frigate    | 2023-03-28 15:47:43.955907847  [2023-03-28 15:47:43] watchdog.side                  INFO    : Waiting for ffmpeg to exit gracefully...
frigate    | 2023-03-28 15:48:44.771103993  [2023-03-28 15:48:44] watchdog.side                  INFO    : FFmpeg did not exit. Force killing...
frigate    | 2023-03-28 15:48:44.772332097  [2023-03-28 15:48:44] frigate.video                  ERROR   : side: Unable to read frames from ffmpeg process.
frigate    | 2023-03-28 15:48:44.772509383  [2023-03-28 15:48:44] frigate.video                  ERROR   : side: ffmpeg process is not running. exiting capture thread...
frigate    | 2023-03-28 15:48:49.663566599  [2023-03-28 15:48:49] frigate.record                 WARNING : Failed to probe corrupt segment /tmp/cache/side-20230328154736.mp4: 0 - b'[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558101e656c0] moov atom not found\n/tmp/cache/side-20230328154736.mp4: Invalid data found when processing input\n'
frigate    | 2023-03-28 15:48:49.663793189  [2023-03-28 15:48:49] frigate.record                 WARNING : Discarding a corrupt recording segment: /tmp/cache/side-20230328154736.mp4

The following is output from htop, it's like ffmpeg died and won't restart:

frigate_screenshot_4

@NickM-27
Copy link
Sponsor Collaborator

would expect more logs after that from ffmpeg, otherwise not sure

@BeardedTek
Copy link
Author

Doing more digging, I've found it only goes to the white screen for the camera on jsmpeg, it shows up properly under webrtc and mse. birdseye still shows the curropted frame and does not update

@NickM-27
Copy link
Sponsor Collaborator

right, because the ffmpeg process for detect is what supplies that snapshot to both of those while the other live views are separate

@BeardedTek
Copy link
Author

Okay, so it could be something with the setup of my detect stream?
Right now I have this in my config.yml:

  side:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/side
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy

I'm going to try this to see if it helps:

  side:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/side
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy
        detect: preset-record-generic-audio-copy

@BeardedTek
Copy link
Author

It may have been this also?

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac

@NickM-27
Copy link
Sponsor Collaborator

I would definitely suggest not overriding those and just let it use frigate defaults

@BeardedTek
Copy link
Author

BeardedTek commented Mar 28, 2023

I thought for at least record, in order to get audio you need to unless that has changed?

@BeardedTek
Copy link
Author

I have edited my config file ffmpeg section to look like this:

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac

and my camera section to look like this:

  side:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/side
          input_args:  preset-rtsp-restream
          roles:
            - record
            - detect
      output_args:
        record: preset-record-generic-audio-copy

It appears to be a working config. I'll run like this for the next day or so and report back the findings.

Thank you for the help and realizing that I was over complicating things.

@NickM-27
Copy link
Sponsor Collaborator

I thought for at least record, in order to get audio you need to unless that has changed?

sure but you are overriding that setting on the camera level so what you set globally has no affect (and you should definitely be using ffmpeg presets everywhere)

@BeardedTek
Copy link
Author

Gotcha. That makes sense. I'll change the ffmpeg to preset-record-generic-audio-copy and override just those cameras that I don't want audio. That does actually make sense. I initially made this configuration file over a year ago before the presets were a documented part of frigate.

@BeardedTek
Copy link
Author

Well, everything is working great now. It usually would have failed at this point.

Thank you for your time, I know it is valuable. Hopefully someone can find my mistakes useful in troubleshooting :)

@BeardedTek
Copy link
Author

As a side note, this issue came back. I fixed the problem by setting this camera up like so:

go2rtc:
  streams:
    backyard:
      - rtsp://192.168.2.189:8554/Streaming/Channels/101
    backyard_sub:
      - rtsp://192.168.2.189:8554/Streaming/Channels/102

...

ffmpeg:
  input_args: preset-rtsp-restream
birdseye:
  enabled: True
  mode: continuous
  width: 1280
  height: 720
  quality: 5
  restream: True

...

detect:
  width: 640
  height: 360
  max_disappeared: 60

cameras:
  backyard:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backyard
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/backyard_sub
          roles:
            - detect
      input_args: preset-rtsp-generic

It seems that using preset-rtsp-restream with this camera was generating the artifacts, and setting this particular camera's preset to preset-rtsp-generic cleared up the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Related to the current beta version of frigate support triage
Projects
None yet
Development

No branches or pull requests

2 participants