question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support / Provide include files to simplify advance configuration

See original GitHub issue

Right now there are a lot of FFMPEG settings to support server acceleration and to FIX specific camera issues however many of these will be common to large groups of users.

Home assistant and a lot of other YAML configured projects use the idea of importing include files for simplifying the main config and also for storing secrets etc.

What I would propose is to:

  1. support user made include files or document it if already possible.
  2. Bundle / include a library of common include files (with each frigate release) for Server HW / Camera HW specific settings…

IE instead of depending on documentation for Intel support

Change this:

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

to

ffmpeg:
  hwaccel_args:  !include global_hwaccel_args_intel_7thGen_or_less.yaml

Instead of a large FFMPEG block in a camera section.

 reolink:
    ffmpeg:
      hwaccel_args:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer+genpts+discardcorrupt
        - -flags
        - low_delay
        - -strict
        - experimental
        - -analyzeduration
        - 1000M
        - -probesize
        - 1000M
        - -rw_timeout
        - "5000000"

to

 reolink:
    ffmpeg: !include camera_ffmpeg_reolink_generic.yaml

If the include files where maintained with the releases it would help make upgrades easier going forward, and would make the config file a bit less lengthy.

Documentation would also possibly need less updating if it just generally referred to looking at the include library for matching configurations.

Using include files in the camera section in general would be very helpful. Many users will have the same over all settings for several cameras so being able to use includes would clean up these sections.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
bagobonescommented, Sep 14, 2022

More config files could be exposed but it gets complicated quickly because we either have to give the container access to the entire /config directory (security implications) or like now we only have access to /config/frigate.yml

Maybe I am not understanding this but since this is all based on docker is this not easily fixed by moving the config file or the includes into their own path / folder on the host and mappings that folder for that use?/config/includes but only includes is mapped with folder access?

Also going back to presets instead of !include you go !preset and use a named preset and !preset just maps to a folder in the image.

End of the day these are just ideas.

Looking at my current config I would love to take this:

cameras:
  doorbell:
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.103.8:554
          roles:
            - record
            - rtmp
        - path: rtsp://admin:password@192.168.103.8:554/cam/realmonitor?channel=1&subtype=1&authbasic=64
          roles:
            - detect
    rtmp:
      enabled: True
    detect:
      width: 640
      height: 480
      fps: 5
    motion:
      threshold: 30
      mask:
        - 0,30,640,31,640,0,0,0
        - 0,442,162,403,254,409,294,451,412,451,531,428,598,406,594,248,0,249
        - 640,296,640,133,568,131,566,300
    zones:
      front_steps:
        coordinates: 227,480,222,402,158,396,0,439,0,480
        objects:
          - person
      front_deck:
        coordinates: 640,480,640,418,602,410,447,444,289,458,295,480
        objects:
          - person
    snapshots:
      enabled: True
    record:
      enabled: True
      events:
        required_zones:
          - front_steps
          - front_deck
  garage_front:
    ffmpeg:
      inputs:
        - path: rtsp://admin:passwor@192.168.103.3:554/
          roles:
            - record
            - rtmp
        - path: rtsp://admin:passwor@192.168.103.3:554/h264Preview_01_sub
          roles:
            - detect
    rtmp:
      enabled: True
    detect:
      width: 640
      height: 360
      fps: 7
    objects:
      track:
        - person
        - car
    motion:
      threshold: 35
      mask:
        - 640,360,400,360,398,334,640,328
        - 149,83,21,0,640,0,640,300
    zones:
      front_steps:
        coordinates: 124,70,127,135,163,135,213,162,215,179,154,193,0,124,0,0,30,0
        objects:
          - person
      parking_spot:
        coordinates: 0,360,0,262,262,159,640,291,640,360
        objects:
          - person
          - car
      mailbox:
        coordinates: 66,158,72,221,0,244,0,133
        objects:
          - person
    snapshots:
      enabled: True
    record:
      enabled: True
      events:
        required_zones:
          - front_steps
          - parking_spot

And turn it into

cameras:
  doorbell: !include camera_doorbell.yaml
  garage_front: !include camera_garage_front.yaml

Having each camera as a file would greatly simplify version control and make cloning, swapping back and forth between versions of a config, much easier than tracking a DIFF in the main config file.

0reactions
bagobonescommented, Oct 15, 2022

Still think this is a good idea but will let this go stale next time around. The more I tune detection min_size etc per camera the longer my config file gets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Provisioning packages overview on Windows 10/11
With Windows 10 and Windows 11, you can create provisioning packages that let you quickly and efficiently configure a device without having ...
Read more >
Amazon EKS add-ons: Advanced configuration | Containers
Support for advanced configuration through the Amazon EKS add-ons API is available today for the following add-ons:.
Read more >
Advanced configuration | WebStorm Documentation - JetBrains
Learn about JVM options, platform properties, and configuration directories.
Read more >
Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
`.gitlab-ci.yml` keyword reference - GitLab Docs
Advanced config · Autoscale config · Autoscale on AWS EC2 · Autoscale on AWS Fargate ... OAuth service provider ... Add file to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found