lol

Merge pull request #299009 from jopejoe1/ffmpeg/pkg-conf&nvidia

ffmpeg: some clean up of nvidia stuff and some general improvements

authored by

Pol Dellaiera and committed by
GitHub
cf80157e 2400488a

+26 -9
+26 -9
pkgs/development/libraries/ffmpeg/generic.nix
··· 47 , withCelt ? withFullDeps # CELT decoder 48 , withChromaprint ? withFullDeps # Audio fingerprinting 49 , withCoreImage ? withHeadlessDeps && stdenv.isDarwin # Apple CoreImage framework 50 - , withCuda ? withFullDeps && (with stdenv; (!isDarwin && !hostPlatform.isAarch && !hostPlatform.isRiscV)) 51 , withCudaLLVM ? withFullDeps 52 , withDav1d ? withHeadlessDeps # AV1 decoder (focused on speed and correctness) 53 , withDc1394 ? withFullDeps && !stdenv.isDarwin # IIDC-1394 grabbing (ieee 1394) 54 , withDrm ? withHeadlessDeps && (with stdenv; isLinux || isFreeBSD) # libdrm support 55 , withFdkAac ? withFullDeps && (!withGPL || withUnfree) # Fraunhofer FDK AAC de/encoder 56 , withFlite ? withFullDeps # Voice Synthesis 57 , withFontconfig ? withHeadlessDeps # Needed for drawtext filter 58 , withFreetype ? withHeadlessDeps # Needed for drawtext filter ··· 70 , withModplug ? withFullDeps && !stdenv.isDarwin # ModPlug support 71 , withMp3lame ? withHeadlessDeps # LAME MP3 encoder 72 , withMysofa ? withFullDeps # HRTF support via SOFAlizer 73 - , withNvdec ? withHeadlessDeps && (with stdenv; !isDarwin && hostPlatform == buildPlatform && !isAarch32 && !hostPlatform.isRiscV) 74 - , withNvenc ? withHeadlessDeps && (with stdenv; !isDarwin && hostPlatform == buildPlatform && !isAarch32 && !hostPlatform.isRiscV) 75 , withOgg ? withHeadlessDeps # Ogg container used by vorbis & theora 76 , withOpenal ? withFullDeps # OpenAL 1.1 capture support 77 , withOpencl ? withFullDeps 78 , withOpencoreAmrnb ? withFullDeps && withVersion3 # AMR-NB de/encoder 79 , withOpencoreAmrwb ? withFullDeps && withVersion3 # AMR-WB decoder 80 - , withOpengl ? false # OpenGL rendering 81 , withOpenh264 ? withFullDeps # H.264/AVC encoder 82 , withOpenjpeg ? withFullDeps # JPEG 2000 de/encoder 83 , withOpenmpt ? withFullDeps # Tracked music files decoder ··· 85 , withPlacebo ? withFullDeps && !stdenv.isDarwin # libplacebo video processing library 86 , withPulse ? withSmallDeps && stdenv.isLinux # Pulseaudio input support 87 , withRav1e ? withFullDeps # AV1 encoder (focused on speed and safety) 88 - , withRtmp ? false # RTMP[E] support 89 , withSamba ? withFullDeps && !stdenv.isDarwin && withGPLv3 # Samba protocol 90 , withSdl2 ? withSmallDeps 91 , withShaderc ? withFullDeps && !stdenv.isDarwin && lib.versionAtLeast version "5.0" ··· 95 , withSsh ? withHeadlessDeps # SFTP protocol 96 , withSvg ? withFullDeps # SVG protocol 97 , withSvtav1 ? withHeadlessDeps && !stdenv.isAarch64 && !stdenv.hostPlatform.isMinGW # AV1 encoder/decoder (focused on speed and correctness) 98 - , withTensorflow ? false # Tensorflow dnn backend support 99 , withTheora ? withHeadlessDeps # Theora encoder 100 , withV4l2 ? withHeadlessDeps && stdenv.isLinux # Video 4 Linux support 101 , withV4l2M2m ? withV4l2 ··· 356 assert buildPostproc -> buildAvutil; 357 assert buildSwscale -> buildAvutil; 358 359 stdenv.mkDerivation (finalAttrs: { 360 pname = "ffmpeg" + (optionalString (ffmpegVariant != "small") "-${ffmpegVariant}"); 361 inherit version; ··· 509 (enableFeature withCoreImage "coreimage") 510 (enableFeature withCuda "cuda") 511 (enableFeature withCudaLLVM "cuda-llvm") 512 (enableFeature withDav1d "libdav1d") 513 (enableFeature withDc1394 "libdc1394") 514 (enableFeature withDrm "libdrm") 515 (enableFeature withFdkAac "libfdk-aac") 516 (enableFeature withFlite "libflite") 517 (enableFeature withFontconfig "fontconfig") 518 (enableFeature withFontconfig "libfontconfig") ··· 533 (enableFeature withModplug "libmodplug") 534 (enableFeature withMp3lame "libmp3lame") 535 (enableFeature withMysofa "libmysofa") 536 - (enableFeature withNvdec "cuvid") 537 (enableFeature withNvdec "nvdec") 538 (enableFeature withNvenc "nvenc") 539 (enableFeature withOpenal "openal") ··· 642 ++ optionals withDc1394 [ libdc1394 libraw1394 ] 643 ++ optionals withDrm [ libdrm ] 644 ++ optionals withFdkAac [ fdk_aac ] 645 ++ optionals withFlite [ flite ] 646 ++ optionals withFontconfig [ fontconfig ] 647 ++ optionals withFreetype [ freetype ] ··· 659 ++ optionals withModplug [ libmodplug ] 660 ++ optionals withMp3lame [ lame ] 661 ++ optionals withMysofa [ libmysofa ] 662 - ++ optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast version "6") then nv-codec-headers-12 else nv-codec-headers) ] 663 ++ optionals withOgg [ libogg ] 664 ++ optionals withOpenal [ openal ] 665 ++ optionals withOpencl [ ocl-icd opencl-headers ] ··· 774 ++ optional withGPLv3 gpl3Plus 775 ++ optional withUnfree unfreeRedistributable 776 ++ optional (withGPL && withUnfree) unfree; 777 - pkgConfigModules = [ "libavutil" ]; 778 platforms = platforms.all; 779 # See https://github.com/NixOS/nixpkgs/pull/295344#issuecomment-1992263658 780 broken = stdenv.hostPlatform.isMinGW && stdenv.hostPlatform.is64bit;
··· 47 , withCelt ? withFullDeps # CELT decoder 48 , withChromaprint ? withFullDeps # Audio fingerprinting 49 , withCoreImage ? withHeadlessDeps && stdenv.isDarwin # Apple CoreImage framework 50 + , withCuda ? withFullDeps && withNvcodec 51 , withCudaLLVM ? withFullDeps 52 + , withCuvid ? withHeadlessDeps && withNvcodec 53 , withDav1d ? withHeadlessDeps # AV1 decoder (focused on speed and correctness) 54 , withDc1394 ? withFullDeps && !stdenv.isDarwin # IIDC-1394 grabbing (ieee 1394) 55 , withDrm ? withHeadlessDeps && (with stdenv; isLinux || isFreeBSD) # libdrm support 56 , withFdkAac ? withFullDeps && (!withGPL || withUnfree) # Fraunhofer FDK AAC de/encoder 57 + , withNvcodec ? withHeadlessDeps && (with stdenv; !isDarwin && !isAarch32 && !hostPlatform.isRiscV && hostPlatform == buildPlatform) # dynamically linked Nvidia code 58 , withFlite ? withFullDeps # Voice Synthesis 59 , withFontconfig ? withHeadlessDeps # Needed for drawtext filter 60 , withFreetype ? withHeadlessDeps # Needed for drawtext filter ··· 72 , withModplug ? withFullDeps && !stdenv.isDarwin # ModPlug support 73 , withMp3lame ? withHeadlessDeps # LAME MP3 encoder 74 , withMysofa ? withFullDeps # HRTF support via SOFAlizer 75 + , withNvdec ? withHeadlessDeps && withNvcodec 76 + , withNvenc ? withHeadlessDeps && withNvcodec 77 , withOgg ? withHeadlessDeps # Ogg container used by vorbis & theora 78 , withOpenal ? withFullDeps # OpenAL 1.1 capture support 79 , withOpencl ? withFullDeps 80 , withOpencoreAmrnb ? withFullDeps && withVersion3 # AMR-NB de/encoder 81 , withOpencoreAmrwb ? withFullDeps && withVersion3 # AMR-WB decoder 82 + , withOpengl ? withFullDeps && !stdenv.isDarwin # OpenGL rendering 83 , withOpenh264 ? withFullDeps # H.264/AVC encoder 84 , withOpenjpeg ? withFullDeps # JPEG 2000 de/encoder 85 , withOpenmpt ? withFullDeps # Tracked music files decoder ··· 87 , withPlacebo ? withFullDeps && !stdenv.isDarwin # libplacebo video processing library 88 , withPulse ? withSmallDeps && stdenv.isLinux # Pulseaudio input support 89 , withRav1e ? withFullDeps # AV1 encoder (focused on speed and safety) 90 + , withRtmp ? withFullDeps # RTMP[E] support 91 , withSamba ? withFullDeps && !stdenv.isDarwin && withGPLv3 # Samba protocol 92 , withSdl2 ? withSmallDeps 93 , withShaderc ? withFullDeps && !stdenv.isDarwin && lib.versionAtLeast version "5.0" ··· 97 , withSsh ? withHeadlessDeps # SFTP protocol 98 , withSvg ? withFullDeps # SVG protocol 99 , withSvtav1 ? withHeadlessDeps && !stdenv.isAarch64 && !stdenv.hostPlatform.isMinGW # AV1 encoder/decoder (focused on speed and correctness) 100 + , withTensorflow ? false # Tensorflow dnn backend support (Increases closure size by ~390 MiB) 101 , withTheora ? withHeadlessDeps # Theora encoder 102 , withV4l2 ? withHeadlessDeps && stdenv.isLinux # Video 4 Linux support 103 , withV4l2M2m ? withV4l2 ··· 358 assert buildPostproc -> buildAvutil; 359 assert buildSwscale -> buildAvutil; 360 361 + /* 362 + * External Library dependencies 363 + */ 364 + assert (withCuda || withCuvid || withNvdec || withNvenc) -> withNvcodec; 365 + 366 stdenv.mkDerivation (finalAttrs: { 367 pname = "ffmpeg" + (optionalString (ffmpegVariant != "small") "-${ffmpegVariant}"); 368 inherit version; ··· 516 (enableFeature withCoreImage "coreimage") 517 (enableFeature withCuda "cuda") 518 (enableFeature withCudaLLVM "cuda-llvm") 519 + (enableFeature withCuvid "cuvid") 520 (enableFeature withDav1d "libdav1d") 521 (enableFeature withDc1394 "libdc1394") 522 (enableFeature withDrm "libdrm") 523 (enableFeature withFdkAac "libfdk-aac") 524 + (enableFeature withNvcodec "ffnvcodec") 525 (enableFeature withFlite "libflite") 526 (enableFeature withFontconfig "fontconfig") 527 (enableFeature withFontconfig "libfontconfig") ··· 542 (enableFeature withModplug "libmodplug") 543 (enableFeature withMp3lame "libmp3lame") 544 (enableFeature withMysofa "libmysofa") 545 (enableFeature withNvdec "nvdec") 546 (enableFeature withNvenc "nvenc") 547 (enableFeature withOpenal "openal") ··· 650 ++ optionals withDc1394 [ libdc1394 libraw1394 ] 651 ++ optionals withDrm [ libdrm ] 652 ++ optionals withFdkAac [ fdk_aac ] 653 + ++ optionals withNvcodec [ (if (lib.versionAtLeast version "6") then nv-codec-headers-12 else nv-codec-headers) ] 654 ++ optionals withFlite [ flite ] 655 ++ optionals withFontconfig [ fontconfig ] 656 ++ optionals withFreetype [ freetype ] ··· 668 ++ optionals withModplug [ libmodplug ] 669 ++ optionals withMp3lame [ lame ] 670 ++ optionals withMysofa [ libmysofa ] 671 ++ optionals withOgg [ libogg ] 672 ++ optionals withOpenal [ openal ] 673 ++ optionals withOpencl [ ocl-icd opencl-headers ] ··· 782 ++ optional withGPLv3 gpl3Plus 783 ++ optional withUnfree unfreeRedistributable 784 ++ optional (withGPL && withUnfree) unfree; 785 + pkgConfigModules = [ ] 786 + ++ optional buildAvcodec "libavcodec" 787 + ++ optional buildAvdevice "libavdevice" 788 + ++ optional buildAvfilter "libavfilter" 789 + ++ optional buildAvformat "libavformat" 790 + ++ optional buildAvresample "libavresample" 791 + ++ optional buildAvutil "libavutil" 792 + ++ optional buildPostproc "libpostproc" 793 + ++ optional buildSwresample "libswresample" 794 + ++ optional buildSwscale "libswscale"; 795 platforms = platforms.all; 796 # See https://github.com/NixOS/nixpkgs/pull/295344#issuecomment-1992263658 797 broken = stdenv.hostPlatform.isMinGW && stdenv.hostPlatform.is64bit;