Jump to content

FFmpeg: Difference between revisions

From NixOS Wiki
M3vtfbp (talk | contribs)
Created page with "Building Ffmpeg with extra functionality. To install the maximum amount of functionality offered by Nix binary repositories, you may install ffmpeg like the following. environment.systemPackages = [ pkgs.ffmpeg-full ]; === Adding more functionality to ffmpeg is possible, but it will require compiling on your local system. === The Fraunhofer FDK AAC audio codec is said to give superior compression and audio quality to other AAC codecs. To install environme..."
Tags: Mobile edit Mobile web edit
 
m FFmpeg build information: Remove leftover title from previous change.
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Building Ffmpeg with extra functionality. To install the maximum amount of functionality offered by Nix binary repositories, you may install ffmpeg like the following.
Building FFmpeg with extra functionality. To install the maximum amount of functionality offered by Nix binary repositories, you may install ffmpeg like the following.


<syntaxhighlight lang="nix">
environment.systemPackages = [
  pkgs.ffmpeg-full
];
</syntaxhighlight>


  environment.systemPackages = [
=== More codecs ===
    pkgs.ffmpeg-full
Adding more functionality to FFmpeg is possible, but it will require compiling on your local system.
  ];


Enabling unfree dependencies allow use of Nvidia features, the FDK AAC decoder, and a lot more. Review build informations to check which flags are enabled by this option:


=== Adding more functionality to ffmpeg is possible, but it will require compiling on your local system. ===
<syntaxhighlight lang="nix">
environment.systemPackages = [
  (pkgs.ffmpeg-full.override { withUnfree = true; })
];
</syntaxhighlight>


The Fraunhofer FDK AAC audio codec is said to give superior compression and audio quality to other AAC codecs. To install
It is possible to add support for more than one feature at a time. Here are some options disabled by default:
<syntaxhighlight lang="nix">environment.systemPackages = [
  (pkgs.ffmpeg-full.override {
    withUnfree = false; # Allow unfree dependencies (for Nvidia features notably)
    withMetal = false; # Use Metal API on Mac. Unfree and requires manual downloading of files
    withMfx = false; # Hardware acceleration via the deprecated intel-media-sdk/libmfx. Use oneVPL instead (enabled by default) from Intel's oneAPI.
    withTensorflow = false; # Tensorflow dnn backend support (Increases closure size by ~390 MiB)
    withSmallBuild = false; # Prefer binary size to performance.
    withDebug = false; # Build using debug options
  })
];</syntaxhighlight>For more options and overrides, check out the FFmpeg build informations :


  environment.systemPackages = [
https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/ffmpeg/generic.nix
    (pkgs.ffmpeg-full.override { withUnfree = true; })
  ];


It is possible to add support for more than one feature at a time. To add FDK AAC AND OpenGL rendering support
=== Speeding up install ===
 
It's possible to speed up the install. After compiling is finished, a series of generic checks are run. To skip these checks, we need to set doCheck to false. Here is an example of adding FDK AAC support, and skipping post build checks.
  environment.systemPackages = [
<syntaxhighlight lang="nix">
    (pkgs.ffmpeg-full.override { withUnfree = true; withOpenGL = true; })
environment.systemPackages = [
  ];
  ((pkgs.ffmpeg-full.override { withUnfree = true; }).overrideAttrs (_: { doCheck = false; }))
 
];
Using the pattern shown in previous examples, it is possible options to set the following options as true (enabled):
</syntaxhighlight>
 
[[Category:Audio]]
  withUnfree # Currently only FDK AAC Codec
[[Category:Video]]
  withOpenGL # OpenGL rendering support
  withRmtp  # RMTP support
  withTensorflow # Tensorflow dnn backend support
 
It's possible to speed up the install. After compiling is finished, a series of generic checks are run. To skip these checks, we need to set doChecks to false. Here is an example of adding FDK AAC support, and skipping post build checks.
 
  environment.systemPackages = [
    ((pkgs.ffmpeg-full.override { withUnfree = true; }).overrideAttrs (_: { doCheck = false; }))
  ];

Latest revision as of 13:18, 1 August 2025

Building FFmpeg with extra functionality. To install the maximum amount of functionality offered by Nix binary repositories, you may install ffmpeg like the following.

environment.systemPackages = [
  pkgs.ffmpeg-full
];

More codecs

Adding more functionality to FFmpeg is possible, but it will require compiling on your local system.

Enabling unfree dependencies allow use of Nvidia features, the FDK AAC decoder, and a lot more. Review build informations to check which flags are enabled by this option:

environment.systemPackages = [
  (pkgs.ffmpeg-full.override { withUnfree = true; })
];

It is possible to add support for more than one feature at a time. Here are some options disabled by default:

environment.systemPackages = [
  (pkgs.ffmpeg-full.override { 
    withUnfree = false; # Allow unfree dependencies (for Nvidia features notably)
    withMetal = false; # Use Metal API on Mac. Unfree and requires manual downloading of files
    withMfx = false; # Hardware acceleration via the deprecated intel-media-sdk/libmfx. Use oneVPL instead (enabled by default) from Intel's oneAPI.
    withTensorflow = false; # Tensorflow dnn backend support (Increases closure size by ~390 MiB)
    withSmallBuild = false; # Prefer binary size to performance.
    withDebug = false; # Build using debug options
  })
];

For more options and overrides, check out the FFmpeg build informations :

https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/ffmpeg/generic.nix

Speeding up install

It's possible to speed up the install. After compiling is finished, a series of generic checks are run. To skip these checks, we need to set doCheck to false. Here is an example of adding FDK AAC support, and skipping post build checks.

environment.systemPackages = [
  ((pkgs.ffmpeg-full.override { withUnfree = true; }).overrideAttrs (_: { doCheck = false; }))
];