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