about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcodyopel <codyopel@gmail.com>2015-02-28 12:12:25 -0500
committercodyopel <codyopel@gmail.com>2015-02-28 12:12:25 -0500
commit6ed1d9f525643ca7087a1e9a85f80664a058c0dc (patch)
treedceb77bf7b21005ceaf77b55000ae4e09cf5321d
parentbd81885f706dae5cdeb8c03845fa43d8b74fa57c (diff)
downloadnixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar.gz
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar.bz2
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar.lz
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar.xz
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.tar.zst
nixlib-6ed1d9f525643ca7087a1e9a85f80664a058c0dc.zip
ffmpeg: refactor to generic
* migrate some branches from ffmpeg.config.<optional>, now allows version specific configuration
* Added optionals for most features
* Added qt-faststart executable
* Licensing corrections
* Added dependencies
    + celt
    + faad2
    + flite
    + frei0r-plugins
    + fribidi
    + game-music-emu
    + gsm
    + jack2
    + ladspa-sdk
    + libavc1394
    + libbluray
    + libbs2b
    + libcaca
    + libmodplug
    + libogg
    + libraw1394
    + libssh
    + libwebp
    + libxcb
    + lzma
    + openal
    + opencl
    + opengl
    + openh264
    + openjpeg
    + openssl
    + pulseaudio
    + rtmpdump
    + samba
    + soxr
    + v4l-utils
    + vid.stab
    + wavpack
    + libX11
    + libXv
    + wavpack
    + x265
    + xavs
    + xvidcore
    + zeromq
* Outlines support for: (unpackaged/broken dependencies)
    + aacplus
    + avisynth
    + crystalhd
    + blackmagic-design-desktop-video
    + flite
    + ilbc
    + libavc1394
    + libcdio-paranoia
    + libiec61883
    + libmfx
    + libnut
    + nvenc (nvidia)
    + opencl
    + opencore-amr
    + openh264
    + oss
    + libquvi
    + schroedinger
    + shine
    + twolame
    + utvideo
    + vo-aacenc
    + vo-amrwbenc
    + zvbi
-rw-r--r--pkgs/development/libraries/ffmpeg/0.10.nix93
-rw-r--r--pkgs/development/libraries/ffmpeg/0.11.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/0.5.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/0.6.90.nix78
-rw-r--r--pkgs/development/libraries/ffmpeg/0.6.nix78
-rw-r--r--pkgs/development/libraries/ffmpeg/1.2.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/1.x.nix109
-rw-r--r--pkgs/development/libraries/ffmpeg/2.2.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/2.2.x.nix109
-rw-r--r--pkgs/development/libraries/ffmpeg/2.5.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/2.x.nix108
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix527
-rw-r--r--pkgs/top-level/all-packages.nix40
13 files changed, 582 insertions, 595 deletions
diff --git a/pkgs/development/libraries/ffmpeg/0.10.nix b/pkgs/development/libraries/ffmpeg/0.10.nix
index 556a41e2dca9..bad142f6f96a 100644
--- a/pkgs/development/libraries/ffmpeg/0.10.nix
+++ b/pkgs/development/libraries/ffmpeg/0.10.nix
@@ -1,88 +1,7 @@
-{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
-, mp3Support ? true, lame ? null
-, speexSupport ? true, speex ? null
-, theoraSupport ? true, libtheora ? null
-, vorbisSupport ? true, libvorbis ? null
-, vpxSupport ? false, libvpx ? null
-, x264Support ? true, x264 ? null
-, xvidSupport ? true, xvidcore ? null
-, vdpauSupport ? true, libvdpau ? null
-, faacSupport ? false, faac ? null
-, dc1394Support ? false, libdc1394 ? null
-}:
+{ callPackage, ... } @ args:
 
