Commit 2e7ea696 authored by Bakhtiyar Neyman's avatar Bakhtiyar Neyman
Browse files

nixos/frigate: set LIBAVFORMAT_VERSION_MAJOR



Frigate uses this to select appropriate ffmpeg flags for compatibility.

Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 1d27f00d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -699,6 +699,17 @@ in
      environment = {
        CONFIG_FILE = "/run/frigate/frigate.yml";
        HOME = "/var/lib/frigate";
        # Extract libavformat version in the same way Docker scripts in frigate directory do. This
        # environment variable changes the flags given to `ffmpeg` improving compatibility.
        LIBAVFORMAT_VERSION_MAJOR = lib.strings.trim (
          builtins.readFile (
            pkgs.runCommandLocal "libavformat-major-version" { } ''
              ${cfg.settings.ffmpeg.path}/bin/ffmpeg -version 2>&1 \
                | sed -n 's/.*libavformat[[:space:]]*\([0-9]*\).*/\1/p' \
                | head -1 > $out
            ''
          )
        );
        PYTHONPATH = cfg.package.pythonPath;
      }
      // optionalAttrs (cfg.vaapiDriver != null) {