anchor.diff:  , libXv ? null # Xlib support
   , libXext ? null # Xlib support
   , lzma ? null # xz-utils
  -, nvenc ? false, nvidia-video-sdk ? null, nv-codec-headers ? null # NVIDIA NVENC support
  +, nvenc ? false, nv-codec-headers ? null # NVIDIA NVENC support
   , callPackage # needed for NVENC to access external ffmpeg nvidia headers
   , openal ? null # OpenAL 1.1 capture support
   #, opencl ? null # OpenCL code
  
positive.code:     ++ optional ((isLinux || isFreeBSD) && libva != null) libva
      ++ optionals isLinux [ alsaLib libraw1394 libv4l ]
      ++ optional (isLinux && libmfx != null) libmfx
      ++ optionals nvenc [ nvidia-video-sdk nv-codec-headers ]
      ++ optionals stdenv.isDarwin [ Cocoa CoreServices CoreAudio AVFoundation
                                     MediaToolbox VideoDecodeAcceleration
                                     libiconv cf-private /* For _OBJC_EHTYPE_$_NSException */ ];
  
negative.code: assert libxcbshapeExtlib -> libxcb != null;
  assert openglExtlib -> libGLU_combined != null;
  assert opensslExtlib -> gnutls == null && openssl != null && nonfreeLicensing;
  
  stdenv.mkDerivation rec {
    name = "ffmpeg-full-${version}";
  