-assert speexSupport -> speex != null;
-assert theoraSupport -> libtheora != null;
-assert vorbisSupport -> libvorbis != null;
-assert vpxSupport -> libvpx != null;
-assert x264Support -> x264 != null;
-assert xvidSupport -> xvidcore != null;
-assert vdpauSupport -> libvdpau != null;
-assert faacSupport -> faac != null;
-
-stdenv.mkDerivation rec {
-  name = "ffmpeg-0.10.15";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "0p9x559fpj4zxll7rn3kwdig6y66c3ahv3pddmz23lljq5rvyvcb";
-  };
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--disable-ffplay"
-    "--enable-shared"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
-    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394";
-
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional faacSupport faac
-    ++ stdenv.lib.optional dc1394Support libdc1394;
-
-  enableParallelBuilding = true;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  passthru = {
-    inherit vdpauSupport;
-  };
-
-  meta = with stdenv.lib; {
-    homepage    = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    maintainers = with maintainers; [ lovek323 ];
-    platforms   = platforms.unix;
-    branch = "0.10";
-  };
-}
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.15";
+  branch = "0.10";
+  sha256 = "0p9x559fpj4zxll7rn3kwdig6y66c3ahv3pddmz23lljq5rvyvcb";
+})
diff --git a/pkgs/development/libraries/ffmpeg/0.11.nix b/pkgs/development/libraries/ffmpeg/0.11.nix
new file mode 100644
index 000000000000..abdb26668770
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/0.11.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.5";
+  branch = "0.11";
+  sha256 = "1h5qwn4h7sppqw36hri5p6zlv2387vwaxh2pyj070xfn8hgrk4ll";
+})
diff --git a/pkgs/development/libraries/ffmpeg/0.5.nix b/pkgs/development/libraries/ffmpeg/0.5.nix
new file mode 100644
index 000000000000..82e0026ecbe4
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/0.5.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.15";
+  branch = "0.5";
+  sha256 = "1rcy15dv5bnpnncb78kgki9xl279bh99b76nzqdd87b61r04z74z";
+})
diff --git a/pkgs/development/libraries/ffmpeg/0.6.90.nix b/pkgs/development/libraries/ffmpeg/0.6.90.nix
deleted file mode 100644
index 7455410d51ac..000000000000
--- a/pkgs/development/libraries/ffmpeg/0.6.90.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, yasm
-, mp3Support ? true, lame ? null
-, speexSupport ? true, speex ? null
-, theoraSupport ? true, libtheora ? null
-, vorbisSupport ? true, libvorbis ? null
-, vpxSupport ? false, libvpx ? null
-, x264Support ? true, x264 ? null
-, xvidSupport ? true, xvidcore ? null
-, vdpauSupport ? true, libvdpau ? null
-, faacSupport ? false, faac ? null
-}:
-
-assert speexSupport -> speex != null;
-assert theoraSupport -> libtheora != null;
-assert vorbisSupport -> libvorbis != null;
-assert vpxSupport -> libvpx != null;
-assert x264Support -> x264 != null;
-assert xvidSupport -> xvidcore != null;
-assert vdpauSupport -> libvdpau != null;
-assert faacSupport -> faac != null;
-
-stdenv.mkDerivation rec {
-  name = "ffmpeg-0.6.90-rc0";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "1xn9fmpq2cbf1bx1gxbxnas8fq02gb8bmvvg5vjjxyw9lz5zw49f";
-  };
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--disable-ffserver"
-    "--disable-ffplay"
-    "--enable-shared"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree";
-
-  buildInputs = [ pkgconfig lame yasm ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional faacSupport faac;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  meta = {
-    homepage = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    broken = true;
-  };
-}
diff --git a/pkgs/development/libraries/ffmpeg/0.6.nix b/pkgs/development/libraries/ffmpeg/0.6.nix
deleted file mode 100644
index 79ab5f1c9800..000000000000
--- a/pkgs/development/libraries/ffmpeg/0.6.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, yasm
-, mp3Support ? true, lame ? null
-, speexSupport ? true, speex ? null
-, theoraSupport ? true, libtheora ? null
-, vorbisSupport ? true, libvorbis ? null
-, vpxSupport ? false, libvpx ? null
-, x264Support ? true, x264 ? null
-, xvidSupport ? true, xvidcore ? null
-, vdpauSupport ? true, libvdpau ? null
-, faacSupport ? false, faac ? null
-}:
-
-assert speexSupport -> speex != null;
-assert theoraSupport -> libtheora != null;
-assert vorbisSupport -> libvorbis != null;
-assert vpxSupport -> libvpx != null;
-assert x264Support -> x264 != null;
-assert xvidSupport -> xvidcore != null;
-assert vdpauSupport -> libvdpau != null;
-assert faacSupport -> faac != null;
-
-stdenv.mkDerivation rec {
-  name = "ffmpeg-0.6.7";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "13l78gv2qhyw05bl9s6wkmykzsn4p04bb69a849a5c4hiffwz837";
-  };
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--disable-ffserver"
-    "--disable-ffplay"
-    "--enable-shared"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree";
-
-  buildInputs = [ pkgconfig lame yasm ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional faacSupport faac;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  meta = {
-    homepage = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    branch = "0.6";
-  };
-}
diff --git a/pkgs/development/libraries/ffmpeg/1.2.nix b/pkgs/development/libraries/ffmpeg/1.2.nix
new file mode 100644
index 000000000000..c87cf581c76c
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/1.2.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.12";
+  branch = "1.2";
+  sha256 = "0za9w87rk4x6wkjc6iaxqx2ihlsgj181ilfgxfjc54mdgxfcjfli";
+})
diff --git a/pkgs/development/libraries/ffmpeg/1.x.nix b/pkgs/development/libraries/ffmpeg/1.x.nix
deleted file mode 100644
index ae64135a4c3b..000000000000
--- a/pkgs/development/libraries/ffmpeg/1.x.nix
+++ /dev/null
@@ -1,109 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2, alsaLib, texinfo, perl
-, mp3Support ? true, lame ? null
-, speexSupport ? true, speex ? null
-, theoraSupport ? true, libtheora ? null
-, vorbisSupport ? true, libvorbis ? null
-, vpxSupport ? false, libvpx ? null
-, x264Support ? true, x264 ? null
-, xvidSupport ? true, xvidcore ? null
-, opusSupport ? true, libopus ? null
-, vdpauSupport ? true, libvdpau ? null
-, vaapiSupport ? true, libva ? null
-, faacSupport ? false, faac ? null
-, dc1394Support ? false, libdc1394 ? null
-, x11grabSupport ? false, libXext ? null, libXfixes ? null
-, playSupport ? true, SDL ? null
-, freetypeSupport ? true, freetype ? null, fontconfig ? null
-}:
-
-assert speexSupport -> speex != null;
-assert theoraSupport -> libtheora != null;
-assert vorbisSupport -> libvorbis != null;
-assert vpxSupport -> libvpx != null;
-assert x264Support -> x264 != null;
-assert xvidSupport -> xvidcore != null;
-assert opusSupport -> libopus != null;
-assert vdpauSupport -> libvdpau != null;
-assert vaapiSupport -> libva != null;
-assert faacSupport -> faac != null;
-assert x11grabSupport -> libXext != null && libXfixes != null;
-assert playSupport -> SDL != null;
-assert freetypeSupport -> freetype != null;
-
-stdenv.mkDerivation rec {
-  version = "1.2.10";
-  name = "ffmpeg-${version}";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "02wdxr55a68rjxbyrsxczp55z2qmspw8cfa0yd55x3dv82657hnj";
-  };
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--enable-shared"
-    "--enable-avresample"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional opusSupport "--enable-libopus"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
-    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
-    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab"
-    ++ stdenv.lib.optional playSupport "--enable-ffplay"
-    ++ stdenv.lib.optional freetypeSupport "--enable-libfreetype --enable-fontconfig";
-
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 alsaLib texinfo perl ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional opusSupport libopus
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional vaapiSupport libva
-    ++ stdenv.lib.optional faacSupport faac
-    ++ stdenv.lib.optional dc1394Support libdc1394
-    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ]
-    ++ stdenv.lib.optional playSupport SDL
-    ++ stdenv.lib.optionals freetypeSupport [ freetype fontconfig ];
-
-  enableParallelBuilding = true;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  passthru = {
-    inherit vdpauSupport;
-  };
-
-  meta = {
-    homepage = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    license = if faacSupport then stdenv.lib.licenses.unfree else stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
-    platforms = stdenv.lib.platforms.unix;
-    branch = "1";
-  };
-}
diff --git a/pkgs/development/libraries/ffmpeg/2.2.nix b/pkgs/development/libraries/ffmpeg/2.2.nix
new file mode 100644
index 000000000000..e382fe7154de
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/2.2.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.13";
+  branch = "2.2";
+  sha256 = "1vva8ffwxi3rg44byy09qlbiqrrd1h4rmsl5b1mbmvzvwl1lq1l0";
+})
diff --git a/pkgs/development/libraries/ffmpeg/2.2.x.nix b/pkgs/development/libraries/ffmpeg/2.2.x.nix
deleted file mode 100644
index d6e3c6a7db9d..000000000000
--- a/pkgs/development/libraries/ffmpeg/2.2.x.nix
+++ /dev/null
@@ -1,109 +0,0 @@
-{ stdenv, fetchurl, config, pkgconfig, yasm, zlib, bzip2, alsaLib, texinfo, perl
-, lame, speex, libass, libtheora, libvorbis, libvpx, x264, xvidcore, libopus
-, libvdpau, libva, faac, libdc1394, libXext, libXfixes, SDL
-, freetype, fontconfig, fdk_aac, gnutls
-}:
-
-stdenv.mkDerivation rec {
-  version = "2.2.12";
-  name = "ffmpeg-${version}";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "1a1ki0v7c94l68blbimh3xl5adz599ql8nrdm2q0g285qy6mqxck";
-  };
-
-  subtitleSupport = config.ffmpeg.subtitle or true;
-  mp3Support = config.ffmpeg.mp3 or true;
-  speexSupport = config.ffmpeg.speex or true;
-  theoraSupport = config.ffmpeg.theora or true;
-  vorbisSupport = config.ffmpeg.vorbis or true;
-  vpxSupport = config.ffmpeg.vpx or true;
-  x264Support = config.ffmpeg.x264 or true;
-  xvidSupport = config.ffmpeg.xvid or true;
-  opusSupport = config.ffmpeg.opus or true;
-  vdpauSupport = config.ffmpeg.vdpau or true;
-  vaapiSupport = config.ffmpeg.vaapi or true;
-  faacSupport = config.ffmpeg.faac or false;
-  fdkAACSupport = config.ffmpeg.fdk or false;
-  dc1394Support = config.ffmpeg.dc1394 or false;
-  x11grabSupport = config.ffmpeg.x11grab or false;
-  playSupport = config.ffmpeg.play or true;
-  freetypeSupport = config.ffmpeg.freetype or true;
-  gnutlsSupport = config.ffmpeg.gnutls or true;
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--enable-shared"
-    "--enable-avresample"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin && subtitleSupport) "--enable-libass"
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional opusSupport "--enable-libopus"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
-    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
-    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab"
-    ++ stdenv.lib.optional (!stdenv.isDarwin && playSupport) "--enable-ffplay"
-    ++ stdenv.lib.optional freetypeSupport "--enable-libfreetype --enable-fontconfig"
-    ++ stdenv.lib.optional fdkAACSupport "--enable-libfdk_aac --enable-nonfree"
-    ++ stdenv.lib.optional gnutlsSupport "--enable-gnutls";
-
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 texinfo perl ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional opusSupport libopus
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional vaapiSupport libva
-    ++ stdenv.lib.optional faacSupport faac
-    ++ stdenv.lib.optional dc1394Support libdc1394
-    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin && playSupport) SDL
-    ++ stdenv.lib.optionals freetypeSupport [ freetype fontconfig ]
-    ++ stdenv.lib.optional fdkAACSupport fdk_aac
-    ++ stdenv.lib.optional gnutlsSupport gnutls
-    ++ stdenv.lib.optional (!stdenv.isDarwin && subtitleSupport) libass
-    ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
-
-  enableParallelBuilding = true;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  passthru = {
-    inherit vdpauSupport;
-  };
-
-  meta = {
-    homepage = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    license = if (fdkAACSupport || faacSupport) then stdenv.lib.licenses.unfree else stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-    branch = "2.2";
-  };
-}
diff --git a/pkgs/development/libraries/ffmpeg/2.5.nix b/pkgs/development/libraries/ffmpeg/2.5.nix
new file mode 100644
index 000000000000..dbd5e0e24032
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/2.5.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.4";
+  branch = "2.5";
+  sha256 = "11m2hbhdgphjxjp6hk438cxmipqjg5ixbr1kqnn9mbdhq9kc34fc";
+})
diff --git a/pkgs/development/libraries/ffmpeg/2.x.nix b/pkgs/development/libraries/ffmpeg/2.x.nix
deleted file mode 100644
index 55747061406c..000000000000
--- a/pkgs/development/libraries/ffmpeg/2.x.nix
+++ /dev/null
@@ -1,108 +0,0 @@
-{ stdenv, fetchurl, config, pkgconfig, yasm, zlib, bzip2, alsaLib, texinfo, perl
-, lame, speex, libass, libtheora, libvorbis, libvpx, x264, xvidcore, libopus
-, libvdpau, libva, faac, libdc1394, libXext, libXfixes, SDL
-, freetype, fontconfig, fdk_aac, gnutls
-}:
-
-stdenv.mkDerivation rec {
-  version = "2.5.4";
-  name = "ffmpeg-${version}";
-
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "11m2hbhdgphjxjp6hk438cxmipqjg5ixbr1kqnn9mbdhq9kc34fc";
-  };
-
-  subtitleSupport = config.ffmpeg.subtitle or true;
-  mp3Support = config.ffmpeg.mp3 or true;
-  speexSupport = config.ffmpeg.speex or true;
-  theoraSupport = config.ffmpeg.theora or true;
-  vorbisSupport = config.ffmpeg.vorbis or true;
-  vpxSupport = config.ffmpeg.vpx or true;
-  x264Support = config.ffmpeg.x264 or true;
-  xvidSupport = config.ffmpeg.xvid or true;
-  opusSupport = config.ffmpeg.opus or true;
-  vdpauSupport = config.ffmpeg.vdpau or true;
-  vaapiSupport = config.ffmpeg.vaapi or true;
-  faacSupport = config.ffmpeg.faac or false;
-  fdkAACSupport = config.ffmpeg.fdk or false;
-  dc1394Support = config.ffmpeg.dc1394 or false;
-  x11grabSupport = config.ffmpeg.x11grab or false;
-  playSupport = config.ffmpeg.play or true;
-  freetypeSupport = config.ffmpeg.freetype or true;
-  gnutlsSupport = config.ffmpeg.gnutls or true;
-
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--enable-shared"
-    "--enable-avresample"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin && subtitleSupport) "--enable-libass"
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional opusSupport "--enable-libopus"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
-    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
-    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab"
-    ++ stdenv.lib.optional (!stdenv.isDarwin && playSupport) "--enable-ffplay"
-    ++ stdenv.lib.optional freetypeSupport "--enable-libfreetype --enable-fontconfig"
-    ++ stdenv.lib.optional fdkAACSupport "--enable-libfdk_aac --enable-nonfree"
-    ++ stdenv.lib.optional gnutlsSupport "--enable-gnutls";
-
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 texinfo perl ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional opusSupport libopus
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional vaapiSupport libva
-    ++ stdenv.lib.optional faacSupport faac
-    ++ stdenv.lib.optional dc1394Support libdc1394
-    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin && playSupport) SDL
-    ++ stdenv.lib.optionals freetypeSupport [ freetype fontconfig ]
-    ++ stdenv.lib.optional fdkAACSupport fdk_aac
-    ++ stdenv.lib.optional gnutlsSupport gnutls
-    ++ stdenv.lib.optional (!stdenv.isDarwin && subtitleSupport) libass
-    ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
-
-  enableParallelBuilding = true;
-
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  passthru = {
-    inherit vdpauSupport;
-  };
-
-  meta = {
-    homepage = http://www.ffmpeg.org/;
-    description = "A complete, cross-platform solution to record, convert and stream audio and video";
-    license = if (fdkAACSupport || faacSupport) then stdenv.lib.licenses.unfree else stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-  };
-}
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
new file mode 100644
index 000000000000..fda9f8080a93
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -0,0 +1,527 @@
+{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
+/*
+ *  Licensing options (yes some are listed twice, filters and such are not listed)
+ */
+, gplLicensing ? true # GPL: fdkaac,openssl,frei0r,cdio,samba,utvideo,vidstab,x265,x265,xavs,avid,zvbi,x11grab
+, version3Licensing ? true # (L)GPL3: opencore-amrnb,opencore-amrwb,samba,vo-aacenc,vo-amrwbenc
+, nonfreeLicensing ? false # NONFREE: openssl,fdkaac,faac,aacplus,blackmagic-design-desktop-video
+/*
+ *  Build options
+ */
+, smallBuild ? false # Optimize for size instead of speed
+, runtime-cpudetectBuild ? true # Detect CPU capabilities at runtime (disable to compile natively)
+, grayBuild ? true # Full grayscale support
+, swscale-alphaBuild ? true # Alpha channel support in swscale
+, incompatible-libav-abiBuild ? false # Incompatible Libav fork ABI
+, hardcoded-tablesBuild ? true # Hardcode decode tables instead of runtime generation
+, safe-bitstream-readerBuild ? true # Buffer boundary checking in bitreaders
+, memalign-hackBuild ? false # Emulate memalign
+, multithreadBuild ? true # Multithreading via pthreads/win32 threads
+, networkBuild ? true # Network support
+, pixelutilsBuild ? true # Pixel utils in libavutil
+/*
+ *  Program options
+ */
+, ffmpegProgram ? true # Build ffmpeg executable
+, ffplayProgram ? true # Build ffplay executable
+, ffprobeProgram ? true # Build ffprobe executable
+, ffserverProgram ? true # Build ffserver executable
+, qt-faststartProgram ? true # Build qt-faststart executable
+/*
+ *  Library options
+ */
+, avcodecLibrary ? true # Build avcodec library
+, avdeviceLibrary ? true # Build avdevice library
+, avfilterLibrary ? true # Build avfilter library
+, avformatLibrary ? true # Build avformat library
+, avresampleLibrary ? true # Build avresample library
+, avutilLibrary ? true # Build avutil library
+, postprocLibrary ? true # Build postproc library
+, swresampleLibrary ? true # Build swresample library
+, swscaleLibrary ? true # Build swscale library
+/*
+ *  Documentation options
+ */
+, htmlpagesDocumentation ? false # HTML documentation pages
+, manpagesDocumentation ? true # Man documentation pages
+, podpagesDocumentation ? false # POD documentation pages
+, txtpagesDocumentation ? false # Text documentation pages
+/*
+ *  External libraries options
+ */
+#, aacplusExtlib ? false, aacplus ? null # AAC+ encoder
+, alsaLib ? null # Alsa in/output support
+#, avisynth ? null # Support for reading AviSynth scripts
+, bzip2 ? null
+, celt ? null # CELT decoder
+#, crystalhd ? null # Broadcom CrystalHD hardware acceleration
+#, decklinkExtlib ? false, blackmagic-design-desktop-video ? null # Blackmagic Design DeckLink I/O support
+, faacExtlib ? false, faac ? null # AAC encoder
+, faad2Extlib ? false, faad2 ? null # AAC decoder - DEPRECATED
+, fdk-aacExtlib ? false, fdk_aac ? null # Fraunhofer FDK AAC de/encoder
+#, flite ? null # Flite (voice synthesis) support
+, fontconfig ? null # Needed for drawtext filter
+, freetype ? null # Needed for drawtext filter
+, frei0r ? null # frei0r video filtering
+, fribidi ? null # Needed for drawtext filter
+, game-music-emu ? null # Game Music Emulator
+, gnutls ? null
+, gsm ? null # GSM de/encoder
+#, ilbc ? null # iLBC de/encoder
+, jack2 ? null # Jack audio (only version 2 is supported in this build)
+, ladspaH ? null # LADSPA audio filtering
+, lame ? null # LAME MP3 encoder
+, libass ? null # (Advanced) SubStation Alpha subtitle rendering
+, libbluray ? null # BluRay reading
+, libbs2b ? null # bs2b DSP library
+, libcaca ? null # Textual display (ASCII art)
+#, libcdio-paranoia ? null # Audio CD grabbing
+, libdc1394 ? null, libraw1394 ? null # IIDC-1394 grabbing (ieee 1394)
+, libiconv ? null
+#, libiec61883 ? null, libavc1394 ? null # iec61883 (also uses libraw1394)
+#, libmfx ? null # Hardware acceleration vis libmfx
+, libmodplug ? null # ModPlug support
+#, libnut ? null # NUT (de)muxer, native (de)muser exists
+, libogg ? null # Ogg container used by vorbis & theora
+, libopus ? null # Opus de/encoder
+, libsndio ? null # sndio playback/record support
+, libssh ? null # SFTP protocol
+, libtheora ? null # Theora encoder
+, libva ? null # Vaapi hardware acceleration
+, libvdpau ? null # Vdpau hardware acceleration
+, libvorbis ? null # Vorbis de/encoding, native encoder exists
+, libvpx ? null # VP8 & VP9 de/encoding
+, libwebp ? null # WebP encoder
+, libX11 ? null # Xlib support
+, libxcb ? null # X11 grabbing using XCB
+, libxcb-shmExtlib ? true # X11 grabbing shm communication
+, libxcb-xfixesExtlib ? true # X11 grabbing mouse rendering
+, libxcb-shapeExtlib ? true # X11 grabbing shape rendering
+, libXv ? null # Xlib support
+, lzma ? null # xz-utils
+#, nvenc ? null # NVIDIA NVENC support
+, 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, mesa ? null # OpenGL rendering
+#, openh264 ? null # H.264/AVC encoder
+, openjpeg_1 ? null # JPEG 2000 de/encoder
+, opensslExtlib ? false, openssl ? null
+, pulseaudio ? null # Pulseaudio input support
+, rtmpdump ? null # RTMP[E] support
+#, libquvi ? null # Quvi input support
+, sambaExtlib ? false, samba ? null # Samba protocol
+#, schroedinger ? null # Dirac de/encoder
+, SDL ? null
+#, shine ? null # Fixed-point MP3 encoder
+, soxr ? null # Resampling via soxr
+, speex ? null # Speex de/encoder
+#, twolame ? null # MP2 encoder
+#, utvideo ? null # Ut Video de/encoder
+, v4l_utils ? null # Video 4 Linux support
+, vid-stab ? null # Video stabilization
+#, vo-aacenc ? null # AAC encoder
+#, vo-amrwbenc ? null # AMR-WB encoder
+, wavpack ? null # Wavpack encoder
+, x11grabExtlib ? false, libXext ? null, libXfixes ? null # X11 grabbing (legacy)
+, x264 ? null # H.264/AVC encoder
+, x265 ? null # H.265/HEVC encoder
+, xavs ? null # AVS encoder
+, xvidcore ? null # Xvid encoder, native encoder exists
+, zeromq4 ? null # Message passing
+, zlib ? null
+#, zvbi ? null # Teletext support
+/*
+ *  Developer options
+ */
+, debugDeveloper ? false
+, optimizationsDeveloper ? true
+, extra-warningsDeveloper ? false
+, strippingDeveloper ? false
+/*
+ *  Inherit generics
+ */
+, branch, sha256, version, ...
+}:
+
+/* Maintainer notes:
+ *
+ * Version bumps:
+ * It should always be safe to bump patch releases (e.g. 2.1.x, x being a patch release)
+ * If adding a new branch, note any configure flags that were added, changed, or deprecated/removed
+ *   and make the necessary changes.
+ *
+ * En/disabling in/outdevs was added in 0.6
+ *
+ * Packages with errors:
+ *   flite ilbc schroedinger
+ *
+ * Not packaged:
+ *   aacplus avisynth cdio-paranoia crystalhd libavc1394 libiec61883
+ *   libmxf libnut libquvi nvenc opencl opencore-amr openh264 oss shine twolame
+ *   utvideo vo-aacenc vo-amrwbenc xvmc zvbi blackmagic-design-desktop-video
+ *
+ * Not supported:
+ *   stagehright-h264(android only)
+ *
+ * Known issues:
+ * 0.5     - libgsm: configure fails to find library (fix: disable for 0.5)
+ * 0.5-0.8 - qt-quickstart: make error (fix: disable for 0.5-0.8)
+ * 0.6     - fails to compile (unresolved) (so far, only disabling a number of features
+ *           works, but that is not a feasible solution)
+ * 0.6.90  - mmx: compile errors (fix: disable for 0.6.90-rc0)
+ * 0.7-1.1 - opencv: compile error, flag added in 0.7 (fix: disable for 0.7-1.1)
+ * 1.1     - libsoxr: compile error (fix: disable for 1.1)
+ *           Support was initially added in 1.1 before soxr api change, fix would probably be to add soxr-1.0
+ * 2.0-2.1 - vid-stab: compile errors, flag added in 2.0 (fix: disable for 2.0-2.1)
+ *           Recent changes (circa 2014) more than likely broke compatibility and a fix has not been back ported
+ * ALL     - flite: configure fails to find library (tested against 1.4 & 1.9 & 2.0)
+ *           Tried modifying configure and flite to use pkg-config
+ * ALL     - Cross-compiling will disable features not present on host OS
+ *           (e.g. dxva2 support [DirectX] will not be enabled unless natively compiled on Cygwin)
+ *
+ */
+
+let
+  # Minimum/maximun/matching version
+  cmpVer = builtins.compareVersions;
+  reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
+  reqMax = requiredVersion: (cmpVer branch requiredVersion != 1);
+  reqMatch = requiredVersion: (cmpVer requiredVersion branch == 0);
+
+  # Configure flag
+  mkFlag = optSet: minVer: flag: if reqMin minVer then (
+                                   if optSet then "--enable-${flag}" else "--disable-${flag}")
+                                 else null;
+  # Deprecated configure flag (e.g. faad2)
+  depFlag = optSet: minVer: maxVer: flag: if reqMin minVer && reqMax maxVer then mkFlag optSet minVer flag else null;
+
+  # Version specific fix
+  verFix = withoutFix: fixVer: withFix: if reqMatch fixVer then withFix else withoutFix;
+
+  # Flag change between versions (e.g. "--enable-armvfp" -> "--enable-vfp" changed in v1.1)
+  chgFlg = chgVer: oldFlag: newFlag: if reqMin chgVer then newFlag else oldFlag;
+
+  isCygwin = stdenv.isCygwin;
+in
+
+/*
+ *  Licensing dependencies
+ */
+assert version3Licensing && reqMin "0.5" -> gplLicensing;
+assert nonfreeLicensing && reqMin "0.5" -> gplLicensing && version3Licensing;
+/*
+ *  Build dependencies
+ */
+assert networkBuild -> gnutls != null || opensslExtlib;
+assert pixelutilsBuild -> avutilLibrary;
+/*
+ *  Program dependencies
+ */
+assert ffmpegProgram && reqMin "0.5" -> avcodecLibrary
+                                     && avfilterLibrary
+                                     && avformatLibrary
+                                     && swresampleLibrary;
+assert ffplayProgram && reqMin "0.5" -> avcodecLibrary
+                                     && avformatLibrary
+                                     && swscaleLibrary
+                                     && swresampleLibrary
+                                     && SDL != null;
+assert ffprobeProgram && reqMin "0.6" -> avcodecLibrary && avformatLibrary;
+assert ffserverProgram && reqMin "0.5" -> avformatLibrary;
+/*
+ *  Library dependencies
+ */
+assert avcodecLibrary && reqMin "0.6" -> avutilLibrary; # configure flag since 0.6
+assert avdeviceLibrary && reqMin "0.6" -> avformatLibrary
+                                       && avcodecLibrary
+                                       && avutilLibrary; # configure flag since 0.6
+assert avformatLibrary && reqMin "0.6" -> avcodecLibrary && avutilLibrary; # configure flag since 0.6
+assert avresampleLibrary && reqMin "0.11" -> avutilLibrary;
+assert postprocLibrary && reqMin "0.5" -> gplLicensing && avutilLibrary;
+assert swresampleLibrary && reqMin "0.9" -> soxr != null;
+assert swscaleLibrary && reqMin "0.5" -> avutilLibrary;
+/*
+ *  External libraries
+ */
+#assert aacplusExtlib && reqMin "0.7" -> nonfreeLicensing;
+#assert cdio-paranoia != null && reqMin "0.9" -> gplLicensing;
+#assert decklinkExtlib && reqMin "2.2" -> blackmagic-design-desktop-video != null
+#                                       && !isCygwin && multithreadBuild # POSIX threads required
+#                                       && nonfreeLicensing;
+assert faacExtlib && reqMin "0.5" -> faac != null && nonfreeLicensing;
+assert fdk-aacExtlib && reqMin "1.0" -> fdk_aac != null && gplLicensing && nonfreeLicensing;
+assert frei0r != null && reqMin "0.7" -> gplLicensing;
+assert gnutls != null && reqMin "0.9" -> !opensslExtlib;
+assert libxcb-shmExtlib && reqMin "2.5" -> libxcb != null;
+assert libxcb-xfixesExtlib && reqMin "2.5" -> libxcb != null;
+assert libxcb-shapeExtlib && reqMin "2.5" -> libxcb != null;
+#assert opencore-amr != null && reqMin "0.5" -> version3Licensing;
+assert openglExtlib && reqMin "2.2" -> mesa != null;
+assert opensslExtlib && reqMin "0.9" -> gnutls == null && openssl != null && gplLicensing && nonfreeLicensing;
+assert sambaExtlib && reqMin "2.3" -> samba != null && gplLicensing && version3Licensing;
+#assert utvideo != null && reqMin "0.9" -> gplLicensing;
+assert vid-stab != null && reqMin "2.0" -> gplLicensing;
+#assert vo-aacenc != null && reqMin "0.6" -> version3Licensing;
+#assert vo-amrwbenc != null && reqMin "0.7" -> version3Licensing;
+assert x11grabExtlib && reqMin "0.5" -> libX11 != null && libXv != null && gplLicensing;
+assert x264 != null && reqMin "0.5" -> gplLicensing;
+assert x265 != null && reqMin "2.2" -> gplLicensing;
+assert xavs != null && reqMin "0.7" -> gplLicensing;
+assert xvidcore != null && reqMin "0.5" -> gplLicensing;
+#assert zvbi != null && reqMin "2.1" -> gplLicensing;
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+
+  name = "ffmpeg-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.ffmpeg.org/releases/${name}.tar.bz2";
+    inherit sha256;
+  };
+
+  patchPhase = ''patchShebangs .'';
+
+  configureFlags = [
+    /*
+     *  Licensing flags
+     */
+    (mkFlag gplLicensing "0.5" "gpl")
+    (mkFlag version3Licensing "0.5" "version3")
+    (mkFlag nonfreeLicensing "0.5" "nonfree")
+    /*
+     *  Build flags
+     */
+    # One some ARM platforms --enable-thumb
+    "--enable-shared --disable-static"
+    (mkFlag true "0.6" "pic")
+    (mkFlag smallBuild "0.5" "small")
+    (mkFlag runtime-cpudetectBuild "0.5" "runtime-cpudetect")
+    (mkFlag grayBuild "0.5" "gray")
+    (mkFlag swscale-alphaBuild "0.6" "swscale-alpha")
+    (mkFlag incompatible-libav-abiBuild "2.0" "incompatible-libav-abi")
+    (mkFlag hardcoded-tablesBuild "0.5" "hardcoded-tables")
+    (mkFlag safe-bitstream-readerBuild "0.9" "safe-bitstream-reader")
+    (mkFlag memalign-hackBuild "0.5" "memalign-hack")
+    (if reqMin "0.5" then (
+       if multithreadBuild then (
+         if isCygwin then
+           "--disable-pthreads --enable-w32threads"
+         else # Use POSIX threads by default
+           "--enable-pthreads --disable-w32threads")
+       else
+         "--disable-pthreads --disable-w32threads")
+     else null)
+    (if reqMin "0.9" then "--disable-os2threads" else null) # We don't support OS/2
+    (mkFlag networkBuild "0.5" "network")
+    (mkFlag pixelutilsBuild "2.4" "pixelutils")
+    /*
+     *  Program flags
+     */
+    (mkFlag ffmpegProgram "0.5" "ffmpeg")
+    (mkFlag ffplayProgram "0.5" "ffplay")
+    (mkFlag ffprobeProgram "0.6" "ffprobe")
+    (mkFlag ffserverProgram "0.5" "ffserver")
+    /*
+     *  Library flags
+     */
+    (mkFlag avcodecLibrary "0.6" "avcodec")
+    (mkFlag avdeviceLibrary "0.6" "avdevice")
+    (mkFlag avfilterLibrary "0.5" "avfilter")
+    (mkFlag avformatLibrary "0.6" "avformat")
+    (mkFlag avresampleLibrary "1.0" "avresample")
+    (mkFlag avutilLibrary "1.1" "avutil")
+    (mkFlag postprocLibrary "0.5" "postproc")
+    (mkFlag swresampleLibrary "0.9" "swresample")
+    (mkFlag swscaleLibrary "0.5" "swscale")
+    /*
+     *  Documentation flags
+     */
+    (mkFlag (htmlpagesDocumentation
+          || manpagesDocumentation
+          || podpagesDocumentation
+          || txtpagesDocumentation) "0.6" "doc")
+    (mkFlag htmlpagesDocumentation "1.0" "htmlpages")
+    (mkFlag manpagesDocumentation "1.0" "manpages")
+    (mkFlag podpagesDocumentation "1.0" "podpages")
+    (mkFlag txtpagesDocumentation "1.0" "txtpages")
+    /*
+     *  External libraries
+     */
+    #(mkFlag aacplus      "0.7" "libaacplus")
+    #(mkFlag avisynth     "0.5" "avisynth")
+    (mkFlag (bzip2 != null) "0.5" "bzlib")
+    (mkFlag (celt != null) "0.8" "libcelt")
+    #crystalhd
+    #(mkFlag decklinkExtlib "2.2" "decklink")
+    (mkFlag faacExtlib "0.5" "libfaac")
+    (depFlag faad2Extlib "0.5" "0.6" "libfaad")
+    (mkFlag fdk-aacExtlib "1.0" "libfdk-aac")
+    #(mkFlag (flite != null) "1.0" "libflite")
+    (if reqMin "1.0" then # Force disable until a solution is found
+      "--disable-libflite"
+     else null)
+    (mkFlag (fontconfig != null) "1.0" "fontconfig")
+    (mkFlag (freetype != null) "0.7" "libfreetype")
+    (mkFlag (frei0r != null) "0.7" "frei0r")
+    (mkFlag (fribidi != null) "2.3" "libfribidi")
+    (mkFlag (game-music-emu != null) "2.2" "libgme")
+    (mkFlag (gnutls != null) "0.9" "gnutls")
+    (verFix (mkFlag (gsm != null) "0.5" "libgsm") "0.5" "--disable-libgsm")
+    #(mkFlag (ilbc != null) "1.0" "libilbc")
+    (mkFlag (ladspaH !=null) "2.1" "ladspa")
+    (mkFlag (lame != null) "0.5" "libmp3lame")
+    (mkFlag (libass != null) "0.9" "libass")
+    #(mkFlag (libavc1394 != null) null null)
+    (mkFlag (libbluray != null) "1.0" "libbluray")
+    (mkFlag (libbs2b != null) "2.3" "libbs2b")
+    (mkFlag (libcaca != null) "1.0" "libcaca")
+    #(mkFlag (cdio-paranoia != null) "0.9" "libcdio")
+    (mkFlag (libdc1394 != null && libraw1394 != null) "0.5" "libdc1394")
+    (mkFlag (libiconv != null) "1.2" "iconv")
+    #(mkFlag (libiec61883 != null && libavc1394 != null && libraw1394 != null) "1.0" "libiec61883")
+    (mkFlag (libmfz != null) "2.6" "libmfx")
+    (mkFlag (libmodplug != null) "0.9" "libmodplug")
+    #(mkFlag (libnut != null) "0.5" "libnut")
+    (mkFlag (libopus != null) "1.0" "libopus")
+    (mkFlag (libssh != null) "2.1" "libssh")
+    (mkFlag (libtheora != null) "0.5" "libtheora")
+    (mkFlag (libva != null) "0.6" "vaapi")
+    (mkFlag (libvdpau != null) "0.5" "vdpau")
+    (mkFlag (libvorbis != null) "0.5" "libvorbis")
+    (mkFlag (libvpx != null) "0.6" "libvpx")
+    (mkFlag (libwebp != null) "2.2" "libwebp")
+    (mkFlag (libX11 != null && libXv != null) "2.3" "xlib")
+    (mkFlag (libxcb != null) "2.5" "libxcb")
+    (mkFlag libxcb-shmExtlib "2.5" "libxcb-shm")
+    (mkFlag libxcb-xfixesExtlib "2.5" "libxcb-xfixes")
+    (mkFlag libxcb-shapeExtlib "2.5" "libxcb-shape")
+    (mkFlag (lzma != null) "2.4" "lzma")
+    #(mkFlag nvenc        "2.6" "nvenc")
+    (mkFlag (openal != null) "0.9" "openal")
+    #(mkFlag opencl       "2.2" "opencl")
+    #(mkFlag (opencore-amr != null) "0.5" "libopencore-amrnb")
+    #(mkFlag (opencore-amr != null) "0.5" "libopencore-amrwb")
+    (mkFlag (opencv != null) "1.1" "libopencv") # Actual min. version 0.7
+    (mkFlag openglExtlib "2.2" "opengl")
+    #(mkFlag (openh264 != null) "2.6" "openh264")
+    (mkFlag (openjpeg_1 != null) "0.5" "libopenjpeg")
+    (mkFlag opensslExtlib "0.9" "openssl")
+    (mkFlag (pulseaudio != null) "0.9" "libpulse")
+    #(mkFlag quvi         "2.0" "libquvi")
+    (mkFlag (rtmpdump != null) "0.6" "librtmp")
+    #(mkFlag (schroedinger != null) "0.5" "libschroedinger")
+    #(mkFlag (shine != null) "2.0" "libshine")
+    (mkFlag sambaExtlib "2.3" "libsmbclient")
+    (mkFlag (SDL != null) "2.5" "sdl") # Only configurable since 2.5, auto detected before then
+    (mkFlag (soxr != null) "1.2" "libsoxr")
+    (mkFlag (speex != null) "0.5" "libspeex")
+    #(mkFlag (twolame != null) "1.0" "libtwolame")
+    #(mkFlag (utvideo != null) "0.9" "libutvideo")
+    (mkFlag (v4l_utils != null) "0.9" "libv4l2")
+    (mkFlag (vid-stab != null) "2.2" "libvidstab") # Actual min. version 2.0
+    #(mkFlag (vo-aacenc != null) "0.6" "libvo-aacenc")
+    #(mkFlag (vo-amrwbenc) "0.7" "libvo-amrwbenc")
+    (mkFlag (wavpack != null) "2.0" "libwavpack")
+    (mkFlag (x11grabExtlib) "0.5" "x11grab")
+    (mkFlag (x264 != null) "0.5" "libx264")
+    (mkFlag (x265 != null) "2.2" "libx265")
+    (mkFlag (xavs != null) "0.7" "libxavs")
+    (mkFlag (xvidcore != null) "0.5" "libxvid")
+    (mkFlag (zeromq4 != null) "2.0" "libzmq")
+    (mkFlag (zlib != null) "0.5" "zlib")
+    #(mkFlag (zvbi != null) "2.1" "libzvbi")
+    /*
+     * Developer flags
+     */
+    (mkFlag debugDeveloper "0.5" "debug")
+    (mkFlag optimizationsDeveloper "0.5" "optimizations")
+    (mkFlag extra-warningsDeveloper "0.5" "extra-warnings")
+    (mkFlag strippingDeveloper "0.5" "stripping")
+    
+    # Disable mmx support for 0.6.90
+    (verFix null "0.6.90" "--disable-mmx")
+  ];
+
+  nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
+
+  buildInputs = [
+    alsaLib bzip2 celt faac faad2 fdk_aac fontconfig freetype frei0r fribidi
+    game-music-emu gnutls gsm jack2 ladspaH lame libass libbluray libbs2b
+    libcaca libdc1394 libmodplug libogg libopus libraw1394 libssh libtheora
+    libva libvdpau libvpx libvorbis libwebp libX11 libxcb libXext libXfixes
+    libXv lzma mesa openal opencv openjpeg_1 openssl pulseaudio rtmpdump
+    samba SDL soxr speex v4l_utils vid-stab wavpack x264 x265 xavs xvidcore
+    zeromq4 zlib
+  ];
+
+  # Build qt-faststart executable
+  buildPhase = optional (qt-faststartProgram && (reqMin "0.9")) ''make tools/qt-faststart'';
+  postInstall = optional (qt-faststartProgram && (reqMin "0.9")) ''cp -a tools/qt-faststart $out/bin/'';
+
+  enableParallelBuilding = true;
+
+  /* Cross-compilation is untested, consider this an outline, more work
+     needs to be done to portions of the build to get it to work correctly */
+  crossAttrs = let
+    os = ''
+      if [ "${stdenv.cross.config}" = "*cygwin*" ] ; then
+        # Probably should look for mingw too
+        echo "cygwin"
+      elif [ "${stdenv.cross.config}" = "*darwin*" ] ; then
+        echo "darwin"
+      elif [ "${stdenv.cross.config}" = "*freebsd*" ] ; then
+        echo "freebsd"
+      elif [ "${stdenv.cross.config}" = "*linux*" ] ; then
+        echo "linux"
+      elif [ "${stdenv.cross.config}" = "*netbsd*" ] ; then
+        echo "netbsd"
+      elif [ "${stdenv.cross.config}" = "*openbsd*" ] ; then
+        echo "openbsd"
+      fi
+    '';
+  in {
+    dontSetConfigureCross = true;
+    configureFlags = configureFlags ++ [
+      "--cross-prefix=${stdenv.cross.config}-"
+      "--enable-cross-compile"
+      "--target_os=${os}"
+      "--arch=${stdenv.cross.arch}"
+    ];
+  };
+
+  /* TODO: In the future more FFmpeg optionals should be added so that packages that
+     depend on FFmpeg can check to make sure a required feature is enabled.  Since
+     features are version dependent, versioning needs to be handled as well */
+  passthru = {
+    vdpauSupport = libvdpau != null;
+  };
+
+  meta = {
+    description = "A complete, cross-platform solution to record, convert and stream audio and video";
+    homepage = http://www.ffmpeg.org/;
+    longDescription = ''
+      FFmpeg is the leading multimedia framework, able to decode, encode, transcode, 
+      mux, demux, stream, filter and play pretty much anything that humans and machines 
+      have created. It supports the most obscure ancient formats up to the cutting edge. 
+      No matter if they were designed by some standards committee, the community or 
+      a corporation. 
+    '';
+    licenses = (
+      if nonfreeLicensing then
+        licenses.unfreeRedistributable
+      else if version3Licensing then
+        licenses.gpl3
+      else if gplLicensing then
+        licenses.gpl2Plus
+      else
+        licenses.lgpl21Plus
+    );
+    platforms = platforms.all;
+    maintainers = with maintainers; [ codyopel fuuzetsu ];
+    inherit branch;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4f00392005f6..3e536441a7d4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1313,7 +1313,7 @@ let
   ftop = callPackage ../os-specific/linux/ftop { };
 
   fuppes = callPackage ../tools/networking/fuppes {
-    ffmpeg = ffmpeg_0_6_90;
+    ffmpeg = ffmpeg_0_5;
   };
 
   fsfs = callPackage ../tools/filesystems/fsfs { };
@@ -1709,7 +1709,7 @@ let
   makebootfat = callPackage ../tools/misc/makebootfat { };
 
   minidlna = callPackage ../tools/networking/minidlna {
-    ffmpeg = ffmpeg_0_10;
+    ffmpeg = ffmpeg_0;
   };
 
   mmv = callPackage ../tools/misc/mmv { };
@@ -5486,26 +5486,16 @@ let
 
   fcgi = callPackage ../development/libraries/fcgi { };
 
-  ffmpeg_0_6 = callPackage ../development/libraries/ffmpeg/0.6.nix {
-    vpxSupport = !stdenv.isMips;
-  };
-
-  ffmpeg_0_6_90 = callPackage ../development/libraries/ffmpeg/0.6.90.nix {
-    vpxSupport = !stdenv.isMips;
-  };
-
-  ffmpeg_0_10 = callPackage ../development/libraries/ffmpeg/0.10.nix {
-    vpxSupport = !stdenv.isMips;
-  };
-
-  ffmpeg_1 = callPackage ../development/libraries/ffmpeg/1.x.nix {
-    vpxSupport = !stdenv.isMips;
-  };
-
-  ffmpeg_2_2 = callPackage ../development/libraries/ffmpeg/2.2.x.nix { };
-
-  ffmpeg_2 = callPackage ../development/libraries/ffmpeg/2.x.nix { };
-
+  ffmpeg_0_5 = callPackage ../development/libraries/ffmpeg/0.5.nix { };
+  ffmpeg_0_10 = callPackage ../development/libraries/ffmpeg/0.10.nix { };
+  ffmpeg_0_11 = callPackage ../development/libraries/ffmpeg/0.11.nix { };
+  ffmpeg_1_2 = callPackage ../development/libraries/ffmpeg/1.2.nix { };
+  ffmpeg_2_2 = callPackage ../development/libraries/ffmpeg/2.2.nix { };
+  ffmpeg_2_5 = callPackage ../development/libraries/ffmpeg/2.5.nix { };
+  # Aliases
+  ffmpeg_0 = ffmpeg_0_11;
+  ffmpeg_1 = ffmpeg_1_2;
+  ffmpeg_2 = ffmpeg_2_5;
   ffmpeg = ffmpeg_2;
 
   ffms = callPackage ../development/libraries/ffms { };
@@ -7560,9 +7550,7 @@ let
 
   xdo = callPackage ../tools/misc/xdo { };
 
-  xineLib = callPackage ../development/libraries/xine-lib {
-    ffmpeg = ffmpeg_1;
-  };
+  xineLib = callPackage ../development/libraries/xine-lib { };
 
   xautolock = callPackage ../misc/screensavers/xautolock { };
 
@@ -12492,7 +12480,7 @@ let
   ultimatestunts = callPackage ../games/ultimatestunts { };
 
   ultrastardx = callPackage ../games/ultrastardx {
-    ffmpeg = ffmpeg_0_6;
+    ffmpeg = ffmpeg_0_5;
     lua = lua5;
   };