diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index d2ef075beee1..6bf7d0f68f83 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -25,7 +25,6 @@ , ffmpegProgram ? true # Build ffmpeg executable , ffplayProgram ? true # Build ffplay executable , ffprobeProgram ? true # Build ffprobe executable -, ffserverProgram ? true # Build ffserver executable , qtFaststartProgram ? true # Build qt-faststart executable /* * Library options @@ -98,13 +97,14 @@ , libXv ? null # Xlib support , lzma ? null # xz-utils , nvenc ? false, nvidia-video-sdk ? 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 , opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder #, opencv ? null # Video filtering , openglExtlib ? false, libGLU_combined ? null # OpenGL rendering #, openh264 ? null # H.264/AVC encoder -, openjpeg_1 ? null # JPEG 2000 de/encoder +, openjpeg ? null # JPEG 2000 de/encoder , opensslExtlib ? false, openssl ? null , libpulseaudio ? null # Pulseaudio input support , rtmpdump ? null # RTMP[E] support @@ -159,7 +159,7 @@ * utvideo vo-aacenc vo-amrwbenc xvmc zvbi blackmagic-design-desktop-video * * Need fixes to support Darwin: - * frei0r, game-music-emu, gsm, libjack2, libssh, libvpx(stable 1.3.0), openal, openjpeg_1, + * frei0r, game-music-emu, gsm, libjack2, libssh, libvpx(stable 1.3.0), openal, openjpeg, * pulseaudio, rtmpdump, samba, vid-stab, wavpack, x265. xavs * * Not supported: @@ -176,6 +176,8 @@ let inherit (stdenv) isCygwin isFreeBSD isLinux; inherit (stdenv.lib) optional optionals optionalString enableFeature; + + nv-codec-headers = callPackage ./nv-codec-headers.nix { }; in /* @@ -201,7 +203,6 @@ assert ffplayProgram -> avcodecLibrary && swresampleLibrary && SDL2 != null; assert ffprobeProgram -> avcodecLibrary && avformatLibrary; -assert ffserverProgram -> avformatLibrary; /* * Library dependencies */ @@ -231,11 +232,11 @@ assert nvenc -> nvidia-video-sdk != null && nonfreeLicensing; stdenv.mkDerivation rec { name = "ffmpeg-full-${version}"; - version = "3.4.2"; + version = "4.0"; src = fetchurl { url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz"; - sha256 = "0h6prjn1ijkzzhkyj8mazp0wpx7m0n9ycadjxagf9czqirbyk4ib"; + sha256 = "0gx4ngnhi5glmxh38603qy5n6vq8bl1cr4sqd1xff95i82pmv57d"; }; prePatch = '' @@ -286,7 +287,6 @@ stdenv.mkDerivation rec { (enableFeature ffmpegProgram "ffmpeg") (enableFeature ffplayProgram "ffplay") (enableFeature ffprobeProgram "ffprobe") - (enableFeature ffserverProgram "ffserver") /* * Library flags */ @@ -365,7 +365,7 @@ stdenv.mkDerivation rec { #(enableFeature (opencv != null) "libopencv") (enableFeature openglExtlib "opengl") #(enableFeature (openh264 != null) "openh264") - (enableFeature (openjpeg_1 != null) "libopenjpeg") + (enableFeature (openjpeg != null) "libopenjpeg") (enableFeature (opensslExtlib && gplLicensing) "openssl") (enableFeature (libpulseaudio != null) "libpulse") #(enableFeature quvi "libquvi") @@ -404,14 +404,14 @@ stdenv.mkDerivation rec { bzip2 celt fontconfig freetype frei0r fribidi game-music-emu gnutls gsm libjack2 ladspaH lame libass libbluray libbs2b libcaca libdc1394 libmodplug libogg libopus libssh libtheora libvdpau libvorbis libvpx libwebp libX11 - libxcb libXv lzma openal openjpeg_1 libpulseaudio rtmpdump opencore-amr + libxcb libXv lzma openal openjpeg libpulseaudio rtmpdump opencore-amr samba SDL2 soxr speex vid-stab vo-amrwbenc wavpack x264 x265 xavs xvidcore zeromq4 zlib ] ++ optional openglExtlib libGLU_combined ++ optionals nonfreeLicensing [ fdk_aac openssl ] ++ optional ((isLinux || isFreeBSD) && libva != null) libva ++ optionals isLinux [ alsaLib libraw1394 libv4l ] - ++ optionals nvenc [ nvidia-video-sdk ] + ++ optionals nvenc [ nvidia-video-sdk nv-codec-headers ] ++ optionals stdenv.isDarwin [ Cocoa CoreServices CoreAudio AVFoundation MediaToolbox VideoDecodeAcceleration libiconv ]; diff --git a/pkgs/development/libraries/ffmpeg-full/nv-codec-headers.nix b/pkgs/development/libraries/ffmpeg-full/nv-codec-headers.nix new file mode 100644 index 000000000000..03599c91bf04 --- /dev/null +++ b/pkgs/development/libraries/ffmpeg-full/nv-codec-headers.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchgit }: + +stdenv.mkDerivation rec { + name = "nv-codec-headers-${version}"; + version = "n8.1.24.2"; + + src = fetchgit { + url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git"; + rev = "${version}"; + sha256 = "122i3f6whiz5yp44dhk73ifr1973z8vvfbg4216vb782bl8b5bam"; + }; + + makeFlags = [ "PREFIX=$(out)" ]; + + meta = { + description = "ffmpeg nvidia headers for NVENC"; + homepage = http://ffmpeg.org/; + license = stdenv.lib.licenses.gpl3Plus; + maintainers = [ stdenv.lib.maintainers.MP2E ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/libraries/ffmpeg/4.0.nix b/pkgs/development/libraries/ffmpeg/4.0.nix new file mode 100644 index 000000000000..a6e67052cd03 --- /dev/null +++ b/pkgs/development/libraries/ffmpeg/4.0.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, fetchpatch +# Darwin frameworks +, Cocoa, CoreMedia +, ... +}@args: + +callPackage ./generic.nix (args // rec { + version = "${branch}"; + branch = "4.0"; + sha256 = "1f3k8nz5ag6szsfhlrz66qm8s1yxk1vphqvcfr4ps4690vckk2ii"; + darwinFrameworks = [ Cocoa CoreMedia ]; +})