about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/video')
-rw-r--r--nixpkgs/pkgs/applications/video/aegisub/default.nix131
-rw-r--r--nixpkgs/pkgs/applications/video/avidemux/bootstrap_logging.patch26
-rw-r--r--nixpkgs/pkgs/applications/video/avidemux/default.nix99
-rw-r--r--nixpkgs/pkgs/applications/video/avidemux/dynamic_install_dir.patch12
-rw-r--r--nixpkgs/pkgs/applications/video/avxsynth/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/video/bino3d/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/video/bombono/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/video/bomi/default.nix118
-rw-r--r--nixpkgs/pkgs/applications/video/byzanz/add-amflags.patch12
-rw-r--r--nixpkgs/pkgs/applications/video/byzanz/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/video/catt/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/video/ccextractor/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/video/celluloid/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/video/cinelerra/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/video/clickshare-csc1/default.nix124
-rw-r--r--nixpkgs/pkgs/applications/video/clipgrab/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/video/coriander/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/video/devede/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/video/dvb-apps/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/video/dvd-slideshow/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/video/dvdauthor/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-automake-1.13.patch10
-rw-r--r--nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-mga-strndup.patch24
-rw-r--r--nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-imagemagick-0.7.0.patch11
-rw-r--r--nixpkgs/pkgs/applications/video/dvdbackup/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/video/dvdstyler/default.nix85
-rw-r--r--nixpkgs/pkgs/applications/video/ffmpeg-normalize/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/video/gnome-mplayer/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/video/gnome-mplayer/fix-paths.patch87
-rw-r--r--nixpkgs/pkgs/applications/video/gnomecast/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/video/gpac/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/video/handbrake/default.nix142
-rw-r--r--nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/video/jftui/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/video/k9copy/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/video/k9copy/gcc6.patch26
-rw-r--r--nixpkgs/pkgs/applications/video/kazam/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/video/kazam/fix-paths.patch22
-rw-r--r--nixpkgs/pkgs/applications/video/kino/default.nix95
-rw-r--r--nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patch60
-rw-r--r--nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patch57
-rw-r--r--nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patch11
-rw-r--r--nixpkgs/pkgs/applications/video/kino/kino-1.3.4-v4l1.patch21
-rw-r--r--nixpkgs/pkgs/applications/video/kmplayer/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/video/kmplayer/kmplayer_part-plugin_metadata.patch11
-rw-r--r--nixpkgs/pkgs/applications/video/kmplayer/no-docs.patch12
-rw-r--r--nixpkgs/pkgs/applications/video/kodi/default.nix295
-rw-r--r--nixpkgs/pkgs/applications/video/kodi/plugins.nix552
-rw-r--r--nixpkgs/pkgs/applications/video/kodi/wrapper.nix30
-rw-r--r--nixpkgs/pkgs/applications/video/kodi/yatp/dont-monkey.patch29
-rw-r--r--nixpkgs/pkgs/applications/video/lightworks/default.nix87
-rw-r--r--nixpkgs/pkgs/applications/video/linuxstopmotion/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch33
-rw-r--r--nixpkgs/pkgs/applications/video/lxdvdrip/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/video/makemkv/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/video/manim/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/video/manim/remove-dependency-constraints.patch26
-rw-r--r--nixpkgs/pkgs/applications/video/mapmap/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/video/mediathekview/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/video/minitube/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/video/mjpg-streamer/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/video/mkclean/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/video/mkvtoolnix/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/video/mlv-app/aarch64-flags.patch13
-rw-r--r--nixpkgs/pkgs/applications/video/mlv-app/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/video/motion/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/video/mpc-qt/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/video/mplayer/default.nix226
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/default.nix237
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/scripts/convert.nix43
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/scripts/convert.patch67
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/scripts/mpris.nix39
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix33
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/wrapper.nix83
-rw-r--r--nixpkgs/pkgs/applications/video/mythtv/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/video/mythtv/disable-os-detection.patch51
-rw-r--r--nixpkgs/pkgs/applications/video/mythtv/exiv2.patch19
-rw-r--r--nixpkgs/pkgs/applications/video/natron/config.pri20
-rw-r--r--nixpkgs/pkgs/applications/video/natron/default.nix129
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/default.nix107
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/fix-search-path.patch13
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/hardcode-ndi-path.patch17
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/linuxbrowser.nix49
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/obs-ndi.nix41
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/v4l2sink.nix55
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix42
-rw-r--r--nixpkgs/pkgs/applications/video/ogmtools/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/video/olive-editor/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/video/omxplayer/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/video/openshot-qt/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/video/openshot-qt/libopenshot-audio.nix35
-rw-r--r--nixpkgs/pkgs/applications/video/openshot-qt/libopenshot.nix51
-rw-r--r--nixpkgs/pkgs/applications/video/p2pvc/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/video/peek/default.nix78
-rw-r--r--nixpkgs/pkgs/applications/video/pitivi/default.nix81
-rw-r--r--nixpkgs/pkgs/applications/video/pitivi/prevent-closure-contamination.patch23
-rw-r--r--nixpkgs/pkgs/applications/video/plex-media-player/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/video/plex-media-player/deps.nix28
-rwxr-xr-xnixpkgs/pkgs/applications/video/plex-media-player/update.sh71
-rw-r--r--nixpkgs/pkgs/applications/video/plex-mpv-shim/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/video/pyca/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/video/qarte/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/video/qmediathekview/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/video/qstopmotion/default.nix82
-rw-r--r--nixpkgs/pkgs/applications/video/quvi/library.nix22
-rw-r--r--nixpkgs/pkgs/applications/video/quvi/scripts.nix21
-rw-r--r--nixpkgs/pkgs/applications/video/quvi/tool.nix25
-rw-r--r--nixpkgs/pkgs/applications/video/screenkey/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/video/screenkey/paths.patch20
-rw-r--r--nixpkgs/pkgs/applications/video/shotcut/0001-encodedock.cpp-connect-to-VAAPI-via-DRM-not-X11.patch33
-rw-r--r--nixpkgs/pkgs/applications/video/shotcut/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/video/simplescreenrecorder/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/video/simplescreenrecorder/fix-paths.patch35
-rw-r--r--nixpkgs/pkgs/applications/video/smplayer/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/video/smtube/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/video/streamlink/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/video/subdl/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/video/subtitleeditor/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/video/tartube/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/video/tivodecode/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/video/uvccapture/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/video/vdr/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/video/vdr/plugins.nix338
-rw-r--r--nixpkgs/pkgs/applications/video/vdr/wrapper.nix30
-rw-r--r--nixpkgs/pkgs/applications/video/vdr/xineliboutput/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/video/vlc/default.nix103
-rw-r--r--nixpkgs/pkgs/applications/video/vokoscreen/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/video/vokoscreen/ffmpeg-out-of-box.patch24
-rw-r--r--nixpkgs/pkgs/applications/video/w_scan/default.nix19
-rw-r--r--nixpkgs/pkgs/applications/video/webcamoid/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/video/wf-recorder/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/video/wxcam/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/video/xawtv/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/video/xine-ui/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/video/xscast/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/video/xvidcap/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/video/xvidcap/xlib.patch15
138 files changed, 7713 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/video/aegisub/default.nix b/nixpkgs/pkgs/applications/video/aegisub/default.nix
new file mode 100644
index 000000000000..64c7dc20f355
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/aegisub/default.nix
@@ -0,0 +1,131 @@
+{ config
+, stdenv
+, fetchurl
+, fetchpatch
+, libX11
+, wxGTK
+, libiconv
+, fontconfig
+, freetype
+, libGLU
+, libGL
+, libass
+, fftw
+, ffms
+, ffmpeg_3
+, pkg-config
+, zlib
+, icu
+, boost
+, intltool
+
+, spellcheckSupport ? true
+, hunspell ? null
+
+, automationSupport ? true
+, lua ? null
+
+, openalSupport ? false
+, openal ? null
+
+, alsaSupport ? stdenv.isLinux
+, alsaLib ? null
+
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
+, libpulseaudio ? null
+
+, portaudioSupport ? false
+, portaudio ? null
+}:
+
+assert spellcheckSupport -> (hunspell != null);
+assert automationSupport -> (lua != null);
+assert openalSupport -> (openal != null);
+assert alsaSupport -> (alsaLib != null);
+assert pulseaudioSupport -> (libpulseaudio != null);
+assert portaudioSupport -> (portaudio != null);
+
+with stdenv.lib;
+stdenv.mkDerivation
+ rec {
+  pname = "aegisub";
+  version = "3.2.2";
+
+  src = fetchurl {
+    url = "http://ftp.aegisub.org/pub/releases/${pname}-${version}.tar.xz";
+    sha256 = "11b83qazc8h0iidyj1rprnnjdivj1lpphvpa08y53n42bfa36pn5";
+  };
+
+  patches = [
+    # Compatibility with ICU 59
+    (fetchpatch {
+      url = "https://github.com/Aegisub/Aegisub/commit/dd67db47cb2203e7a14058e52549721f6ff16a49.patch";
+      sha256 = "07qqlckiyy64lz8zk1as0vflk9kqnjb340420lp9f0xj93ncssj7";
+    })
+
+    # Compatbility with Boost 1.69
+    (fetchpatch {
+      url = "https://github.com/Aegisub/Aegisub/commit/c3c446a8d6abc5127c9432387f50c5ad50012561.patch";
+      sha256 = "1n8wmjka480j43b1pr30i665z8hdy6n3wdiz1ls81wyv7ai5yygf";
+    })
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+  ];
+
+  buildInputs = with stdenv.lib; [
+    libX11
+    wxGTK
+    fontconfig
+    freetype
+    libGLU
+    libGL
+    libass
+    fftw
+    ffms
+    ffmpeg_3
+    zlib
+    icu
+    boost
+    libiconv
+  ]
+    ++ optional spellcheckSupport hunspell
+    ++ optional automationSupport lua
+    ++ optional openalSupport openal
+    ++ optional alsaSupport alsaLib
+    ++ optional pulseaudioSupport libpulseaudio
+    ++ optional portaudioSupport portaudio
+    ;
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "bindnow" "relro" ];
+
+  # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
+  CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ];
+
+  # this is fixed upstream though not yet in an officially released version,
+  # should be fine remove on next release (if one ever happens)
+  NIX_LDFLAGS = "-lpthread";
+
+  postInstall = "ln -s $out/bin/aegisub-* $out/bin/aegisub";
+
+  meta = {
+    description = "An advanced subtitle editor";
+    longDescription = ''
+      Aegisub is a free, cross-platform open source tool for creating and
+      modifying subtitles. Aegisub makes it quick and easy to time subtitles to
+      audio, and features many powerful tools for styling them, including a
+      built-in real-time video preview.
+    '';
+    homepage = "http://www.aegisub.org/";
+    # The Aegisub sources are itself BSD/ISC,
+    # but they are linked against GPL'd softwares
+    # - so the resulting program will be GPL
+    license = licenses.bsd3;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/avidemux/bootstrap_logging.patch b/nixpkgs/pkgs/applications/video/avidemux/bootstrap_logging.patch
new file mode 100644
index 000000000000..8f45251d26c2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/avidemux/bootstrap_logging.patch
@@ -0,0 +1,26 @@
+diff --git a/bootStrap.bash b/bootStrap.bash
+index 646a5e048..6429199ba 100644
+--- a/bootStrap.bash
++++ b/bootStrap.bash
+@@ -4,6 +4,7 @@
+ #
+ # By default we use qt5 now
+ #
++set -e # hard fail if something fails
+ packages_ext=""
+ rebuild=0
+ do_core=1
+@@ -66,10 +67,10 @@ Process()
+         fi
+         cd $BUILDDIR 
+         cmake $COMPILER $PKG $FAKEROOT $QT_FLAVOR -DCMAKE_EDIT_COMMAND=vim $INSTALL_PREFIX $EXTRA $BUILD_QUIRKS $ASAN $DEBUG -G "$BUILDER" $SOURCEDIR || fail cmakeZ
+-        make  $PARAL >& /tmp/log$BUILDDIR || fail "make, result in /tmp/log$BUILDDIR"
+-	if  [ "x$PKG" != "x" ] ; then
++        make  $PARAL
++        if  [ "x$PKG" != "x" ] ; then
+           $FAKEROOT_COMMAND make package DESTDIR=$FAKEROOT_DIR/tmp || fail package
+-	fi
++        fi
+         # we need the make install so that other packcges can be built against this one
+         make install DESTDIR=$FAKEROOT_DIR
+ }
diff --git a/nixpkgs/pkgs/applications/video/avidemux/default.nix b/nixpkgs/pkgs/applications/video/avidemux/default.nix
new file mode 100644
index 000000000000..9374d2dbc790
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/avidemux/default.nix
@@ -0,0 +1,99 @@
+{ stdenv, lib, fetchurl, cmake, pkgconfig
+, zlib, gettext, libvdpau, libva, libXv, sqlite
+, yasm, freetype, fontconfig, fribidi
+, makeWrapper, libXext, libGLU, qttools, qtbase, wrapQtAppsHook
+, alsaLib
+, withX265 ? true, x265
+, withX264 ? true, x264
+, withXvid ? true, xvidcore
+, withLAME ? true, lame
+, withFAAC ? false, faac
+, withVorbis ? true, libvorbis
+, withPulse ? true, libpulseaudio
+, withFAAD ? true, faad2
+, withOpus ? true, libopus
+, withVPX ? true, libvpx
+, withQT ? true
+, withCLI ? true
+, default ? "qt5"
+, withPlugins ? true
+}:
+
+assert withQT -> qttools != null && qtbase != null;
+assert default != "qt5" -> default == "cli";
+assert !withQT -> default != "qt5";
+
+stdenv.mkDerivation rec {
+  pname = "avidemux";
+  version = "2.7.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/avidemux/avidemux/${version}/avidemux_${version}.tar.gz";
+    sha256 = "1acdb3m37vdzzbm8mwyibcn8msi7birb5v30qfi7jli5r00src3x";
+  };
+
+  patches = [
+    ./dynamic_install_dir.patch
+    ./bootstrap_logging.patch
+  ];
+
+  nativeBuildInputs =
+    [ yasm cmake pkgconfig ]
+    ++ lib.optional withQT wrapQtAppsHook;
+  buildInputs = [
+    zlib gettext libvdpau libva libXv sqlite fribidi fontconfig
+    freetype alsaLib libXext libGLU makeWrapper
+  ] ++ lib.optional withX264 x264
+    ++ lib.optional withX265 x265
+    ++ lib.optional withXvid xvidcore
+    ++ lib.optional withLAME lame
+    ++ lib.optional withFAAC faac
+    ++ lib.optional withVorbis libvorbis
+    ++ lib.optional withPulse libpulseaudio
+    ++ lib.optional withFAAD faad2
+    ++ lib.optional withOpus libopus
+    ++ lib.optionals withQT [ qttools qtbase ]
+    ++ lib.optional withVPX libvpx;
+
+  buildCommand = let
+    qtVersion = "5.${stdenv.lib.versions.minor qtbase.version}";
+    wrapWith = makeWrapper: filename:
+      "${makeWrapper} ${filename} --set ADM_ROOT_DIR $out --prefix LD_LIBRARY_PATH : ${libXext}/lib";
+    wrapQtApp = wrapWith "wrapQtApp";
+    wrapProgram = wrapWith "wrapProgram";
+  in ''
+    unpackPhase
+    cd "$sourceRoot"
+    patchPhase
+
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libXext}/lib"
+    ${stdenv.shell} bootStrap.bash \
+      --with-core \
+      ${if withQT then "--with-qt" else "--without-qt"} \
+      ${if withCLI then "--with-cli" else "--without-cli"} \
+      ${if withPlugins then "--with-plugins" else "--without-plugins"}
+
+    mkdir $out
+    cp -R install/usr/* $out
+
+    ${wrapProgram "$out/bin/avidemux3_cli"}
+
+    ${stdenv.lib.optionalString withQT ''
+      ${wrapQtApp "$out/bin/avidemux3_qt5"}
+      ${wrapQtApp "$out/bin/avidemux3_jobs_qt5"}
+    ''}
+
+    ln -s "$out/bin/avidemux3_${default}" "$out/bin/avidemux"
+
+    fixupPhase
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://fixounet.free.fr/avidemux/";
+    description = "Free video editor designed for simple video editing tasks";
+    maintainers = with maintainers; [ abbradar ma27 ];
+    # "CPU not supported" errors on AArch64
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/avidemux/dynamic_install_dir.patch b/nixpkgs/pkgs/applications/video/avidemux/dynamic_install_dir.patch
new file mode 100644
index 000000000000..803cde02ec2e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/avidemux/dynamic_install_dir.patch
@@ -0,0 +1,12 @@
+diff -ru3 avidemux_2.6.15-old/avidemux_core/ADM_core/src/ADM_folder_linux.cpp avidemux_2.6.15/avidemux_core/ADM_core/src/ADM_folder_linux.cpp
+--- avidemux_2.6.15-old/avidemux_core/ADM_core/src/ADM_folder_linux.cpp	2016-11-23 02:13:41.406566362 +0300
++++ avidemux_2.6.15/avidemux_core/ADM_core/src/ADM_folder_linux.cpp	2016-11-23 02:14:33.433566147 +0300
+@@ -92,7 +92,7 @@
+ 
+ char *ADM_getInstallRelativePath(const char *base1, const char *base2, const char *base3)
+ {
+-	return ADM_getRelativePath(ADM_INSTALL_DIR, base1, base2, base3);
++	return ADM_getRelativePath(getenv("ADM_ROOT_DIR"), base1, base2, base3);
+ }
+ const std::string ADM_getI8NDir(const std::string &flavor)
+ {
diff --git a/nixpkgs/pkgs/applications/video/avxsynth/default.nix b/nixpkgs/pkgs/applications/video/avxsynth/default.nix
new file mode 100644
index 000000000000..e818ef585c17
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/avxsynth/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+, cairo, ffmpeg_3, ffms, libjpeg, log4cpp, pango
+, avxeditSupport ? false, qt4 ? null
+}:
+
+let
+  inherit (stdenv.lib) enableFeature optional;
+in
+
+stdenv.mkDerivation {
+  pname = "avxsynth";
+  version = "2015-04-07";
+
+  src = fetchFromGitHub {
+    owner = "avxsynth";
+    repo = "avxsynth";
+    rev = "80dcb7ec8d314bc158130c92803308aa8e5e9242";
+    sha256 = "0kckggvgv68b0qjdi7ms8vi97b46dl63n60qr96d2w67lf2nk87z";
+  };
+
+  configureFlags = [
+    "--enable-autocrop"
+    "--enable-framecapture"
+    "--enable-subtitle"
+    "--enable-ffms2"
+    (enableFeature avxeditSupport "avxedit")
+    "--with-jpeg=${libjpeg.out}/lib"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = [ cairo ffmpeg_3 ffms libjpeg log4cpp pango ]
+    ++ optional avxeditSupport qt4;
+
+  meta = with stdenv.lib; {
+    description = "A script system that allows advanced non-linear editing";
+    homepage = "https://github.com/avxsynth/avxsynth";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ codyopel ];
+    platforms = platforms.linux;
+    broken = true; # 2018-04-10
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/bino3d/default.nix b/nixpkgs/pkgs/applications/video/bino3d/default.nix
new file mode 100644
index 000000000000..4554bea61571
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/bino3d/default.nix
@@ -0,0 +1,25 @@
+{ mkDerivation, lib, fetchurl, pkgconfig, ffmpeg, glew, libass, openal, qtbase }:
+
+mkDerivation rec {
+  pname = "bino";
+  version = "1.6.7";
+
+  src = fetchurl {
+    url = "https://bino3d.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "04yl7ibnhajlli4a5x77az8jxbzw6b2wjay8aa6px551nmiszn9k";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ ffmpeg glew libass openal qtbase ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Stereoscopic 3D and multi-display video player";
+    homepage = "https://bino3d.org/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/bombono/default.nix b/nixpkgs/pkgs/applications/video/bombono/default.nix
new file mode 100644
index 000000000000..2ae3722fff2e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/bombono/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchFromGitHub, wrapGAppsHook, gtk2, boost, gtkmm2, scons,
+mjpegtools, libdvdread, dvdauthor, gettext, dvdplusrwtools, libxmlxx, ffmpeg_3,
+enca, pkgconfig, fetchpatch }:
+
+let fetchPatchFromAur = {name, sha256}:
+fetchpatch {
+  inherit name sha256;
+  url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=e6cc6bc80c672aaa1a2260abfe8823da299a192c";
+}; in
+stdenv.mkDerivation rec {
+  pname = "bombono";
+  version = "1.2.4";
+  src = fetchFromGitHub {
+    owner = "muravjov";
+    repo = "bombono-dvd";
+    rev = version;
+    sha256 = "1lz1vik6abn1i1pvxhm55c9g47nxxv755wb2ijszwswwrwgvq5b9";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "bombono-dvd-1.2.4-scons3.patch";
+      url = "https://svnweb.mageia.org/packages/cauldron/bombono-dvd/current/SOURCES/bombono-dvd-1.2.4-scons-python3.patch?revision=1447925&view=co&pathrev=1484457";
+      sha256 = "081116d0if6s2r1rgqfr1n5gl3kpvzk01pf4v2k7gg2rnid83qp4";
+    })
+  ] ++ (map fetchPatchFromAur [
+    {name="fix_ffmpeg_codecid.patch";         sha256="1asfc0lqzk4gjssrvjmsi1xr53ygnsx2sh7c8yzp5r3j2bagxhp7";}
+    {name="fix_ptr2bool_cast.patch";          sha256="0iqzrmbg38ikh4x9cmx0v0rnm7a9lcq0kd8sh1z9yfmnz71qqahg";}
+    {name="fix_c++11_literal_warnings.patch"; sha256="1zbf12i77p0j0090pz5lzg4a7kyahahzqssybv7vi0xikwvw57w9";}
+    {name="autoptr2uniqueptr.patch";          sha256="0a3wvwfplmqvi8fnj929y85z3h1iq7baaz2d4v08h1q2wbmakqdm";}
+    {name="fix_deprecated_boost_api.patch";   sha256="184gdz3w95ihhsd8xscpwvq77xd4il47kvmv6wslax77xyw50gm8";}
+    {name="fix_throw_specifications.patch";   sha256="1f5gi3qwm843hsxvijq7sjy0s62xm7rnr1vdp7f242fi0ldq6c1n";}
+    {name="fix_operator_ambiguity.patch";     sha256="0r4scsbsqfg6wgzsbfxxpckamvgyrida0n1ypg1klx24pk5dc7n7";}
+    {name="fix_ffmpeg30.patch";               sha256="1irva7a9bpbzs60ga8ypa3la9y84i5rz20jnd721qmfqp2yip8dw";}
+  ]);
+
+  nativeBuildInputs = [ wrapGAppsHook scons pkgconfig gettext ];
+
+  buildInputs = [
+    gtk2 gtkmm2 mjpegtools libdvdread dvdauthor boost dvdplusrwtools
+    libxmlxx ffmpeg_3 enca
+    ];
+
+  prefixKey = "PREFIX=";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "a DVD authoring program for personal computers";
+    homepage = "http://www.bombono.org/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ symphorien ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/bomi/default.nix b/nixpkgs/pkgs/applications/video/bomi/default.nix
new file mode 100644
index 000000000000..d812ac488742
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/bomi/default.nix
@@ -0,0 +1,118 @@
+{ mkDerivation, config, stdenv, fetchFromGitHub
+, fetchpatch, pkgconfig, perl, python, which
+, libX11, libxcb, libGLU, libGL
+, qtbase, qtdeclarative, qtquickcontrols, qttools, qtx11extras, qmake
+, libchardet
+, ffmpeg
+
+, mpg123
+, libass
+, libdvdread
+, libdvdnav
+, icu
+, libquvi
+, alsaLib
+, libvdpau, libva
+, libbluray
+, jackSupport ? false, jack ? null
+, portaudioSupport ? false, portaudio ? null
+, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
+, cddaSupport ? false, libcdda ? null
+, youtubeSupport ? true, youtube-dl ? null
+}:
+
+with stdenv.lib;
+
+assert jackSupport -> jack != null;
+assert portaudioSupport -> portaudio != null;
+assert pulseSupport -> libpulseaudio != null;
+assert cddaSupport -> libcdda != null;
+assert youtubeSupport -> youtube-dl != null;
+
+mkDerivation rec {
+  pname = "bomi";
+  version = "0.9.11";
+
+  src = fetchFromGitHub {
+    owner = "xylosper";
+    repo = "bomi";
+    rev = "v${version}";
+    sha256 = "0a7n46gn3n5098lxxvl3s29s8jlkzss6by9074jx94ncn9cayf2h";
+  };
+
+  patches = [
+    (fetchpatch rec {
+      name = "bomi-compilation-fix.patch";
+      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
+      sha256 = "1dwryya5ljx35dbx6ag9d3rjjazni2mfn3vwirjdijdy6yz22jm6";
+    })
+    (fetchpatch rec {
+      name = "bomi-fix-expected-unqualified-id-before-numeric-constant-unix.patch";
+      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
+      sha256 = "0n3xsrdrggimzw30gxlnrr088ndbdjqlqr46dzmfv8zan79lv5ri";
+    })
+  ];
+
+  buildInputs = with stdenv.lib;
+                [ libX11
+                  libxcb
+                  libGLU libGL
+                  qtbase
+                  qtx11extras
+                  qtdeclarative
+                  qtquickcontrols
+                  ffmpeg
+                  libchardet
+
+                  mpg123
+                  libass
+                  libdvdread
+                  libdvdnav
+                  icu
+                  libquvi
+                  alsaLib
+                  libvdpau
+                  libva
+                  libbluray
+                ]
+                ++ optional jackSupport jack
+                ++ optional portaudioSupport portaudio
+                ++ optional pulseSupport libpulseaudio
+                ++ optional cddaSupport libcdda
+                ;
+
+  preConfigure = ''
+    patchShebangs configure
+  '';
+
+  preBuild = ''
+    patchShebangs src/mpv/waf
+    patchShebangs build-mpv
+  '';
+
+  dontWrapQtApps = true;
+  postInstall = ''
+    wrapQtApp $out/bin/bomi \
+      ${optionalString youtubeSupport "--prefix PATH ':' '${youtube-dl}/bin'"}
+  '';
+
+  dontUseQmakeConfigure = true;
+
+  configureFlags = with stdenv.lib;
+                   [ "--qmake=qmake" ]
+                   ++ optional jackSupport "--enable-jack"
+                   ++ optional portaudioSupport "--enable-portaudio"
+                   ++ optional pulseSupport "--enable-pulseaudio"
+                   ++ optional cddaSupport "--enable-cdda"
+                   ;
+
+  nativeBuildInputs = [ pkgconfig perl python which qttools qmake ];
+
+  meta = with stdenv.lib; {
+    description = "Powerful and easy-to-use multimedia player";
+    homepage = "https://bomi-player.github.io/";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.abbradar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/byzanz/add-amflags.patch b/nixpkgs/pkgs/applications/video/byzanz/add-amflags.patch
new file mode 100644
index 000000000000..aeaa195798a4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/byzanz/add-amflags.patch
@@ -0,0 +1,12 @@
+diff --git a/Makefile.am b/Makefile.am
+index 6eedb51..7b54313 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,5 +1,7 @@
+ SUBDIRS = macros data gifenc src po
+ 
++ACLOCAL_AMFLAGS = -I macros
++
+ EXTRA_DIST = \
+ 	MAINTAINERS \
+ 	depcomp \
diff --git a/nixpkgs/pkgs/applications/video/byzanz/default.nix b/nixpkgs/pkgs/applications/video/byzanz/default.nix
new file mode 100644
index 000000000000..f5d40a5c34cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/byzanz/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchgit, wrapGAppsHook, which, gnome3, glib, intltool, pkgconfig, libtool, cairo, gtk3, gst_all_1, xorg }:
+
+stdenv.mkDerivation {
+  version = "0.2.3.alpha";
+  pname = "byzanz";
+
+  src = fetchgit {
+    url = "git://github.com/GNOME/byzanz";
+    rev = "1875a7f6a3903b83f6b1d666965800f47db9286a";
+    sha256 = "0a72fw2mxl8vdcdnzy0bwis4jk28pd7nc8qgr4vhyw5pd48dynvh";
+  };
+
+  patches = [ ./add-amflags.patch ];
+
+  preBuild = ''
+    ./autogen.sh --prefix=$out
+  '';
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ which gnome3.gnome-common glib intltool libtool cairo gtk3 xorg.xwininfo ]
+  ++ (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good gst-plugins-ugly gst-libav wrapGAppsHook ]);
+
+  meta = with stdenv.lib; {
+    description = "Tool to record a running X desktop to an animation suitable for presentation in a web browser";
+    homepage = "https://github.com/GNOME/byzanz";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/catt/default.nix b/nixpkgs/pkgs/applications/video/catt/default.nix
new file mode 100644
index 000000000000..7f2b85511518
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/catt/default.nix
@@ -0,0 +1,31 @@
+{ buildPythonApplication, fetchPypi, lib
+, youtube-dl
+, PyChromecast
+, click
+, ifaddr
+, requests
+}:
+
+buildPythonApplication rec {
+  pname = "catt";
+  version = "0.11.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1vq1wg79b7855za6v6bsfgypm0v3b4wakap4rash45mhzbgjj0kq";
+  };
+
+  propagatedBuildInputs = [
+    youtube-dl PyChromecast click ifaddr requests
+  ];
+
+  doCheck = false; # attempts to access various URLs
+
+  meta = with lib; {
+    description = "Cast All The Things allows you to send videos from many, many online sources to your Chromecast";
+    homepage = "https://github.com/skorokithakis/catt";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/video/ccextractor/default.nix b/nixpkgs/pkgs/applications/video/ccextractor/default.nix
new file mode 100644
index 000000000000..91c47516521e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/ccextractor/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, pkgconfig, cmake
+, glew, glfw3, leptonica, libiconv, tesseract3, zlib }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  pname = "ccextractor";
+  version = "0.88";
+
+  src = fetchFromGitHub {
+    owner = "CCExtractor";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1sya45hvv4d46bk7541yimmafgvgyhkpsvwfz9kv6pm4yi1lz6nb";
+  };
+
+  sourceRoot = "source/src";
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+
+  buildInputs = [ glew glfw3 leptonica tesseract3 zlib ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
+
+  meta = {
+    homepage = "https://www.ccextractor.org";
+    description = "Tool that produces subtitles from closed caption data in videos";
+    longDescription = ''
+      A tool that analyzes video files and produces independent subtitle files from
+      closed captions data. CCExtractor is portable, small, and very fast.
+      It works on Linux, Windows, and OSX.
+    '';
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/celluloid/default.nix b/nixpkgs/pkgs/applications/video/celluloid/default.nix
new file mode 100644
index 000000000000..208cbb7f4e6a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/celluloid/default.nix
@@ -0,0 +1,64 @@
+{ stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, python3
+, gettext
+, pkgconfig
+, desktop-file-utils
+, wrapGAppsHook
+, appstream-glib
+, epoxy
+, glib
+, gtk3
+, mpv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "celluloid";
+  version = "0.19";
+
+  src = fetchFromGitHub {
+    owner = "celluloid-player";
+    repo = "celluloid";
+    rev = "v${version}";
+    sha256 = "1jdmwljckajqb3ys8azd1nyy49nvq9kb2knrrqdcfnvzq0m5lpqr";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    python3
+    appstream-glib
+    gettext
+    pkgconfig
+    desktop-file-utils
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    epoxy
+    glib
+    gtk3
+    mpv
+  ];
+
+  postPatch = ''
+    patchShebangs meson-post-install.py src/generate-authors.py
+  '';
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Simple GTK frontend for the mpv video player";
+    longDescription = ''
+      GNOME MPV interacts with mpv via the client API exported by libmpv,
+      allowing access to mpv's powerful playback capabilities through an
+      easy-to-use user interface.
+    '';
+    homepage = "https://github.com/celluloid-player/celluloid";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ worldofpeace ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/cinelerra/default.nix b/nixpkgs/pkgs/applications/video/cinelerra/default.nix
new file mode 100644
index 000000000000..22533b182a0f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/cinelerra/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool
+, pkgconfig, faad2, faac, a52dec, alsaLib, fftw, lame, libavc1394
+, libiec61883, libraw1394, libsndfile, libvorbis, libogg, libjpeg
+, libtiff, freetype, mjpegtools, x264, gettext, openexr
+, libXext, libXxf86vm, libXv, libXi, libX11, libXft, xorgproto, libtheora, libpng
+, libdv, libuuid, file, nasm, perl
+, fontconfig, intltool }:
+
+stdenv.mkDerivation {
+  name = "cinelerra-cv-2018-05-16";
+
+  src = fetchFromGitHub {
+    owner = "ratopi";
+    repo = "CinelerraCV";
+    rev = "d9c0dbf4393717f0a42f4b91c3e1ed5b16f955dc";
+    sha256 = "0a8kfm1v96sv6jh4568crg6nkr6n3579i9xksfj8w199s6yxzsbk";
+  };
+
+  preConfigure = ''
+    find -type f -print0 | xargs --null sed -e "s@/usr/bin/perl@${perl}/bin/perl@" -i
+    ./autogen.sh
+    sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure
+  '';
+
+  ## fix bug with parallel building
+  preBuild = ''
+    make -C cinelerra versioninfo.h
+  '';
+  enableParallelBuilding = true;
+
+  buildInputs =
+    [ automake
+      autoconf libtool pkgconfig file
+      faad2 faac
+      a52dec alsaLib   fftw lame libavc1394 libiec61883
+      libraw1394 libsndfile libvorbis libogg libjpeg libtiff freetype
+      mjpegtools x264 gettext openexr
+      libXext libXxf86vm libXv libXi libX11 libXft xorgproto
+      libtheora libpng libdv libuuid
+      nasm
+      perl
+      fontconfig intltool
+    ];
+
+  meta = {
+    description = "Video Editor";
+    homepage = "http://www.cinelerra.org";
+    maintainers = [ stdenv.lib.maintainers.marcweber ];
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/clickshare-csc1/default.nix b/nixpkgs/pkgs/applications/video/clickshare-csc1/default.nix
new file mode 100644
index 000000000000..e4e72704fb0b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/clickshare-csc1/default.nix
@@ -0,0 +1,124 @@
+{ lib
+, stdenv
+, fetchurl
+, alsaLib
+, autoPatchelfHook
+, binutils-unwrapped
+, gnutar
+, libav_0_8
+, libnotify
+, libresample
+, libusb1
+, qt4
+, rpmextract
+, unzip
+, xorg
+, usersGroup ? "clickshare"  # for udev access rules
+}:
+
+
+# This fetches the latest firmware version that
+# contains a linux-compatible client binary.
+# Barco no longer supports linux, so updates are unlikely:
+# https://www.barco.com/de/support/clickshare-csc-1/knowledge-base/KB1191
+
+
+stdenv.mkDerivation rec {
+  pname = "clickshare-csc1";
+  version = "01.07.00.033";
+  src = fetchurl {
+    name = "clickshare-csc1-${version}.zip";
+    url = "https://www.barco.com/services/website/de/TdeFiles/Download?FileNumber=R33050020&TdeType=3&MajorVersion=01&MinorVersion=07&PatchVersion=00&BuildVersion=033";
+    sha256 = "0h4jqidqvk4xkaky5bizi7ilz4qzl2mh68401j21y3djnzx09br3";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    binutils-unwrapped
+    gnutar
+    rpmextract
+    unzip
+  ];
+  buildInputs = [
+    alsaLib
+    libav_0_8
+    libnotify
+    libresample
+    libusb1
+    qt4
+    xorg.libX11
+    xorg.libXdamage
+    xorg.libXfixes
+    xorg.libXinerama
+    xorg.libXtst
+  ];
+  sourceRoot = ".";
+
+  # The source consists of nested archives.
+  # We extract them archive by archive.
+  # If the filename contains version numbers,
+  # we use a wildcard and check that there
+  # is actually only one file matching.
+  postUnpack =
+    let
+      rpmArch =
+        if stdenv.hostPlatform.isx86_32 then "i386" else
+        if stdenv.hostPlatform.isx86_64 then "x86_64" else
+        throw "unsupported system: ${stdenv.hostPlatform.system}";
+    in
+      ''
+        ls clickshare_baseunit_*.*_all.signed_release.ipk | wc --lines | xargs test 1 =
+        tar --verbose --extract --one-top-level=dir1 < clickshare_baseunit_*.*_all.signed_release.ipk
+        mkdir dir2
+        ( cd dir2 ; ar xv ../dir1/firmware.ipk )
+        tar --verbose --gzip --extract --one-top-level=dir3 --exclude='dev/*' < dir2/data.tar.gz
+        ls dir3/clickshare/clickshare-*-*.${rpmArch}.rpm | wc --lines | xargs test 1 =
+        mkdir dir4
+        cd dir4
+        rpmextract ../dir3/clickshare/clickshare-*-*.${rpmArch}.rpm
+      '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir --verbose --parents $out
+    mv --verbose --target-directory=. usr/*
+    rmdir --verbose usr
+    cp --verbose --recursive --target-directory=$out *
+    runHook postInstall
+  '';
+
+  # Default udev rule restricts access to the
+  # clickshare USB dongle to the `wheel` group.
+  # We replace it with the group
+  # stated in the package arguments.
+  # Also, we patch executable and icon paths in .desktop files.
+  preFixup = ''
+    substituteInPlace \
+        $out/lib/udev/rules.d/99-clickshare.rules \
+        --replace wheel ${usersGroup}
+    substituteInPlace \
+        $out/share/applications/clickshare.desktop \
+        --replace Exec= Exec=$out/bin/ \
+        --replace =/usr =$out
+    substituteInPlace \
+        $out/etc/xdg/autostart/clickshare-launcher.desktop \
+        --replace =/usr =$out
+  '';
+
+  meta = {
+    homepage = "https://www.barco.com/de/support/clickshare-csc-1/drivers";
+    downloadPage = "https://www.barco.com/de/Support/software/R33050020";
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = lib.licenses.unfree;
+    maintainers = [ lib.maintainers.yarny ];
+    description = "Linux driver/client for Barco ClickShare CSC-1";
+    longDescription = ''
+      Barco ClickShare is a wireless presentation system
+      where a USB dongle transmits to a base station
+      that is connected with a beamer.
+      The USB dongle requires proprietary software that
+      captures the screen and sends it to the dongle.
+      This package provides the necessary software for Linux.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/clipgrab/default.nix b/nixpkgs/pkgs/applications/video/clipgrab/default.nix
new file mode 100644
index 000000000000..fc752f1bd1fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/clipgrab/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, makeDesktopItem, ffmpeg_3
+, qmake, qttools, mkDerivation
+, qtbase, qtdeclarative, qtlocation, qtquickcontrols2, qtwebchannel, qtwebengine
+}:
+
+mkDerivation rec {
+  pname = "clipgrab";
+  version = "3.8.11";
+
+  src = fetchurl {
+    sha256 = "0jpfdmyzjasq4x1xvk7b1cmhhq6fz6ydvvbwz2wclph367x496xk";
+    # The .tar.bz2 "Download" link is a binary blob, the source is the .tar.gz!
+    url = "https://download.clipgrab.org/${pname}-${version}.tar.gz";
+  };
+
+  buildInputs = [ ffmpeg_3 qtbase qtdeclarative qtlocation qtquickcontrols2 qtwebchannel qtwebengine ];
+  nativeBuildInputs = [ qmake qttools ];
+
+  postPatch = stdenv.lib.optionalString (ffmpeg_3 != null) ''
+  substituteInPlace converter_ffmpeg.cpp \
+    --replace '"ffmpeg"' '"${ffmpeg_3.bin}/bin/ffmpeg"' \
+    --replace '"ffmpeg ' '"${ffmpeg_3.bin}/bin/ffmpeg '
+  '';
+
+  qmakeFlags = [ "clipgrab.pro" ];
+
+  enableParallelBuilding = true;
+
+  desktopItem = makeDesktopItem rec {
+    name = "clipgrab";
+    exec = name;
+    icon = name;
+    desktopName = "ClipGrab";
+    comment = meta.description;
+    genericName = "Web video downloader";
+    categories = "Qt;AudioVideo;Audio;Video";
+  };
+
+  installPhase = ''
+    install -Dm755 clipgrab $out/bin/clipgrab
+    install -Dm644 icon.png $out/share/pixmaps/clipgrab.png
+    cp -r ${desktopItem}/share/applications $out/share
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Video downloader for YouTube and other sites";
+    longDescription = ''
+      ClipGrab is a free downloader and converter for YouTube, Vimeo, Metacafe,
+      Dailymotion and many other online video sites. It converts downloaded
+      videos to MPEG4, MP3 or other formats in just one easy step.
+    '';
+    homepage = "https://clipgrab.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/coriander/default.nix b/nixpkgs/pkgs/applications/video/coriander/default.nix
new file mode 100644
index 000000000000..a094bfd904ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/coriander/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, pkgconfig, glib, gtk2, libgnomeui, libXv, libraw1394, libdc1394
+, SDL, automake, GConf }:
+
+stdenv.mkDerivation {
+  name = "coriander-2.0.1";
+
+  src = fetchurl {
+    url = "http://damien.douxchamps.net/ieee1394/coriander/archives/coriander-2.0.1.tar.gz";
+    sha256 = "0l6hpfgy5r4yardilmdrggsnn1fbfww516sk5a90g1740cd435x5";
+  };
+
+  preConfigure = ''
+    cp ${automake}/share/automake-*/mkinstalldirs .
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib gtk2 libgnomeui libXv libraw1394 libdc1394 SDL GConf ];
+  
+  meta = {
+    homepage = "https://damien.douxchamps.net/ieee1394/coriander/";
+    description = "GUI for controlling a Digital Camera through the IEEE1394 bus";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/devede/default.nix b/nixpkgs/pkgs/applications/video/devede/default.nix
new file mode 100644
index 000000000000..9bb5518e80f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/devede/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchFromGitHub, python3Packages, ffmpeg_3, mplayer, vcdimager, cdrkit, dvdauthor
+, gtk3, gettext, wrapGAppsHook, gdk-pixbuf, gobject-introspection }:
+
+let
+  inherit (python3Packages) dbus-python buildPythonApplication pygobject3 urllib3 setuptools;
+
+in buildPythonApplication {
+  name = "devede-4.8.8";
+  namePrefix = "";
+
+  src = fetchFromGitHub {
+    owner = "rastersoft";
+    repo = "devedeng";
+    rev = "c518683fbcd793aa92249e4fecafc3c3fea7da68";
+    sha256 = "0ncb8nykchrjlllbzfjpvirmfvfaps9qhilc56kvcw3nzqrnkx8q";
+  };
+
+  # Temporary fix
+  # See https://github.com/NixOS/nixpkgs/issues/61578
+  # and https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  nativeBuildInputs = [
+    gettext wrapGAppsHook
+
+    # Temporary fix
+    # See https://github.com/NixOS/nixpkgs/issues/61578
+    # and https://github.com/NixOS/nixpkgs/issues/56943
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    ffmpeg_3
+  ];
+
+  propagatedBuildInputs = [
+    gtk3 pygobject3 gdk-pixbuf dbus-python ffmpeg_3 mplayer dvdauthor vcdimager cdrkit urllib3 setuptools
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace "'/usr'," ""
+    substituteInPlace src/devedeng/configuration_data.py \
+      --replace "/usr/share" "$out/share" \
+      --replace "/usr/local/share" "$out/share"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "DVD Creator for Linux";
+    homepage = "http://www.rastersoft.com/programas/devede.html";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bdimcheff ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/dvb-apps/default.nix b/nixpkgs/pkgs/applications/video/dvb-apps/default.nix
new file mode 100644
index 000000000000..8fa88e324494
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvb-apps/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, perl }:
+
+stdenv.mkDerivation {
+  name = "dvb-apps-7f68f9c8d311";
+
+  src = fetchurl {
+    url = "https://linuxtv.org/hg/dvb-apps/archive/7f68f9c8d311.tar.gz";
+    sha256 = "0a6c5jjq6ad98bj0r954l3n7zjb2syw9m19jksg06z4zg1z8yg82";
+  };
+
+  buildInputs = [ perl ];
+
+  dontConfigure = true; # skip configure
+
+  installPhase = "make prefix=$out install";
+
+  meta = {
+    description = "Linux DVB API applications and utilities";
+    homepage = "https://linuxtv.org/";
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2;
+    broken = true; # 2018-04-10
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/dvd-slideshow/default.nix b/nixpkgs/pkgs/applications/video/dvd-slideshow/default.nix
new file mode 100644
index 000000000000..e35d95d54d6f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvd-slideshow/default.nix
@@ -0,0 +1,72 @@
+{ stdenv, lib, fetchurl, writeScript, cdrtools, dvdauthor, ffmpeg_3, imagemagick, lame, mjpegtools, sox, transcode, vorbis-tools, runtimeShell }:
+
+let
+  binPath = lib.makeBinPath [ cdrtools dvdauthor ffmpeg_3 imagemagick lame mjpegtools sox transcode vorbis-tools ];
+
+  wrapper = writeScript "dvd-slideshow.sh" ''
+      #!${runtimeShell}
+      # wrapper script for dvd-slideshow programs
+      export PATH=${binPath}:$PATH
+
+      dir=`dirname "$0"`
+      exe=`basename "$0"`
+      case "$exe" in
+        dvd-slideshow)
+          # use mpeg2enc by default as ffmpeg is known to crash.
+          # run dvd-slideshow.ffmpeg to force ffmpeg.
+          "$dir/dvd-slideshow.real" -mpeg2enc $@
+          ;;
+
+        dvd-slideshow.ffmpeg)
+          "$dir/dvd-slideshow.real" $@
+          ;;
+
+        *)
+          "$dir/$exe.real" $@
+          ;;
+      esac
+    '';
+
+in stdenv.mkDerivation rec {
+  pname = "dvd-slideshow";
+  version = "0.8.4-2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dvd-slideshow/files/${pname}-${version}.tar.gz";
+    sha256 = "17c09aqvippiji2sd0pcxjg3nb1mnh9k5nia4gn5lhcvngjcp1q5";
+  };
+
+  patchPhase = ''
+    # fix upstream typos
+    substituteInPlace dvd-slideshow \
+      --replace "version='0.8.4-1'" "version='0.8.4-2'" \
+      --replace "mymyecho" "myecho"
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp dvd-slideshow         "$out/bin/dvd-slideshow.real"
+    cp dvd-menu              "$out/bin/dvd-menu.real"
+    cp dir2slideshow         "$out/bin/dir2slideshow.real"
+    cp gallery1-to-slideshow "$out/bin/gallery1-to-slideshow.real"
+    cp jigl2slideshow        "$out/bin/jigl2slideshow.real"
+
+    cp ${wrapper} "$out/bin/dvd-slideshow.sh"
+    ln -s dvd-slideshow.sh "$out/bin/dvd-slideshow"
+    ln -s dvd-slideshow.sh "$out/bin/dvd-slideshow.ffmpeg"
+    ln -s dvd-slideshow.sh "$out/bin/dvd-menu"
+    ln -s dvd-slideshow.sh "$out/bin/dir2slideshow"
+    ln -s dvd-slideshow.sh "$out/bin/gallery1-to-slideshow"
+    ln -s dvd-slideshow.sh "$out/bin/jigl2slideshow"
+
+    cp -a man "$out/"
+  '';
+
+  meta = {
+    description = "Suite of command line programs that creates a slideshow-style video from groups of pictures";
+    homepage = "http://dvd-slideshow.sourceforge.net/wiki/Main_Page";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.robbinch ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/dvdauthor/default.nix b/nixpkgs/pkgs/applications/video/dvdauthor/default.nix
new file mode 100644
index 000000000000..af1fe24cbbf4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdauthor/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, imagemagick, libdvdread, libxml2, freetype, fribidi, libpng, zlib, pkgconfig
+, flex, bison }:
+
+stdenv.mkDerivation rec {
+  name = "dvdauthor-0.7.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dvdauthor/${name}.tar.gz";
+    sha256 = "1s8zqlim0s3hk5sbdsilip3qqh0yv05l1jwx49d9rsy614dv27sh";
+  };
+
+  buildInputs = [ libpng freetype libdvdread libxml2 zlib fribidi imagemagick flex bison];
+  nativeBuildInputs = [ pkgconfig ];
+
+  patches = [
+    ./dvdauthor-0.7.1-automake-1.13.patch
+    ./dvdauthor-0.7.1-mga-strndup.patch
+    ./dvdauthor-imagemagick-0.7.0.patch
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Tools for generating DVD files to be played on standalone DVD players";
+    homepage = "http://dvdauthor.sourceforge.net/";
+    license = licenses.gpl2;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-automake-1.13.patch b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-automake-1.13.patch
new file mode 100644
index 000000000000..786f0c968556
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-automake-1.13.patch
@@ -0,0 +1,10 @@
+--- dvdauthor/configure.ac~	2013-01-04 08:27:40.713197029 +0800
++++ dvdauthor/configure.ac	2013-01-04 08:27:53.273525273 +0800
+@@ -1,6 +1,6 @@
+ AC_INIT(DVDAuthor,0.7.1,dvdauthor-users@lists.sourceforge.net)
+ 
+-AM_CONFIG_HEADER(src/config.h)
++AC_CONFIG_HEADERS(src/config.h)
+ AC_CONFIG_AUX_DIR(autotools)
+ 
+ AM_INIT_AUTOMAKE
diff --git a/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-mga-strndup.patch b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-mga-strndup.patch
new file mode 100644
index 000000000000..5f77a68081a4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-0.7.1-mga-strndup.patch
@@ -0,0 +1,24 @@
+Index: dvdauthor/src/dvdvml.l
+===================================================================
+--- dvdauthor/src/dvdvml.l
++++ dvdauthor/src/dvdvml.l      2014-09-14 19:36:05.098847465 +0000
+@@ -19,6 +19,7 @@
+  * USA
+  */
+ 
++#include "config.h"
+ #include "compat.h" /* needed for bool */
+ #include "dvdvm.h"
+ #include "dvdvmy.h"
+Index: dvdauthor/src/dvdvmy.y
+===================================================================
+--- dvdauthor/src/dvdvmy.y
++++ dvdauthor/src/dvdvmy.y      2014-09-14 19:36:28.251618378 +0000
+@@ -19,6 +19,7 @@
+  * USA
+  */
+ 
++#include "config.h"
+ #include "compat.h" /* needed for bool */
+ #include "dvdvm.h"
+ 
diff --git a/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-imagemagick-0.7.0.patch b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-imagemagick-0.7.0.patch
new file mode 100644
index 000000000000..52b6cc44cd59
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdauthor/dvdauthor-imagemagick-0.7.0.patch
@@ -0,0 +1,11 @@
+--- dvdauthor/configure.ac.orig	2010-10-23 04:26:49.000000000 +0200
++++ dvdauthor/configure.ac	2010-10-24 14:37:45.489064778 +0200
+@@ -31,7 +31,7 @@
+ 
+ usemagick=0
+ 
+-AC_CHECK_PROGS(MAGICKCONFIG, [Magick-config])
++AC_CHECK_PROGS(MAGICKCONFIG, [MagickCore-config])
+ if test -n "$MAGICKCONFIG"; then
+     ac_save_CPPFLAGS="$CPPFLAGS"
+     ac_save_LIBS="$LIBS"
diff --git a/nixpkgs/pkgs/applications/video/dvdbackup/default.nix b/nixpkgs/pkgs/applications/video/dvdbackup/default.nix
new file mode 100644
index 000000000000..e129031fd49c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdbackup/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, libdvdread, libdvdcss, dvdauthor }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.2";
+  pname = "dvdbackup";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dvdbackup/${pname}-${version}.tar.xz";
+    sha256 = "1rl3h7waqja8blmbpmwy01q9fgr5r0c32b8dy3pbf59bp3xmd37g";
+  };
+
+  buildInputs = [ libdvdread libdvdcss dvdauthor ];
+
+  meta = {
+    description = "A tool to rip video DVDs from the command line";
+    homepage = "http://dvdbackup.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.bradediger ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/dvdstyler/default.nix b/nixpkgs/pkgs/applications/video/dvdstyler/default.nix
new file mode 100644
index 000000000000..b78f9ed816b7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/dvdstyler/default.nix
@@ -0,0 +1,85 @@
+{ stdenv, fetchurl, pkgconfig
+, flex, bison, gettext
+, xineUI, wxSVG
+, fontconfig
+, xmlto, docbook5, zip
+, cdrtools, dvdauthor, dvdplusrwtools
+, dvdisasterSupport ? true, dvdisaster ? null
+, thumbnailSupport ? true, libgnomeui ? null
+, udevSupport ? true, udev ? null
+, dbusSupport ? true, dbus ? null
+, makeWrapper }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+
+  pname = "dvdstyler";
+  srcName = "DVDStyler-${version}";
+  version = "3.1.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/dvdstyler/dvdstyler/${version}/${srcName}.tar.bz2";
+    sha256 = "03lsblqficcadlzkbyk8agh5rqcfz6y6dqvy9y866wqng3163zq4";
+  };
+
+  nativeBuildInputs =
+  [ pkgconfig ];
+
+  packagesToBinPath =
+  [ cdrtools dvdauthor dvdplusrwtools ];
+
+  buildInputs =
+  [ flex bison gettext xineUI
+    wxSVG fontconfig xmlto
+    docbook5 zip makeWrapper ]
+  ++ packagesToBinPath
+  ++ optionals dvdisasterSupport [ dvdisaster ]
+  ++ optionals udevSupport [ udev ]
+  ++ optionals dbusSupport [ dbus ]
+  ++ optionals thumbnailSupport [ libgnomeui ];
+
+  binPath = makeBinPath packagesToBinPath;
+
+  postInstall = ''
+    wrapProgram $out/bin/dvdstyler \
+      --prefix PATH ":" "${binPath}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A DVD authoring software";
+    longDescription = ''
+    DVDStyler is a cross-platform free DVD authoring application for the
+    creation of professional-looking DVDs. It allows not only burning of video
+    files on DVD that can be played practically on any standalone DVD player,
+    but also creation of individually designed DVD menus. It is Open Source
+    Software and is completely free.
+
+    Some of its features include:
+    -  create and burn DVD video with interactive menus
+    - design your own DVD menu or select one from the list of ready to use menu
+      templates
+    - create photo slideshow
+    - add multiple subtitle and audio tracks
+    - support of AVI, MOV, MP4, MPEG, OGG, WMV and other file formats
+    - support of MPEG-2, MPEG-4, DivX, Xvid, MP2, MP3, AC-3 and other audio and
+      video formats
+    - support of multi-core processor
+    - use MPEG and VOB files without reencoding
+    - put files with different audio/video format on one DVD (support of
+      titleset)
+    - user-friendly interface with support of drag & drop
+    - flexible menu creation on the basis of scalable vector graphic
+    - import of image file for background
+    - place buttons, text, images and other graphic objects anywhere on the menu
+      screen
+    - change the font/color and other parameters of buttons and graphic objects
+    - scale any button or graphic object
+    - copy any menu object or whole menu
+    - customize navigation using DVD scripting
+    '';
+    homepage = "http://www.dvdstyler.org/";
+    license = with licenses; gpl2;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/ffmpeg-normalize/default.nix b/nixpkgs/pkgs/applications/video/ffmpeg-normalize/default.nix
new file mode 100644
index 000000000000..411ab9e6bc28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/ffmpeg-normalize/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, buildPythonApplication
+, fetchPypi
+, ffmpeg_3
+, tqdm
+}:
+
+buildPythonApplication rec {
+  pname = "ffmpeg-normalize";
+  version = "1.19.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "18dpck9grnr3wgbjvdh4mjlx0zfwcxpy4rnpmc39in0yk3w7li2x";
+  };
+
+  propagatedBuildInputs = [ ffmpeg_3 tqdm ];
+
+  checkPhase = ''
+    $out/bin/ffmpeg-normalize --help > /dev/null
+  '';
+
+  meta = with lib; {
+    description = "Normalize audio via ffmpeg";
+    homepage = "https://github.com/slhck/ffmpeg-normalize";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ prusnak ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/gnome-mplayer/default.nix b/nixpkgs/pkgs/applications/video/gnome-mplayer/default.nix
new file mode 100644
index 000000000000..3bd7785f201c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/gnome-mplayer/default.nix
@@ -0,0 +1,33 @@
+{stdenv, substituteAll, fetchFromGitHub, pkgconfig, gettext, glib, gtk3, gmtk, dbus, dbus-glib
+, libnotify, libpulseaudio, mplayer, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-mplayer";
+  version = "1.0.9";
+
+  src = fetchFromGitHub {
+    owner = "kdekorte";
+    repo = "gnome-mplayer";
+    rev = "v${version}";
+    sha256 = "0qvy9fllvg1mad6y1j79iaqa6khs0q2cb0z62yfg4srbr07fi8xr";
+  };
+
+  nativeBuildInputs = [ pkgconfig gettext wrapGAppsHook ];
+  buildInputs = [ glib gtk3 gmtk dbus dbus-glib libnotify libpulseaudio ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      mencoder = "${mplayer}/bin/mencoder";
+      mplayer = "${mplayer}/bin/mplayer";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Gnome MPlayer, a simple GUI for MPlayer";
+    homepage = "https://sites.google.com/site/kdekorte2/gnomemplayer";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/gnome-mplayer/fix-paths.patch b/nixpkgs/pkgs/applications/video/gnome-mplayer/fix-paths.patch
new file mode 100644
index 000000000000..ede4991c4662
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/gnome-mplayer/fix-paths.patch
@@ -0,0 +1,87 @@
+--- a/src/gui.c
++++ b/src/gui.c
+@@ -7470,7 +7470,7 @@
+         filename = g_strdup_printf("%s/00000001.jpg", dirname);
+         g_free(basepath);
+         // run mplayer and try to get the first frame and convert it to a jpeg
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+         av[ac++] = g_strdup_printf("-vo");
+         av[ac++] = g_strdup_printf("jpeg:outdir=%s", dirname);
+         av[ac++] = g_strdup_printf("-ao");
+--- a/src/property_page_common.c
++++ b/src/property_page_common.c
+@@ -80,7 +80,7 @@
+     MetaData *ret;
+     ret = g_new0(MetaData, 1);
+ 
+-    av[ac++] = g_strdup_printf("mplayer");
++    av[ac++] = g_strdup_printf("@mplayer@");
+     av[ac++] = g_strdup_printf("-vo");
+     av[ac++] = g_strdup_printf("null");
+     av[ac++] = g_strdup_printf("-ao");
+--- a/src/support.c
++++ b/src/support.c
+@@ -566,7 +566,7 @@
+     } else {
+         playlist = FALSE;
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -728,7 +728,7 @@
+         playlist = FALSE;
+         // run mplayer and try to get the first frame and convert it to a jpeg
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -825,7 +825,7 @@
+         playlist = FALSE;
+ 
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -1251,7 +1251,7 @@
+     gm_log(verbose, G_LOG_LEVEL_INFO, "getting file metadata for %s", name);
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
+@@ -1532,7 +1532,7 @@
+         return 0;
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
+@@ -1597,7 +1597,7 @@
+ 
+     if (control_id == 0) {
+         ac = 0;
+-        av[ac++] = g_strdup_printf("mencoder");
++        av[ac++] = g_strdup_printf("@mencoder@");
+         av[ac++] = g_strdup_printf("-ovc");
+         av[ac++] = g_strdup_printf("copy");
+         av[ac++] = g_strdup_printf("-oac");
+@@ -2830,7 +2830,7 @@
+     gboolean ret = TRUE;
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
diff --git a/nixpkgs/pkgs/applications/video/gnomecast/default.nix b/nixpkgs/pkgs/applications/video/gnomecast/default.nix
new file mode 100644
index 000000000000..3a3ca044bb88
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/gnomecast/default.nix
@@ -0,0 +1,28 @@
+{ lib, python3Packages, gtk3, gobject-introspection, ffmpeg_3, wrapGAppsHook }:
+
+with python3Packages;
+buildPythonApplication rec {
+  pname = "gnomecast";
+  version = "1.4.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0mn03gqbwmhch0055bzgdwkzsl304qdyqwrgyiq0k5c5d2gyala5";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+  propagatedBuildInputs = [
+    PyChromecast bottle pycaption paste html5lib pygobject3 dbus-python
+    gtk3 gobject-introspection
+  ];
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ ffmpeg_3 ]})
+  '';
+
+  meta = with lib; {
+    description = "A native Linux GUI for Chromecasting local files";
+    homepage = "https://github.com/keredson/gnomecast";
+    license = with licenses; [ gpl3 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/gpac/default.nix b/nixpkgs/pkgs/applications/video/gpac/default.nix
new file mode 100644
index 000000000000..e587a5999054
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/gpac/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub, pkgconfig, zlib }:
+
+stdenv.mkDerivation rec {
+  version = "0.8.0";
+  pname = "gpac";
+
+  src = fetchFromGitHub {
+    owner = "gpac";
+    repo = "gpac";
+    rev = "v${version}";
+    sha256 = "1w1dyrn6900yi8ngchfzy5hvxr6yc60blvdq8y8mczimmmq8khb5";
+  };
+
+  # this is the bare minimum configuration, as I'm only interested in MP4Box
+  # For most other functionality, this should probably be extended
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ zlib ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Open Source multimedia framework for research and academic purposes";
+    longDescription = ''
+      GPAC is an Open Source multimedia framework for research and academic purposes.
+      The project covers different aspects of multimedia, with a focus on presentation
+      technologies (graphics, animation and interactivity) and on multimedia packaging
+      formats such as MP4.
+
+      GPAC provides three sets of tools based on a core library called libgpac:
+
+      A multimedia player, called Osmo4 / MP4Client,
+      A multimedia packager, called MP4Box,
+      And some server tools included in MP4Box and MP42TS applications.
+    '';
+    homepage = "https://gpac.wp.imt.fr";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ bluescreen303 mgdelacroix ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/handbrake/default.nix b/nixpkgs/pkgs/applications/video/handbrake/default.nix
new file mode 100644
index 000000000000..b56c26dff78d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/handbrake/default.nix
@@ -0,0 +1,142 @@
+# Upstream distributes HandBrake with bundle of according versions of libraries and patches to them.
+#
+# Derivation patches HandBrake to use Nix closure dependencies.
+#
+# NOTE: 2019-07-19: This derivation does not currently support the native macOS
+# GUI--it produces the "HandbrakeCLI" CLI version only. In the future it would
+# be nice to add the native GUI (and/or the GTK GUI) as an option too, but that
+# requires invoking the Xcode build system, which is non-trivial for now.
+
+{ stdenv, lib, fetchFromGitHub,
+  # Main build tools
+  pkgconfig, autoconf, automake, libtool, m4, lzma, python3,
+  numactl,
+  # Processing, video codecs, containers
+  ffmpeg-full, nv-codec-headers, libogg, x264, x265, libvpx, libtheora, dav1d,
+  # Codecs, audio
+  libopus, lame, libvorbis, a52dec, speex, libsamplerate,
+  # Text processing
+  libiconv, fribidi, fontconfig, freetype, libass, jansson, libxml2, harfbuzz,
+  # Optical media
+  libdvdread, libdvdnav, libdvdcss, libbluray,
+  # Darwin-specific
+  AudioToolbox ? null,
+  Foundation ? null,
+  libobjc ? null,
+  VideoToolbox ? null,
+  # GTK
+  # NOTE: 2019-07-19: The gtk3 package has a transitive dependency on dbus,
+  # which in turn depends on systemd. systemd is not supported on Darwin, so
+  # for now we disable GTK GUI support on Darwin. (It may be possible to remove
+  # this restriction later.)
+  useGtk ? !stdenv.isDarwin, wrapGAppsHook ? null,
+  intltool ? null,
+  glib ? null,
+  gtk3 ? null,
+  libappindicator-gtk3 ? null,
+  libnotify ? null,
+  gst_all_1 ? null,
+  dbus-glib ? null,
+  udev ? null,
+  libgudev ? null,
+  hicolor-icon-theme ? null,
+  # FDK
+  useFdk ? false, fdk_aac ? null
+}:
+
+assert stdenv.isDarwin -> AudioToolbox != null
+       && Foundation != null
+       && libobjc != null
+       && VideoToolbox != null;
+
+stdenv.mkDerivation rec {
+  pname = "handbrake";
+  version = "1.3.3";
+
+  src = fetchFromGitHub {
+    owner = "HandBrake";
+    repo = "HandBrake";
+    rev = version;
+    sha256 = "0bsmk37543zv3p32a7wxnh2w483am23ha2amj339q3nnb4142krn";
+    extraPostFetch = ''
+      echo "DATE=$(date +"%F %T %z" -r $out/NEWS.markdown)" > $out/version.txt
+    '';
+  };
+
+  # we put as little as possible in src.extraPostFetch as it's much easier to
+  # add to it here without having to fiddle with src.sha256
+  # only DATE and HASH are absolutely necessary
+  postPatch = ''
+    cat >> version.txt <<_EOF
+HASH=${src.rev}
+SHORTHASH=${src.rev}
+TAG=${version}
+URL=${src.meta.homepage}
+_EOF
+
+    patchShebangs scripts
+
+    substituteInPlace libhb/module.defs \
+      --replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
+
+    # Force using nixpkgs dependencies
+    sed -i '/MODULES += contrib/d' make/include/main.defs
+    sed -e 's/^[[:space:]]*\(meson\|ninja\|nasm\)[[:space:]]*= ToolProbe.*$//g' \
+        -e '/    ## Additional library and tool checks/,/    ## MinGW specific library and tool checks/d' \
+        -i make/configure.py
+  '';
+
+  nativeBuildInputs = [
+    pkgconfig autoconf automake libtool m4 python3
+  ] ++ lib.optionals useGtk [ intltool wrapGAppsHook ];
+
+  buildInputs = [
+    ffmpeg-full libogg libtheora x264 x265 libvpx dav1d
+    libopus lame libvorbis a52dec speex libsamplerate
+    libiconv fribidi fontconfig freetype libass jansson libxml2 harfbuzz
+    libdvdread libdvdnav libdvdcss libbluray lzma numactl
+  ] ++ lib.optionals useGtk [
+    glib gtk3 libappindicator-gtk3 libnotify
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
+    libgudev hicolor-icon-theme
+  ] ++ lib.optional useFdk fdk_aac
+  ++ lib.optionals stdenv.isDarwin [ AudioToolbox Foundation libobjc VideoToolbox ]
+  # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only,
+  # look at ./make/configure.py search "enable_nvenc"
+  ++ lib.optional stdenv.isLinux nv-codec-headers;
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--disable-df-fetch"
+    "--disable-df-verify"
+    (if useGtk          then "--disable-gtk-update-checks" else "--disable-gtk")
+    (if useFdk          then "--enable-fdk-aac"            else "")
+    (if stdenv.isDarwin then "--disable-xcode"             else "")
+  ] ++ lib.optional (stdenv.isx86_32 || stdenv.isx86_64) "--harden";
+
+  # NOTE: 2018-12-27: Check NixOS HandBrake test if changing
+  NIX_LDFLAGS = [
+    "-lx265"
+  ];
+
+  preBuild = ''
+    cd build
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://handbrake.fr/";
+    description = "A tool for converting video files and ripping DVDs";
+    longDescription = ''
+      Tool for converting and remuxing video files
+      into selection of modern and widely supported codecs
+      and containers. Very versatile and customizable.
+      Package provides:
+      CLI - `HandbrakeCLI`
+      GTK GUI - `ghb`
+    '';
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ Anton-Latukha wmertens ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix b/nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix
new file mode 100644
index 000000000000..de9310740912
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, buildPythonApplication, fetchFromGitHub, fetchurl
+, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
+, pillow, tkinter, pystray, jinja2, pywebview }:
+
+buildPythonApplication rec {
+  pname = "jellyfin-mpv-shim";
+  version = "1.4.2";
+
+  src = fetchFromGitHub {
+    owner = "iwalton3";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1cnii5wj0pgqg3dqk5cm6slpbs3730x8ippps4cjbsxcsrmqjpx6";
+    fetchSubmodules = true; # needed for display_mirror css file
+  };
+
+  # override $HOME directory:
+  #   error: [Errno 13] Permission denied: '/homeless-shelter'
+  #
+  # remove jellyfin_mpv_shim/win_utils.py:
+  #   ModuleNotFoundError: No module named 'win32gui'
+  preCheck = ''
+    export HOME=$TMPDIR
+
+    rm jellyfin_mpv_shim/win_utils.py
+  '';
+
+  propagatedBuildInputs = [
+    jellyfin-apiclient-python
+    mpv
+    pillow
+    python-mpv-jsonipc
+
+    # gui dependencies
+    pystray
+    tkinter
+
+    # display_mirror dependencies
+    jinja2
+    pywebview
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
+    description = "Allows casting of videos to MPV via the jellyfin mobile and web app.";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ jojosch ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/jftui/default.nix b/nixpkgs/pkgs/applications/video/jftui/default.nix
new file mode 100644
index 000000000000..eb572bac4e34
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/jftui/default.nix
@@ -0,0 +1,41 @@
+{ stdenv
+, fetchFromGitHub
+, pkg-config
+, curl
+, mpv
+, yajl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jftui";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "Aanok";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1az737q5i24ylvkx4g3xlq8k48ni91nz5hhbif97g4nlhwl5cqb6";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    curl
+    mpv
+    yajl
+  ];
+
+  installPhase = ''
+    install -Dm555 build/jftui $out/bin/jftui
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Jellyfin Terminal User Interface ";
+    homepage = "https://github.com/Aanok/jftui";
+    license = licenses.unlicense;
+    maintainers = [ maintainers.nyanloutre ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/k9copy/default.nix b/nixpkgs/pkgs/applications/video/k9copy/default.nix
new file mode 100644
index 000000000000..317505185d0d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/k9copy/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl
+, cmake
+, dvdauthor, xineLib, libmpeg2, libav, libdvdread, libdvdnav, dvdplusrwtools
+, phonon, qtx11extras
+, extra-cmake-modules, kio, kiconthemes, ki18n, kdesu, kdoctools, solid
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.0.3";
+  pname = "k9copy";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/k9copy-reloaded/${pname}-${version}.tar.gz";
+    sha256 = "0dp06rwihks50c57bbv04d6bj2qc88isl91971r4lii2xp0qn7sg";
+  };
+
+  patches = [
+    ./gcc6.patch
+  ];
+
+  cmakeFlags = [
+    "-DQT5_BUILD=ON"
+    "-DCMAKE_MINIMUM_REQUIRED_VERSION=3.0"
+  ];
+
+  # Hack to disable documentation
+  preConfigure = ''
+   substituteInPlace ./CMakeLists.txt \
+     --replace "add_subdirectory(doc)" ""
+  '';
+
+  buildInputs = [
+    cmake
+    dvdauthor
+    xineLib
+    libmpeg2
+    libav
+    libdvdread
+    libdvdnav
+    dvdplusrwtools
+    #automoc4
+    phonon
+    extra-cmake-modules
+    kio
+    solid
+    qtx11extras
+    kiconthemes
+    ki18n
+    kdesu
+  ];
+  nativeBuildInputs = [ kdoctools ];
+
+  meta = {
+    description = "DVD backup and DVD authoring program";
+    homepage = "http://k9copy-reloaded.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ flosse ];
+    platforms = stdenv.lib.platforms.unix;
+    # TODO: The software is deprecated and the build is broken, see:
+    # https://github.com/NixOS/nixpkgs/pull/63260#issuecomment-503506487
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/k9copy/gcc6.patch b/nixpkgs/pkgs/applications/video/k9copy/gcc6.patch
new file mode 100644
index 000000000000..d0c9c2a8035e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/k9copy/gcc6.patch
@@ -0,0 +1,26 @@
+diff --git c/src/backup/k9dvdbackup.cpp i/src/backup/k9dvdbackup.cpp
+index f5e4859..82fa392 100755
+--- c/src/backup/k9dvdbackup.cpp
++++ i/src/backup/k9dvdbackup.cpp
+@@ -907,7 +907,7 @@ k9Vobu * k9DVDBackup::remapOffset(uint32_t _sector,uint32_t *_offset,int _dir) {
+ 
+ 
+         if ((vobu1 !=NULL) && (vobu2!=NULL)) {
+-            *_offset = abs(vobu1->newSector - vobu2->newSector)  | maskOffset1 ;
++            *_offset = (vobu1->newSector - vobu2->newSector)  | maskOffset1 ;
+             *_offset |= maskOffset2;
+             return vobu2;
+         }
+diff --git c/src/backup/k9execcopy.cpp i/src/backup/k9execcopy.cpp
+index d59222c..35de923 100644
+--- c/src/backup/k9execcopy.cpp
++++ i/src/backup/k9execcopy.cpp
+@@ -306,7 +306,7 @@ void k9ExecCopy::createMkv(k9DVDTitle *_title,const QString &_filename,QMultiMap
+ 
+ #if QT_VERSION >= 0x050000
+     m_progressDialog=new QProgressDialog(k9Dialogs::getMainWidget() );
+-    m_progressDialog->setCancelButton(false);
++    m_progressDialog->setCancelButton(0);
+ 
+ #else
+     m_progressDialog=new KProgressDialog(k9Dialogs::getMainWidget() );
diff --git a/nixpkgs/pkgs/applications/video/kazam/default.nix b/nixpkgs/pkgs/applications/video/kazam/default.nix
new file mode 100644
index 000000000000..0cdd3db85257
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kazam/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, substituteAll, python3, gst_all_1, wrapGAppsHook, gobject-introspection
+, gtk3, libwnck3, keybinder3, intltool, libcanberra-gtk3, libappindicator-gtk3, libpulseaudio
+, fetchpatch }:
+
+python3.pkgs.buildPythonApplication rec {
+  name = "kazam-${version}";
+  version = "1.4.5";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "https://launchpad.net/kazam/stable/${version}/+download/kazam-${version}.tar.gz";
+    sha256 = "1qygnrvm6aqixbyivhssp70hs0llxwk7lh3j7idxa2jbkk06hj4f";
+  };
+
+  nativeBuildInputs = [ gobject-introspection python3.pkgs.distutils_extra intltool wrapGAppsHook ];
+  buildInputs = [
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gtk3 libwnck3
+    keybinder3 libappindicator-gtk3
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [ pygobject3 pyxdg pycairo dbus-python ];
+ 
+  # workaround https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  patches = [
+    # Fix paths
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libcanberra = libcanberra-gtk3;
+      inherit libpulseaudio;
+    })
+    # https://github.com/hzbd/kazam/pull/21
+    (fetchpatch {
+      url = "https://github.com/hzbd/kazam/commit/37e53a5aa61f4223a9ea03ceeda26eeba2b9d37b.patch";
+      sha256 = "1q5dpmdm6cvgzw8xa7bwclnqa05xc73ja1lszwmwv5glyik0fk4z";
+    })
+  ];
+
+  # no tests
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A screencasting program created with design in mind";
+    homepage = "https://code.launchpad.net/kazam";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.domenkozar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/kazam/fix-paths.patch b/nixpkgs/pkgs/applications/video/kazam/fix-paths.patch
new file mode 100644
index 000000000000..43e360830ab5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kazam/fix-paths.patch
@@ -0,0 +1,22 @@
+--- a/kazam/backend/grabber.py
++++ b/kazam/backend/grabber.py
+@@ -72,7 +72,7 @@
+         #
+         if prefs.shutter_sound and (not self.god):
+             soundfile = os.path.join(prefs.datadir, 'sounds', prefs.sound_files[prefs.shutter_type])
+-            subprocess.call(['/usr/bin/canberra-gtk-play', '-f', soundfile])
++            subprocess.call(['@libcanberra@/bin/canberra-gtk-play', '-f', soundfile])
+ 
+         if self.xid:
+             if prefs.capture_borders_pic:
+--- a/kazam/pulseaudio/ctypes_pulseaudio.py
++++ b/kazam/pulseaudio/ctypes_pulseaudio.py
+@@ -20,7 +20,7 @@
+ #       MA 02110-1301, USA.
+ 
+ from ctypes import *
+-PA = CDLL('libpulse.so.0')
++PA = CDLL('@libpulseaudio@/lib/libpulse.so.0')
+ 
+ #
+ # Pulse Audio constants and defines
diff --git a/nixpkgs/pkgs/applications/video/kino/default.nix b/nixpkgs/pkgs/applications/video/kino/default.nix
new file mode 100644
index 000000000000..3f41e73dfa75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kino/default.nix
@@ -0,0 +1,95 @@
+# is this configure option of interest?
+#--enable-udev-rules-dir=PATH
+#                        Where to install udev rules (/etc/udev/rules.d)
+
+#TODO shared version?
+
+
+# This is my config output.. Much TODO ?
+#source path               /tmp/nix-31998-1/kino-1.2.0/ffmpeg
+#C compiler                gcc
+#make                      make
+#.align is power-of-two    no
+#ARCH                      x86_64 (generic)
+#build suffix              -kino
+#big-endian                no
+#MMX enabled               yes
+#CMOV enabled              no
+#CMOV is fast              no
+#gprof enabled             no
+#debug symbols             yes
+#strip symbols             yes
+#optimize                  yes
+#static                    yes
+#shared                    no
+#postprocessing support    no
+#software scaler enabled   yes
+#video hooking             no
+#network support           no
+#threading support         no
+#SDL support               no
+#Sun medialib support      no
+#AVISynth enabled          no
+#liba52 support            no
+#liba52 dlopened           no
+#libdts support            no
+#libfaac enabled           no
+#libfaad enabled           no
+#faadbin enabled           no
+#libgsm enabled            no
+#libmp3lame enabled        no
+#libnut enabled            no
+#libogg enabled            no
+#libtheora enabled         no
+#libvorbis enabled         no
+#x264 enabled              no
+#XviD enabled              no
+#zlib enabled              no
+#AMR-NB float support      no
+#AMR-NB fixed support      no
+#AMR-WB float support      no
+#AMR-WB IF2 support        no
+
+{ stdenv, fetchurl, gtk2, libglade, libxml2, libraw1394, libsamplerate, libdv
+, pkgconfig, perlPackages, libavc1394, libiec61883, libXv, gettext
+, libX11, glib, cairo, intltool, ffmpeg, libv4l
+}:
+
+stdenv.mkDerivation {
+  name = "kino-1.3.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/kino/kino-1.3.4.tar.gz";
+    sha256 = "020s05k0ma83rq2kfs8x474pqicaqp9spar81qc816ddfrnh8k8i";
+  };
+
+  buildInputs = [ gtk2 libglade libxml2 libraw1394 libsamplerate libdv
+      pkgconfig libavc1394 libiec61883 intltool libXv gettext libX11 glib cairo ffmpeg libv4l ] # TODOoptional packages
+    ++ (with perlPackages; [ perl XMLParser ]);
+
+  configureFlags = [ "--enable-local-ffmpeg=no" ];
+
+  hardeningDisable = [ "format" ];
+
+  NIX_LDFLAGS = "-lavcodec -lavutil";
+
+  patches = [ ./kino-1.3.4-v4l1.patch ./kino-1.3.4-libav-0.7.patch ./kino-1.3.4-libav-0.8.patch ]; #./kino-1.3.4-libavcodec-pkg-config.patch ];
+
+  postInstall = "
+    rpath=`patchelf --print-rpath \$out/bin/kino`;
+    for i in $buildInputs; do
+      echo adding \$i/lib
+      rpath=\$rpath\${rpath:+:}\$i/lib
+    done
+    for i in \$out/bin/*; do
+      patchelf --set-rpath \"\$rpath\" \"\$i\"
+    done
+  ";
+
+  meta = {
+      description = "Non-linear DV editor for GNU/Linux";
+      homepage = "http://www.kinodv.org/";
+      license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patch b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patch
new file mode 100644
index 000000000000..65c5bc38276d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patch
@@ -0,0 +1,60 @@
+--- kino-1.3.4.orig/src/frame.cc	2011-07-17 14:54:59.089481638 +0200
++++ kino-1.3.4/src/frame.cc	2011-07-17 15:09:23.199481714 +0200
+@@ -1063,7 +1063,12 @@
+ 	AVPicture dest;
+ 	int got_picture;
+ 
+-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
++	AVPacket pkt;
++	av_init_packet(&pkt);
++	pkt.data = data;
++	pkt.size = GetFrameSize();
++
++	avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
+ 	if ( got_picture )
+ 	{
+ 		avpicture_fill( &dest, static_cast<uint8_t*>( rgb ), PIX_FMT_RGB24, GetWidth(), GetHeight() );
+@@ -1123,7 +1128,12 @@
+ 	AVPicture output;
+ 	int got_picture;
+ 
+-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
++	AVPacket pkt;
++	av_init_packet(&pkt);
++	pkt.data = data;
++	pkt.size = GetFrameSize();
++
++	avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
+ 	if ( got_picture )
+ 	{
+ 		avpicture_fill( &output, static_cast<uint8_t*>( yuv ), PIX_FMT_YUV422, GetWidth(), GetHeight() );
+@@ -1156,7 +1166,12 @@
+ 	AVFrame *frame = avcodec_alloc_frame();
+ 	int got_picture;
+ 
+-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
++        AVPacket pkt;
++        av_init_packet(&pkt);
++        pkt.data = data;
++        pkt.size = GetFrameSize();
++
++        avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
+ 
+ 	int width = GetWidth(), height = GetHeight();
+ 
+@@ -1319,12 +1334,12 @@
+ #if defined(HAVE_LIBAVCODEC)
+ 	if ( avformatEncoder == NULL )
+ 	{
+-		avformatEncoder = av_alloc_format_context();
++		avformatEncoder = avformat_alloc_context();
+ 		if ( avformatEncoder )
+ 		{
+-			avformatEncoder->oformat = guess_format( "dv", NULL, NULL );
++			avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
+ 			AVStream* vst = av_new_stream( avformatEncoder, 0 );
+-			vst->codec->codec_type = CODEC_TYPE_VIDEO;
++			vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ 			vst->codec->codec_id = CODEC_ID_DVVIDEO;
+ 			vst->codec->bit_rate = 25000000;
+			vst->start_time = 0;
diff --git a/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patch b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patch
new file mode 100644
index 000000000000..f98cbda0bc49
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patch
@@ -0,0 +1,57 @@
+--- kino-1.3.4.orig/src/frame.cc	2012-05-14 19:55:42.153772418 -0700
++++ kino-1.3.4/src/frame.cc	2012-05-14 20:28:34.448838653 -0700
+@@ -101,8 +101,9 @@
+ #if defined(HAVE_LIBAVCODEC)
+ 	pthread_mutex_lock( &avcodec_mutex );
+ 	av_register_all();
+-	libavcodec = avcodec_alloc_context();
+-	avcodec_open( libavcodec, avcodec_find_decoder( CODEC_ID_DVVIDEO ) );
++	libavcodec = avcodec_alloc_context3(NULL);
++	avcodec_open2( libavcodec,
++                       avcodec_find_decoder( CODEC_ID_DVVIDEO ), NULL );
+ 	pthread_mutex_unlock( &avcodec_mutex );
+ 	data = ( unsigned char* ) av_mallocz( 144000 );
+ #if defined(HAVE_SWSCALE)
+@@ -1338,7 +1339,7 @@
+ 		if ( avformatEncoder )
+ 		{
+ 			avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
+-			AVStream* vst = av_new_stream( avformatEncoder, 0 );
++			AVStream* vst = avformat_new_stream( avformatEncoder, NULL );
+ 			vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ 			vst->codec->codec_id = CODEC_ID_DVVIDEO;
+ 			vst->codec->bit_rate = 25000000;
+@@ -1364,12 +1365,10 @@
+ 			vst->sample_aspect_ratio = avcodecEncoder->sample_aspect_ratio;
+ #endif
+ 			avcodecEncoder->thread_count = 2;
+-			avcodec_thread_init( avcodecEncoder, avcodecEncoder->thread_count );
+ 			avcodecEncoder->time_base= isPAL ? ( AVRational ){ 1, 25 } : ( AVRational ){ 1001, 30000 };
+ 			avcodecEncoder->pix_fmt = isPAL ? PIX_FMT_YUV420P : PIX_FMT_YUV411P;
+ 			avcodecEncoder->flags |= CODEC_FLAG_INTERLACED_DCT;
+-			av_set_parameters( avformatEncoder, NULL );
+-			avcodec_open( avcodecEncoder, avcodec_find_encoder( CODEC_ID_DVVIDEO ) );
++			avcodec_open2( avcodecEncoder, avcodec_find_encoder( CODEC_ID_DVVIDEO ), NULL );
+ 			av_new_packet( &avpacketEncoder, 144000 );
+ 			tempImage = ( uint8_t* ) av_malloc(
+ 				avpicture_get_size( avcodecEncoder->pix_fmt, avcodecEncoder->width, avcodecEncoder->height ) );
+@@ -1475,16 +1474,16 @@
+ 
+ 			// Encode
+ 			bytesInFrame = avcodec_encode_video( avcodecEncoder, avpacketEncoder.data, size, output );
+-			url_open_buf( &avformatEncoder->pb, data, bytesInFrame, URL_WRONLY );
++                        avformatEncoder->pb = avio_alloc_context(data, bytesInFrame, 0, NULL, NULL, NULL, NULL);
+ 			avpacketEncoder.size = bytesInFrame;
+ 			if ( !isEncoderHeaderWritten )
+ 			{
+-				av_write_header( avformatEncoder );
++				avformat_write_header( avformatEncoder, NULL );
+ 				isEncoderHeaderWritten = true;
+ 			}
+ 			av_write_frame( avformatEncoder, &avpacketEncoder );
+ #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
+-			url_close_buf( avformatEncoder->pb );
++			avio_close( avformatEncoder->pb );
+ #else
+ 			url_close_buf( &avformatEncoder->pb );
+ #endif
diff --git a/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patch b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patch
new file mode 100644
index 000000000000..d6a8953cf00a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patch
@@ -0,0 +1,11 @@
+--- a/kino-1.3.4/configure.in	2009-09-08 02:35:23.000000000 -0400
++++ b/kino-1.3.4/configure.in	2014-01-27 14:53:01.366063037 -0500
+@@ -221,7 +221,7 @@
+ 		if (test "x$avcodec_include" != x) || (test "x$avcodec_lib" != x) ; then
+ 			local_legacy_ffmpeg_test
+ 		else
+-			PKG_CHECK_MODULES(AVCODEC, libavformat,
++			PKG_CHECK_MODULES(AVCODEC, [libavcodec libavformat libavutil],
+ 			[
+ 				AC_DEFINE(HAVE_LIBAVCODEC, 1, [Enable FFMPEG libavcodec])
+ 				AC_SUBST(AVCODEC_LIBS)
diff --git a/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-v4l1.patch b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-v4l1.patch
new file mode 100644
index 000000000000..05ec7386709e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kino/kino-1.3.4-v4l1.patch
@@ -0,0 +1,21 @@
+no-1.3.3.orig/ffmpeg/libavdevice/v4l.c	2011-05-17 02:20:37.161004916 +0400
++++ kino-1.3.3.orig/ffmpeg/libavdevice/v4l.c	2011-05-17 02:21:57.302377529 +0400
+@@ -26,7 +26,7 @@ 
+ #include <sys/mman.h>
+ #include <sys/time.h>
+ #define _LINUX_TIME_H 1
+-#include <linux/videodev.h>
++#include <libv4l1-videodev.h>
+ #include <time.h>
+ 
+ typedef struct {
+--- kino-1.3.3.orig/src/v4l.h	2011-05-17 02:20:38.896969666 +0400
++++ kino-1.3.3.orig/src/v4l.h	2011-05-17 02:21:39.922730395 +0400
+@@ -40,7 +40,7 @@ 
+ 
+ #define _DEVICE_H_
+ #define _LINUX_TIME_H
+-#include <linux/videodev.h>
++#include <libv4l1-videodev.h>
+ 
+ #include "displayer.h"
diff --git a/nixpkgs/pkgs/applications/video/kmplayer/default.nix b/nixpkgs/pkgs/applications/video/kmplayer/default.nix
new file mode 100644
index 000000000000..274ff7cdeab7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kmplayer/default.nix
@@ -0,0 +1,48 @@
+{
+  mkDerivation, lib, fetchurl,
+  extra-cmake-modules, makeWrapper,
+  libpthreadstubs, libXdmcp,
+  qtsvg, qtx11extras, ki18n, kdelibs4support, kio, kmediaplayer, kwidgetsaddons,
+  phonon, cairo, mplayer
+}:
+
+mkDerivation rec {
+  majorMinorVersion = "0.12";
+  patchVersion = "0b";
+  version = "${majorMinorVersion}.${patchVersion}";
+  pname = "kmplayer";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/kmplayer/${majorMinorVersion}/kmplayer-${version}.tar.bz2";
+    sha256 = "0wzdxym4fc83wvqyhcwid65yv59a2wvp1lq303cn124mpnlwx62y";
+  };
+
+  patches = [
+    ./kmplayer_part-plugin_metadata.patch # Qt 5.9 doesn't like an empty string for the optional "FILE" argument of "Q_PLUGIN_METADATA"
+    ./no-docs.patch # Don't build docs due to errors (kdelibs4support propagates kdoctools)
+  ];
+
+  postPatch = ''
+    sed -i src/kmplayer.desktop \
+      -e "s,^Exec.*,Exec=$out/bin/kmplayer -qwindowtitle %c %i %U,"
+  '';
+
+  nativeBuildInputs = [ extra-cmake-modules makeWrapper ];
+
+  buildInputs = [
+    libpthreadstubs libXdmcp
+    qtsvg qtx11extras ki18n kdelibs4support kio kmediaplayer kwidgetsaddons
+    phonon cairo
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/kmplayer --suffix PATH : ${mplayer}/bin
+  '';
+
+  meta = with lib; {
+    description = "MPlayer front-end for KDE";
+    license = with licenses; [ gpl2 lgpl2 fdl12 ];
+    homepage = "https://kmplayer.kde.org/";
+    maintainers = with maintainers; [ sander zraexy ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/kmplayer/kmplayer_part-plugin_metadata.patch b/nixpkgs/pkgs/applications/video/kmplayer/kmplayer_part-plugin_metadata.patch
new file mode 100644
index 000000000000..9b6652b0be58
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kmplayer/kmplayer_part-plugin_metadata.patch
@@ -0,0 +1,11 @@
+--- a/src/kmplayer_part.h
++++ b/src/kmplayer_part.h
+@@ -36,7 +36,7 @@
+ 
+ class KMPlayerFactory : public KPluginFactory {
+     Q_OBJECT
+-    Q_PLUGIN_METADATA(IID "org.kde.KPluginFactory" FILE "")
++    Q_PLUGIN_METADATA(IID "org.kde.KPluginFactory")
+     Q_INTERFACES(KPluginFactory)
+ public:
+     KMPlayerFactory();
diff --git a/nixpkgs/pkgs/applications/video/kmplayer/no-docs.patch b/nixpkgs/pkgs/applications/video/kmplayer/no-docs.patch
new file mode 100644
index 000000000000..c93453f908c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kmplayer/no-docs.patch
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -79,9 +79,6 @@
+ 
+ add_subdirectory(src)
+ add_subdirectory(icons)
+-if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc" AND KF5DocTools_VERSION)
+-  add_subdirectory(doc)
+-endif(KF5DocTools_VERSION)
+ add_subdirectory(data)
+ 
+ if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
diff --git a/nixpkgs/pkgs/applications/video/kodi/default.nix b/nixpkgs/pkgs/applications/video/kodi/default.nix
new file mode 100644
index 000000000000..1ef3c9ee70f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kodi/default.nix
@@ -0,0 +1,295 @@
+{ stdenv, lib, fetchpatch, fetchurl, fetchFromGitHub, autoconf, automake, libtool, makeWrapper, linuxHeaders
+, pkgconfig, cmake, gnumake, yasm, python2Packages
+, libgcrypt, libgpgerror, libunistring
+, boost, avahi, lame, autoreconfHook
+, gettext, pcre-cpp, yajl, fribidi, which
+, openssl, gperf, tinyxml2, taglib, libssh, swig, jre
+, libxml2, systemd
+, alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl
+, libjpeg, libpng, libtiff
+, libmpeg2, libsamplerate, libmad
+, libogg, libvorbis, flac, libxslt
+, lzo, libcdio, libmodplug, libass, libbluray
+, sqlite, libmysqlclient, nasm, gnutls, libva, libdrm
+, curl, bzip2, zip, unzip, glxinfo
+, libcec, libcec_platform, dcadec, libuuid
+, libcrossguid, libmicrohttpd
+, bluez, doxygen, giflib, glib, harfbuzz, lcms2, libidn, libpthreadstubs, libtasn1
+, libplist, p11-kit, zlib, flatbuffers, fmt, fstrcmp, rapidjson
+, lirc
+, x11Support ? true, libX11, xorgproto, libXt, libXmu, libXext, libXinerama, libXrandr, libXtst, libXfixes, xdpyinfo, libXdmcp
+, dbusSupport ? true, dbus ? null
+, joystickSupport ? true, cwiid ? null
+, nfsSupport ? true, libnfs ? null
+, pulseSupport ? true, libpulseaudio ? null
+, rtmpSupport ? true, rtmpdump ? null
+, sambaSupport ? true, samba ? null
+, udevSupport ? true, udev ? null
+, usbSupport  ? false, libusb-compat-0_1 ? null
+, vdpauSupport ? true, libvdpau ? null
+, useWayland ? false, wayland ? null, wayland-protocols ? null
+, waylandpp ?  null, libxkbcommon ? null
+, useGbm ? false, mesa ? null, libinput ? null
+, buildPackages
+}:
+
+assert dbusSupport  -> dbus != null;
+assert nfsSupport   -> libnfs != null;
+assert pulseSupport -> libpulseaudio != null;
+assert rtmpSupport  -> rtmpdump != null;
+assert sambaSupport -> samba != null;
+assert udevSupport  -> udev != null;
+assert usbSupport   -> libusb-compat-0_1 != null && ! udevSupport; # libusb-compat-0_1 won't be used if udev is avaliable
+assert vdpauSupport -> libvdpau != null;
+assert useWayland -> wayland != null && wayland-protocols != null && waylandpp != null && libxkbcommon != null;
+
+let
+  kodiReleaseDate = "20200301";
+  kodiVersion = "18.6";
+  rel = "Leia";
+
+  kodi_src = fetchFromGitHub {
+    owner  = "xbmc";
+    repo   = "xbmc";
+    rev    = "${kodiVersion}-${rel}";
+    sha256 = "0rwymipn5hljy5xrslzmrljmj6f9wb191wi7gjw20wl6sv44d0bk";
+  };
+
+  cmakeProto = fetchurl {
+    url = "https://raw.githubusercontent.com/pramsey/libght/ca9b1121c352ea10170636e170040e1af015bad1/cmake/modules/CheckPrototypeExists.cmake";
+    sha256  = "1zai82gm5x55n3xvdv7mns3ja6a2k81x9zz0nk42j6s2yb0fkjxh";
+  };
+
+  cmakeProtoPatch = ''
+    # get rid of windows headers as they will otherwise be found first
+    rm -rf msvc
+
+    cp ${cmakeProto} cmake/${cmakeProto.name}
+    # we need to enable support for C++ for check_prototype_exists to do its thing
+    substituteInPlace CMakeLists.txt --replace 'LANGUAGES C' 'LANGUAGES C CXX'
+    if [ -f cmake/CheckHeadersSTDC.cmake ]; then
+      sed -i cmake/CheckHeadersSTDC.cmake \
+        -e '7iinclude(CheckPrototypeExists)'
+    fi
+  '';
+
+  kodiDependency = { name, version, rev, sha256, ... } @attrs:
+    let
+      attrs' = builtins.removeAttrs attrs ["name" "version" "rev" "sha256"];
+    in stdenv.mkDerivation ({
+      name = "kodi-${lib.toLower name}-${version}";
+      src = fetchFromGitHub {
+        owner = "xbmc";
+        repo  = name;
+        inherit rev sha256;
+      };
+      enableParallelBuilding = true;
+    } // attrs');
+
+  ffmpeg = kodiDependency rec {
+    name    = "FFmpeg";
+    version = "4.0.3";
+    rev     = "${version}-${rel}-18.2";
+    sha256  = "1krsjlr949iy5l6ljxancza1yi6w1annxc5s6k283i9mb15qy8cy";
+    preConfigure = ''
+      cp ${kodi_src}/tools/depends/target/ffmpeg/{CMakeLists.txt,*.cmake} .
+      sed -i 's/ --cpu=''${CPU}//' CMakeLists.txt
+      sed -i 's/--strip=''${CMAKE_STRIP}/--strip=''${CMAKE_STRIP} --ranlib=''${CMAKE_RANLIB}/' CMakeLists.txt
+    '';
+    cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      "-DCROSSCOMPILING=ON"
+      "-DCPU=${stdenv.hostPlatform.parsed.cpu.name}"
+      "-DOS=${stdenv.hostPlatform.parsed.kernel.name}"
+      "-DPKG_CONFIG_EXECUTABLE=pkgconfig"
+    ];
+    buildInputs = [ libidn libtasn1 p11-kit zlib libva ]
+      ++ lib.optional  vdpauSupport    libvdpau;
+    nativeBuildInputs = [ cmake nasm pkgconfig gnutls ];
+  };
+
+  # We can build these externally but FindLibDvd.cmake forces us to build it
+  # them, so we currently just use them for the src.
+  libdvdcss = kodiDependency rec {
+    name              = "libdvdcss";
+    version           = "1.4.2";
+    rev               = "${version}-${rel}-Beta-5";
+    sha256            = "0j41ydzx0imaix069s3z07xqw9q95k7llh06fc27dcn6f7b8ydyl";
+    buildInputs       = [ linuxHeaders ];
+    nativeBuildInputs = [ cmake pkgconfig ];
+    postPatch = ''
+      rm -rf msvc
+
+      substituteInPlace config.h.cm \
+        --replace '#cmakedefine O_BINARY "''${O_BINARY}"' '#define O_BINARY 0'
+    '';
+    cmakeFlags = [
+      "-DBUILD_SHARED_LIBS=1"
+      "-DHAVE_LINUX_DVD_STRUCT=1"
+    ];
+  };
+
+  libdvdnav = kodiDependency rec {
+    name              = "libdvdnav";
+    version           = "6.0.0";
+    rev               = "${version}-${rel}-Alpha-3";
+    sha256            = "0qwlf4lgahxqxk1r2pzl866mi03pbp7l1fc0rk522sc0ak2s9jhb";
+    buildInputs       = [ libdvdcss libdvdread ];
+    nativeBuildInputs = [ cmake pkgconfig ];
+    postPatch         = cmakeProtoPatch;
+    postInstall = ''
+      mv $out/lib/liblibdvdnav.so $out/lib/libdvdnav.so
+    '';
+  };
+
+  libdvdread = kodiDependency rec {
+    name              = "libdvdread";
+    version           = "6.0.0";
+    rev               = "${version}-${rel}-Alpha-3";
+    sha256            = "1xxn01mhkdnp10cqdr357wx77vyzfb5glqpqyg8m0skyi75aii59";
+    buildInputs       = [ libdvdcss ];
+    nativeBuildInputs = [ cmake pkgconfig ];
+    configureFlags    = [ "--with-libdvdcss" ];
+    postPatch         = cmakeProtoPatch;
+  };
+
+in stdenv.mkDerivation {
+    name = "kodi-${lib.optionalString useWayland "wayland-"}${kodiVersion}";
+
+    src = kodi_src;
+
+    buildInputs = [
+      gnutls libidn libtasn1 nasm p11-kit
+      libxml2 python2Packages.python
+      boost libmicrohttpd
+      gettext pcre-cpp yajl fribidi libva libdrm
+      openssl gperf tinyxml2 taglib libssh
+      alsaLib libGL libGLU fontconfig freetype ftgl
+      libjpeg libpng libtiff
+      libmpeg2 libsamplerate libmad
+      libogg libvorbis flac libxslt systemd
+      lzo libcdio libmodplug libass libbluray
+      sqlite libmysqlclient avahi lame
+      curl bzip2 zip unzip glxinfo
+      libcec libcec_platform dcadec libuuid
+      libgcrypt libgpgerror libunistring
+      libcrossguid libplist
+      bluez giflib glib harfbuzz lcms2 libpthreadstubs
+      ffmpeg flatbuffers fmt fstrcmp rapidjson
+      lirc
+      # libdvdcss libdvdnav libdvdread
+    ]
+    ++ lib.optional x11Support [
+      libX11 xorgproto libXt libXmu libXext.dev libXdmcp
+      libXinerama libXrandr.dev libXtst libXfixes
+    ]
+    ++ lib.optional  dbusSupport     dbus
+    ++ lib.optional joystickSupport cwiid
+    ++ lib.optional  nfsSupport      libnfs
+    ++ lib.optional  pulseSupport    libpulseaudio
+    ++ lib.optional  rtmpSupport     rtmpdump
+    ++ lib.optional  sambaSupport    samba
+    ++ lib.optional  udevSupport     udev
+    ++ lib.optional  usbSupport      libusb-compat-0_1
+    ++ lib.optional  vdpauSupport    libvdpau
+    ++ lib.optionals useWayland [
+      wayland 
+      waylandpp.dev 
+      wayland-protocols
+      # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise
+      libxkbcommon.dev
+    ]
+    ++ lib.optional useGbm [
+      libxkbcommon.dev
+      mesa.dev
+      libinput.dev
+    ];
+
+    nativeBuildInputs = [
+      cmake
+      doxygen
+      makeWrapper
+      which
+      pkgconfig gnumake
+      autoconf automake libtool # still needed for some components. Check if that is the case with 19.0
+      jre yasm gettext python2Packages.python flatbuffers
+
+      # for TexturePacker
+      giflib zlib libpng libjpeg lzo
+    ] ++ lib.optionals useWayland [ wayland-protocols waylandpp.bin ];
+
+    depsBuildBuild = [
+      buildPackages.stdenv.cc
+    ];
+
+    cmakeFlags = [
+      "-Dlibdvdcss_URL=${libdvdcss.src}"
+      "-Dlibdvdnav_URL=${libdvdnav.src}"
+      "-Dlibdvdread_URL=${libdvdread.src}"
+      "-DGIT_VERSION=${kodiReleaseDate}"
+      "-DENABLE_EVENTCLIENTS=ON"
+      "-DENABLE_INTERNAL_CROSSGUID=OFF"
+      "-DENABLE_OPTICAL=ON"
+      "-DLIRC_DEVICE=/run/lirc/lircd"
+      "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig"
+      "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc"
+      "-DPYTHON_EXECUTABLE=${buildPackages.python2Packages.python}/bin/python"
+    ] ++ lib.optional useWayland [
+      "-DCORE_PLATFORM_NAME=wayland"
+      "-DWAYLAND_RENDER_SYSTEM=gl"
+      "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++"
+    ] ++ lib.optional useGbm [
+      "-DCORE_PLATFORM_NAME=gbm"
+      "-DGBM_RENDER_SYSTEM=gles"
+    ];
+
+    enableParallelBuilding = true;
+
+    # 14 tests fail but the biggest issue is that every test takes 30 seconds -
+    # I'm guessing there is a thing waiting to time out
+    doCheck = false;
+
+    # Need these tools on the build system when cross compiling,
+    # hacky, but have found no other way.
+    preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+      CXX=c++ LD=ld make -C tools/depends/native/JsonSchemaBuilder
+      cmakeFlags+=" -DWITH_JSONSCHEMABUILDER=$PWD/tools/depends/native/JsonSchemaBuilder/bin"
+
+      CXX=c++ LD=ld make EXTRA_CONFIGURE= -C tools/depends/native/TexturePacker
+      cmakeFlags+=" -DWITH_TEXTUREPACKER=$PWD/tools/depends/native/TexturePacker/bin"
+    '';
+
+    postPatch = ''
+      substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \
+        --replace 'usr/share/zoneinfo' 'etc/zoneinfo'
+    '';
+
+    postInstall = ''
+      for p in $(ls $out/bin/) ; do
+        wrapProgram $out/bin/$p \
+          --prefix PATH            ":" "${lib.makeBinPath ([ python2Packages.python glxinfo ] ++ lib.optional x11Support xdpyinfo)}" \
+          --prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
+              ([ curl systemd libmad libvdpau libcec libcec_platform libass ]
+                 ++ lib.optional nfsSupport libnfs
+                 ++ lib.optional rtmpSupport rtmpdump)}"
+      done
+
+      substituteInPlace $out/share/xsessions/kodi.desktop \
+        --replace kodi-standalone $out/bin/kodi-standalone
+    '';
+
+    doInstallCheck = true;
+
+    installCheckPhase = "$out/bin/kodi --version";
+
+    passthru = {
+      pythonPackages = python2Packages;
+    };
+
+    meta = with stdenv.lib; {
+      description = "Media center";
+      homepage    = "https://kodi.tv/";
+      license     = licenses.gpl2;
+      platforms   = platforms.linux;
+      maintainers = with maintainers; [ domenkozar titanous edwtjo peterhoeg sephalon ];
+    };
+}
diff --git a/nixpkgs/pkgs/applications/video/kodi/plugins.nix b/nixpkgs/pkgs/applications/video/kodi/plugins.nix
new file mode 100644
index 000000000000..0e23eac9a866
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kodi/plugins.nix
@@ -0,0 +1,552 @@
+{ stdenv, callPackage, fetchFromGitHub
+, cmake, kodiPlain, libcec_platform, tinyxml, rapidxml
+, steam, udev, libusb1, jsoncpp, libhdhomerun, zlib
+, python2Packages, expat, glib, nspr, nss, openssl
+, libssh, libarchive, lzma, bzip2, lz4, lzo }:
+
+with stdenv.lib;
+
+let self = rec {
+
+  pluginDir = "/share/kodi/addons";
+  rel = "Leia";
+
+  kodi = kodiPlain;
+
+  # Convert derivation to a kodi module. Stolen from ../../../top-level/python-packages.nix
+  toKodiPlugin = drv: drv.overrideAttrs(oldAttrs: {
+    # Use passthru in order to prevent rebuilds when possible.
+    passthru = (oldAttrs.passthru or {})// {
+      kodiPluginFor = kodi;
+      requiredKodiPlugins = requiredKodiPlugins drv.propagatedBuildInputs;
+    };
+  });
+
+  # Check whether a derivation provides a Kodi plugin.
+  hasKodiPlugin = drv: drv ? kodiPluginFor && drv.kodiPluginFor == kodi;
+
+  # Get list of required Kodi plugins given a list of derivations.
+  requiredKodiPlugins = drvs: let
+      modules = filter hasKodiPlugin drvs;
+    in unique (modules ++ concatLists (catAttrs "requiredKodiPlugins" modules));
+
+  kodiWithPlugins = func: callPackage ./wrapper.nix {
+    inherit kodi;
+    plugins = requiredKodiPlugins (func self);
+  };
+
+  kodi-platform = stdenv.mkDerivation rec {
+    project = "kodi-platform";
+    version = "17.1";
+    name = "${project}-${version}";
+
+    src = fetchFromGitHub {
+      owner = "xbmc";
+      repo = project;
+      rev = "c8188d82678fec6b784597db69a68e74ff4986b5";
+      sha256 = "1r3gs3c6zczmm66qcxh9mr306clwb3p7ykzb70r3jv5jqggiz199";
+    };
+
+    buildInputs = [ cmake kodiPlain libcec_platform tinyxml ];
+  };
+
+  mkKodiPlugin = { plugin, namespace, version, sourceDir ? null, ... }@args:
+  toKodiPlugin (stdenv.mkDerivation ({
+    name = "kodi-plugin-${plugin}-${version}";
+
+    dontStrip = true;
+
+    extraRuntimeDependencies = [ ];
+
+    installPhase = ''
+      ${if sourceDir == null then "" else "cd $src/$sourceDir"}
+      d=$out${pluginDir}/${namespace}
+      mkdir -p $d
+      sauce="."
+      [ -d ${namespace} ] && sauce=${namespace}
+      cp -R "$sauce/"* $d
+    '';
+  } // args));
+
+  mkKodiABIPlugin = { plugin, namespace, version, extraBuildInputs ? [],
+    extraRuntimeDependencies ? [], extraInstallPhase ? "", ... }@args:
+  toKodiPlugin (stdenv.mkDerivation ({
+    name = "kodi-plugin-${plugin}-${version}";
+
+    dontStrip = true;
+
+    buildInputs = [ cmake kodiPlain kodi-platform libcec_platform ]
+               ++ extraBuildInputs;
+
+    inherit extraRuntimeDependencies;
+
+    # disables check ensuring install prefix is that of kodi
+    cmakeFlags = [
+      "-DOVERRIDE_PATHS=1"
+    ];
+
+    # kodi checks for plugin .so libs existance in the addon folder (share/...)
+    # and the non-wrapped kodi lib/... folder before even trying to dlopen
+    # them. Symlinking .so, as setting LD_LIBRARY_PATH is of no use
+    installPhase = let n = namespace; in ''
+      make install
+      ln -s $out/lib/addons/${n}/${n}.so.${version} $out${pluginDir}/${n}/${n}.so.${version}
+      ${extraInstallPhase}
+    '';
+  } // args));
+
+  advanced-launcher = mkKodiPlugin rec {
+
+    plugin = "advanced-launcher";
+    namespace = "plugin.program.advanced.launcher";
+    version = "2.5.8";
+
+    src = fetchFromGitHub {
+      owner = "edwtjo";
+      repo = plugin;
+      rev = version;
+      sha256 = "142vvgs37asq5m54xqhjzqvgmb0xlirvm0kz6lxaqynp0vvgrkx2";
+    };
+
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=85724";
+      description = "A program launcher for Kodi";
+      longDescription = ''
+        Advanced Launcher allows you to start any Linux, Windows and
+        macOS external applications (with command line support or not)
+        directly from the Kodi GUI. Advanced Launcher also give you
+        the possibility to edit, download (from Internet resources)
+        and manage all the meta-data (informations and images) related
+        to these applications.
+      '';
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+  };
+
+  advanced-emulator-launcher = mkKodiPlugin rec {
+
+    plugin = "advanced-emulator-launcher";
+    namespace = "plugin.program.advanced.emulator.launcher";
+    version = "0.9.6";
+
+    src = fetchFromGitHub {
+      owner = "Wintermute0110";
+      repo = namespace;
+      rev = version;
+      sha256 = "1sv9z77jj6bam6llcnd9b3dgkbvhwad2m1v541rv3acrackms2z2";
+    };
+
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=287826";
+      description = "A program launcher for Kodi";
+      longDescription = ''
+        Advanced Emulator Launcher is a multi-emulator front-end for Kodi
+        scalable to collections of thousands of ROMs. Includes offline scrapers
+        for MAME and No-Intro ROM sets and also supports scrapping ROM metadata
+        and artwork online. ROM auditing for No-Intro ROMs using No-Intro XML
+        DATs. Launching of games and standalone applications is also available.
+      '';
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+  };
+
+  controllers = let
+    pname = "game-controller";
+    version = "1.0.3";
+
+    src = fetchFromGitHub {
+      owner = "kodi-game";
+      repo = "kodi-game-controllers";
+      rev = "01acb5b6e8b85392b3cb298b034aadb1b24ccf18";
+      sha256 = "0sbc0w0fwbp7rbmbgb6a1kglhnn5g85hijcbbvf5x6jdq9v3f1qb";
+    };
+
+    meta = {
+      description = "Add support for different gaming controllers.";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+    mkController = controller: {
+        ${controller} = mkKodiPlugin rec {
+          plugin = pname + "-" + controller;
+          namespace = "game.controller." + controller;
+          sourceDir = "addons/" + namespace;
+          inherit version src meta;
+        };
+      };
+    in (mkController "default")
+    // (mkController "dreamcast")
+    // (mkController "gba")
+    // (mkController "genesis")
+    // (mkController "mouse")
+    // (mkController "n64")
+    // (mkController "nes")
+    // (mkController "ps")
+    // (mkController "snes");
+
+  hyper-launcher = let
+    pname = "hyper-launcher";
+    version = "1.5.2";
+    src = fetchFromGitHub rec {
+      name = pname + "-" + version + ".tar.gz";
+      owner = "teeedubb";
+      repo = owner + "-xbmc-repo";
+      rev = "f958ba93fe85b9c9025b1745d89c2db2e7dd9bf6";
+      sha256 = "1dvff24fbas25k5kvca4ssks9l1g5rfa3hl8lqxczkaqi3pp41j5";
+    };
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=258159";
+      description = "A ROM launcher for Kodi that uses HyperSpin assets.";
+      maintainers = with maintainers; [ edwtjo ];
+    };
+  in {
+    service = mkKodiPlugin {
+      plugin = pname + "-service";
+      version = "1.2.1";
+      namespace = "service.hyper.launcher";
+      inherit src meta;
+    };
+    plugin = mkKodiPlugin {
+      plugin = pname;
+      namespace = "plugin.hyper.launcher";
+      inherit version src meta;
+    };
+  };
+
+  joystick = mkKodiABIPlugin rec {
+    namespace = "peripheral.joystick";
+    version = "1.4.7";
+    plugin = namespace;
+
+    src = fetchFromGitHub {
+      owner = "xbmc";
+      repo = namespace;
+      rev = "v${version}";
+      sha256 = "03gsp4kg41s3n4ib4wsv7m3krfipgwc2z07i4mnd5zvg0c4xrmap";
+    };
+
+    meta = {
+      description = "Binary addon for raw joystick input.";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+    extraBuildInputs = [ udev ];
+  };
+
+  simpleplugin = mkKodiPlugin rec {
+    plugin = "simpleplugin";
+    namespace = "script.module.simpleplugin";
+    version = "2.3.2";
+
+    src = fetchFromGitHub {
+      owner = "romanvm";
+      repo = namespace;
+      rev = "v.${version}";
+      sha256 = "0myar8dqjigb75pcc8zx3i5z79p1ifgphgb82s5syqywk0zaxm3j";
+    };
+
+    meta = {
+      homepage = src.meta.homepage;
+      description = "Simpleplugin API";
+      license = licenses.gpl3;
+    };
+  };
+
+  svtplay = mkKodiPlugin rec {
+
+    plugin = "svtplay";
+    namespace = "plugin.video.svtplay";
+    version = "4.0.48";
+
+    src = fetchFromGitHub {
+      name = plugin + "-" + version + ".tar.gz";
+      owner = "nilzen";
+      repo = "xbmc-" + plugin;
+      rev = "dc18ad002cd69257611d0032fba91f57bb199165";
+      sha256 = "0klk1jpjc243ak306k94mag4b4s17w68v69yb8lzzydszqkaqa7x";
+    };
+
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=67110";
+      description = "Watch content from SVT Play";
+      longDescription = ''
+        With this addon you can stream content from SVT Play
+        (svtplay.se). The plugin fetches the video URL from the SVT
+        Play website and feeds it to the Kodi video player. HLS (m3u8)
+        is the preferred video format by the plugin.
+      '';
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+  };
+
+  steam-controller = mkKodiABIPlugin rec {
+    namespace = "peripheral.steamcontroller";
+    version = "0.10.0";
+    plugin = namespace;
+
+    src = fetchFromGitHub {
+      owner = "kodi-game";
+      repo = namespace;
+      rev = "ea345392ab5aa4485f3a48d2037fa8a8e8ab82de";
+      sha256 = "1hbd8fdvn7xkr9csz1g9wah78nhnq1rkazl4zwa31y70830k3279";
+    };
+
+    extraBuildInputs = [ libusb1 ];
+
+    meta = {
+      description = "Binary addon for steam controller.";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ edwtjo ];
+    };
+
+  };
+
+  steam-launcher = mkKodiPlugin {
+
+    plugin = "steam-launcher";
+    namespace = "script.steam.launcher";
+    version = "3.1.4";
+
+    src = fetchFromGitHub rec {
+      owner = "teeedubb";
+      repo = owner + "-xbmc-repo";
+      rev = "db67704c3e16bdcdd3bdfe2926c609f1f6bdc4fb";
+      sha256 = "001a7zs3a4jfzj8ylxv2klc33mipmqsd5aqax7q81fbgwdlndvbm";
+    };
+
+    propagatedBuildInputs = [ steam ];
+
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=157499";
+      description = "Launch Steam in Big Picture Mode from Kodi";
+      longDescription = ''
+        This add-on will close/minimise Kodi, launch Steam in Big
+        Picture Mode and when Steam BPM is exited (either by quitting
+        Steam or returning to the desktop) Kodi will
+        restart/maximise. Running pre/post Steam scripts can be
+        configured via the addon.
+      '';
+      maintainers = with maintainers; [ edwtjo ];
+    };
+  };
+
+  pdfreader = mkKodiPlugin rec {
+    plugin = "pdfreader";
+    namespace = "plugin.image.pdf";
+    version = "1.0.2";
+
+    src = fetchFromGitHub rec {
+      name = plugin + "-" + version + ".tar.gz";
+      owner = "teeedubb";
+      repo = owner + "-xbmc-repo";
+      rev = "0a405b95208ced8a1365ad3193eade8d1c2117ce";
+      sha256 = "1iv7d030z3xvlflvp4p5v3riqnwg9g0yvzxszy63v1a6x5kpjkqa";
+    };
+
+    meta = {
+      homepage = "https://forum.kodi.tv/showthread.php?tid=187421";
+      description = "A comic book reader";
+      maintainers = with maintainers; [ edwtjo ];
+    };
+  };
+
+  pvr-hts = mkKodiABIPlugin rec {
+
+    plugin = "pvr-hts";
+    namespace = "pvr.hts";
+    version = "4.4.14";
+
+    src = fetchFromGitHub {
+      owner = "kodi-pvr";
+      repo = "pvr.hts";
+      rev = "${version}-${rel}";
+      sha256 = "1bcwcwd2yjhw85yk6lyhf0iqiclrsz7r7vpbxgc650fwqbb146gr";
+    };
+
+    meta = {
+      homepage = "https://github.com/kodi-pvr/pvr.hts";
+      description = "Kodi's Tvheadend HTSP client addon";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ cpages ];
+    };
+
+  };
+
+  pvr-hdhomerun = mkKodiABIPlugin rec {
+
+    plugin = "pvr-hdhomerun";
+    namespace = "pvr.hdhomerun";
+    version = "3.5.0";
+
+    src = fetchFromGitHub {
+      owner = "kodi-pvr";
+      repo = "pvr.hdhomerun";
+      rev = "${version}-${rel}";
+      sha256 = "1zrkvfn0im2qmvqm93pa3cg8xkxv61sxlj8nsz4r5z9v9nhqadf6";
+    };
+
+    meta = {
+      homepage = "https://github.com/kodi-pvr/pvr.hdhomerun";
+      description = "Kodi's HDHomeRun PVR client addon";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ titanous ];
+    };
+
+    extraBuildInputs = [ jsoncpp libhdhomerun ];
+
+  };
+
+  pvr-iptvsimple = mkKodiABIPlugin rec {
+
+    plugin = "pvr-iptvsimple";
+    namespace = "pvr.iptvsimple";
+    version = "3.5.7";
+
+    src = fetchFromGitHub {
+      owner = "kodi-pvr";
+      repo = "pvr.iptvsimple";
+      rev = "${version}-${rel}";
+      sha256 = "17znib7c491h2ii4gagxradh0jyvgga0d548gbk4yjj2nc9qqc6d";
+    };
+
+    meta = {
+      homepage = "https://github.com/kodi-pvr/pvr.iptvsimple";
+      description = "Kodi's IPTV Simple client addon";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ ];
+      license = licenses.gpl2Plus;
+    };
+
+    extraBuildInputs = [ zlib rapidxml ];
+  };
+
+  osmc-skin = mkKodiPlugin rec {
+
+    plugin = "osmc-skin";
+    namespace = "skin.osmc";
+    version = "18.0.0";
+
+    src = fetchFromGitHub {
+      owner = "osmc";
+      repo = namespace;
+      rev = "40a6c318641e2cbeac58fb0e7dde9c2beac737a0";
+      sha256 = "1l7hyfj5zvjxjdm94y325bmy1naak455b9l8952sb0gllzrcwj6s";
+    };
+
+    meta = {
+      homepage = "https://github.com/osmc/skin.osmc";
+      description = "The default skin for OSMC";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ worldofpeace ];
+      license = licenses.cc-by-nc-sa-30;
+    };
+  };
+
+  yatp = python2Packages.toPythonModule (mkKodiPlugin rec {
+    plugin = "yatp";
+    namespace = "plugin.video.yatp";
+    version = "3.3.2";
+
+    src = fetchFromGitHub {
+      owner = "romanvm";
+      repo = "kodi.yatp";
+      rev = "v.${version}";
+      sha256 = "12g1f57sx7dy6wy7ljl7siz2qs1kxcmijcg7xx2xpvmq61x9qa2d";
+    };
+
+    patches = [ ./yatp/dont-monkey.patch ];
+
+    propagatedBuildInputs = [
+      simpleplugin
+      python2Packages.requests
+      python2Packages.libtorrentRasterbar
+    ];
+
+    meta = {
+      homepage = src.meta.homepage;
+      description = "Yet Another Torrent Player: libtorrent-based torrent streaming for Kodi";
+      license = licenses.gpl3;
+    };
+  });
+
+  inputstream-adaptive = mkKodiABIPlugin rec {
+
+    plugin = "inputstream-adaptive";
+    namespace = "inputstream.adaptive";
+    version = "2.3.12";
+
+    src = fetchFromGitHub {
+      owner = "peak3d";
+      repo = "inputstream.adaptive";
+      rev = version;
+      sha256 = "09d9b35mpaf3g5m51viyan9hv7d2i8ndvb9wm0j7rs5gwsf0k71z";
+    };
+
+    extraBuildInputs = [ expat ];
+
+    extraRuntimeDependencies = [ glib nspr nss stdenv.cc.cc.lib ];
+
+    extraInstallPhase = let n = namespace; in ''
+      ln -s $out/lib/addons/${n}/libssd_wv.so $out/${pluginDir}/${n}/libssd_wv.so
+    '';
+
+    meta = {
+      homepage = "https://github.com/peak3d/inputstream.adaptive";
+      description = "Kodi inputstream addon for several manifest types";
+      platforms = platforms.all;
+      maintainers = with maintainers; [ sephalon ];
+    };
+  };
+
+  vfs-sftp = mkKodiABIPlugin rec {
+    namespace = "vfs.sftp";
+    version = "1.0.6";
+    plugin = namespace;
+
+    src = fetchFromGitHub {
+      owner = "xbmc";
+      repo = namespace;
+      rev = "${version}-${rel}";
+      sha256 = "044kkzcpzvbyih4vys33r4hqw38xa82snmvl4qj1r80wnszc8af1";
+    };
+
+    meta = with stdenv.lib; {
+      description = "SFTP Virtual Filesystem add-on for Kodi";
+      license = licenses.gpl2Plus;
+      platforms = platforms.all;
+      maintainers = with maintainers; [ minijackson ];
+    };
+
+    extraBuildInputs = [ openssl libssh zlib ];
+  };
+
+  vfs-libarchive = mkKodiABIPlugin rec {
+    namespace = "vfs.libarchive";
+    version = "1.0.7";
+    plugin = namespace;
+
+    src = fetchFromGitHub {
+      owner = "xbmc";
+      repo = namespace;
+      rev = "${version}-${rel}";
+      sha256 = "01qhv095h5j67ispm4iw18pd3kl7a0mnjkgm92al9qqiyif8lzgh";
+    };
+
+    meta = with stdenv.lib; {
+      description = "LibArchive Virtual Filesystem add-on for Kodi";
+      license = licenses.gpl2Plus;
+      platforms = platforms.all;
+      maintainers = with maintainers; [ minijackson ];
+    };
+
+    extraBuildInputs = [ libarchive lzma bzip2 zlib lz4 lzo openssl ];
+  };
+}; in self
diff --git a/nixpkgs/pkgs/applications/video/kodi/wrapper.nix b/nixpkgs/pkgs/applications/video/kodi/wrapper.nix
new file mode 100644
index 000000000000..6a0b1cbdf739
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kodi/wrapper.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, makeWrapper, buildEnv, kodi, plugins }:
+
+let
+  drvName = builtins.parseDrvName kodi.name;
+in buildEnv {
+  name = "${drvName.name}-with-plugins-${drvName.version}";
+
+  paths = [ kodi ] ++ plugins;
+  pathsToLink = [ "/share" ];
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    mkdir $out/bin
+    for exe in kodi{,-standalone}
+    do
+      makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
+        --prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath plugins} \
+        --prefix KODI_HOME : $out/share/kodi \
+        --prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
+          (stdenv.lib.concatMap
+            (plugin: plugin.extraRuntimeDependencies) plugins)}"
+    done
+  '';
+
+  meta = kodi.meta // {
+    description = kodi.meta.description
+                + " (with plugins: ${lib.concatMapStringsSep ", " (x: x.name) plugins})";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/kodi/yatp/dont-monkey.patch b/nixpkgs/pkgs/applications/video/kodi/yatp/dont-monkey.patch
new file mode 100644
index 000000000000..62d5d0c0d4c0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/kodi/yatp/dont-monkey.patch
@@ -0,0 +1,29 @@
+diff --git a/plugin.video.yatp/server.py b/plugin.video.yatp/server.py
+index 1adcbb5..488b72c 100644
+--- a/plugin.video.yatp/server.py
++++ b/plugin.video.yatp/server.py
+@@ -20,24 +20,8 @@ addon = Addon()
+ _ = addon.initialize_gettext()
+ addon.log_notice('Starting Torrent Server...')
+ 
+-# A monkey-patch to set the necessary librorrent version
+-librorrent_addon = Addon('script.module.libtorrent')
+-orig_custom_version = librorrent_addon.get_setting('custom_version', False)
+-orig_set_version = librorrent_addon.get_setting('set_version', False)
+-librorrent_addon.set_setting('custom_version', 'true')
+-if addon.libtorrent_version == '1.0.9':
+-    librorrent_addon.set_setting('set_version', '4')
+-elif addon.libtorrent_version == '1.1.0':
+-    librorrent_addon.set_setting('set_version', '5')
+-elif addon.libtorrent_version == '1.1.1':
+-    librorrent_addon.set_setting('set_version', '6')
+-else:
+-    librorrent_addon.set_setting('set_version', '0')
+-
+ from libs.server import wsgi_app
+ 
+-librorrent_addon.set_setting('custom_version', orig_custom_version)
+-librorrent_addon.set_setting('set_version', orig_set_version)
+ # ======
+ 
+ if addon.enable_limits:
diff --git a/nixpkgs/pkgs/applications/video/lightworks/default.nix b/nixpkgs/pkgs/applications/video/lightworks/default.nix
new file mode 100644
index 000000000000..ae156574f5da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/lightworks/default.nix
@@ -0,0 +1,87 @@
+{ stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv
+, gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, gnome2, libGLU
+, nvidia_cg_toolkit, zlib, openssl, portaudio
+}:
+let
+  fullPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc
+    gtk3
+    gdk-pixbuf
+    cairo
+    libjpeg_original
+    glib
+    gnome2.pango
+    libGLU
+    nvidia_cg_toolkit
+    zlib
+    openssl
+    portaudio
+  ];
+
+  lightworks = stdenv.mkDerivation rec {
+    version = "14.0.0";
+    pname = "lightworks";
+
+    src =
+      if stdenv.hostPlatform.system == "x86_64-linux" then
+        fetchurl {
+          url = "http://downloads.lwks.com/v14/lwks-14.0.0-amd64.deb";
+          sha256 = "66eb9f9678d979db76199f1c99a71df0ddc017bb47dfda976b508849ab305033";
+        }
+      else throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
+
+    buildInputs = [ dpkg makeWrapper ];
+
+    phases = [ "unpackPhase" "installPhase" ];
+    unpackPhase = "dpkg-deb -x ${src} ./";
+
+    installPhase = ''
+      mkdir -p $out/bin
+      substitute usr/bin/lightworks $out/bin/lightworks \
+        --replace "/usr/lib/lightworks" "$out/lib/lightworks"
+      chmod +x $out/bin/lightworks
+
+      cp -r usr/lib $out
+
+      # /usr/share/fonts is not normally searched
+      # This adds it to lightworks' search path while keeping the default
+      # using the FONTCONFIG_FILE env variable
+      echo "<?xml version='1.0'?>
+      <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+      <fontconfig>
+          <dir>/usr/share/fonts/truetype</dir>
+          <include>/etc/fonts/fonts.conf</include>
+      </fontconfig>" > $out/lib/lightworks/fonts.conf
+
+      patchelf \
+        --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        $out/lib/lightworks/ntcardvt
+
+      wrapProgram $out/lib/lightworks/ntcardvt \
+        --prefix LD_LIBRARY_PATH : ${fullPath}:$out/lib/lightworks \
+        --set FONTCONFIG_FILE $out/lib/lightworks/fonts.conf
+
+      cp -r usr/share $out/share
+    '';
+
+    dontPatchELF = true;
+  };
+
+# Lightworks expects some files in /usr/share/lightworks
+in buildFHSUserEnv {
+  name = lightworks.name;
+
+  targetPkgs = pkgs: [
+      lightworks
+  ];
+
+  runScript = "lightworks";
+
+  meta = {
+    description = "Professional Non-Linear Video Editor";
+    homepage = "https://www.lwks.com/";
+    license = stdenv.lib.licenses.unfree;
+    maintainers = [ stdenv.lib.maintainers.antonxy ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/linuxstopmotion/default.nix b/nixpkgs/pkgs/applications/video/linuxstopmotion/default.nix
new file mode 100644
index 000000000000..3a2d1b79e9e0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/linuxstopmotion/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchgit, pkgconfig, qt4, SDL, SDL_image, libvorbis, libtar, libxml2
+, gamin, qmake4Hook
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.8";
+  pname = "linuxstopmotion";
+  
+  src = fetchgit {
+    url = "git://git.code.sf.net/p/linuxstopmotion/code";
+    rev = "refs/tags/${version}";
+    sha256 = "19v9d0v3laiwi0f1n92lvj2s5s1mxsrfygna0xyw9pkcnk3b26q6";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ qt4 SDL SDL_image libvorbis libtar libxml2 gamin qmake4Hook ];
+
+  patches = [ ./linuxstopmotion-fix-wrong-isProcess-logic.patch ];
+
+  # Installation breaks without this
+  preInstall = ''
+    mkdir -p "$out/share/stopmotion/translations/"
+    cp -v build/*.qm "$out/share/stopmotion/translations/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Create stop-motion animation movies";
+    homepage = "http://linuxstopmotion.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch b/nixpkgs/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch
new file mode 100644
index 000000000000..caab48d0e2d9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch
@@ -0,0 +1,33 @@
+From b23b7dab1d540b0710fcb9ded1c6256a49844906 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
+Date: Wed, 20 Aug 2014 22:22:00 +0200
+Subject: [PATCH] Fix wrong "isProcess" logic
+
+Stopmotion wrongly thinks that uvccapture should be run as a daemon,
+even though configuration for uvccapture has no "daemon-like" command
+line to be run (according to "preferences"). The result is an error
+popup instead of video/image grabbing.
+
+This brings back the "isProcess" logic that was in stopmotion v0.7.2,
+because it seems to work, while the current logic (v0.8.0) seems to
+fail.
+---
+ src/presentation/frontends/qtfrontend/frameview.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/presentation/frontends/qtfrontend/frameview.cpp b/src/presentation/frontends/qtfrontend/frameview.cpp
+index e44dca7..d2c41fd 100644
+--- a/src/presentation/frontends/qtfrontend/frameview.cpp
++++ b/src/presentation/frontends/qtfrontend/frameview.cpp
+@@ -270,7 +270,7 @@ bool FrameView::on() {
+ 	Preference device(QString("device%1")
+ 			.arg(activeDev).toLatin1().constData(), "");
+ 	QString pre = QString(prepoll.get()).replace("$VIDEODEVICE", device.get());
+-	bool isProcess = startDaemon.get();
++	bool isProcess = (strcmp(startDaemon.get(), "") == 0) ? false : true;
+ 
+ 	bool isCameraReady = true;
+ 	this->grabber = new CommandLineGrabber(capturedFile.path(), isProcess);
+-- 
+2.0.2
+
diff --git a/nixpkgs/pkgs/applications/video/lxdvdrip/default.nix b/nixpkgs/pkgs/applications/video/lxdvdrip/default.nix
new file mode 100644
index 000000000000..16ade40f0b5a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/lxdvdrip/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, libdvdread }:
+
+stdenv.mkDerivation rec {
+  name = "lxdvdrip-1.76";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lxdvdrip/${name}.tgz";
+    sha256 = "0vgslc7dapfrbgslnaicc8bggdccyrvcgjv1dwi19qswhh7jkzj6";
+  };
+
+  prePatch = ''
+    sed -i -e s,/usr/local,$out, -e s,/etc,$out/etc,g Makefile
+    sed -i -e s,/usr/local,$out, buffer/Makefile
+    makeFlags="$makeFlags PREFIX=$out"
+  '';
+
+  preInstall = ''
+    mkdir -p $out/man/man1 $out/bin $out/share $out/etc
+  '';
+
+  buildInputs = [ libdvdread ];
+
+  meta = { 
+    description = "Command line tool to make a copy from a video DVD for private use";
+    homepage = "https://sourceforge.net/projects/lxdvdrip";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/makemkv/default.nix b/nixpkgs/pkgs/applications/video/makemkv/default.nix
new file mode 100644
index 000000000000..56247b278260
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/makemkv/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, mkDerivation, fetchurl, autoPatchelfHook
+, ffmpeg_3, openssl, qtbase, zlib, pkgconfig
+}:
+
+let
+  version = "1.15.1";
+  # Using two URLs as the first one will break as soon as a new version is released
+  src_bin = fetchurl {
+    urls = [
+      "http://www.makemkv.com/download/makemkv-bin-${version}.tar.gz"
+      "http://www.makemkv.com/download/old/makemkv-bin-${version}.tar.gz"
+    ];
+    sha256 = "0c9661sdlld8b1g2pk8lbn3gz7cikh9bjqss11ffkriwii1x9fw0";
+  };
+  src_oss = fetchurl {
+    urls = [
+      "http://www.makemkv.com/download/makemkv-oss-${version}.tar.gz"
+      "http://www.makemkv.com/download/old/makemkv-oss-${version}.tar.gz"
+    ];
+    sha256 = "0rm1zykqagy2g8hb7pjrc6akdsym8pgdnx66hnna161jbah3sssy";
+  };
+in mkDerivation {
+  pname = "makemkv";
+  inherit version;
+
+  srcs = [ src_bin src_oss ];
+
+  sourceRoot = "makemkv-oss-${version}";
+
+  nativeBuildInputs = [ autoPatchelfHook pkgconfig ];
+
+  buildInputs = [ ffmpeg_3 openssl qtbase zlib ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm555 -t $out/bin           out/makemkv ../makemkv-bin-${version}/bin/amd64/makemkvcon
+    install -D     -t $out/lib           out/lib{driveio,makemkv,mmbd}.so.*
+    install -D     -t $out/share/MakeMKV ../makemkv-bin-${version}/src/share/*
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Convert blu-ray and dvd to mkv";
+    longDescription = ''
+      makemkv is a one-click QT application that transcodes an encrypted
+      blu-ray or DVD disc into a more portable set of mkv files, preserving
+      subtitles, chapter marks, all video and audio tracks.
+
+      Program is time-limited -- it will stop functioning after 60 days. You
+      can always download the latest version from makemkv.com that will reset the
+      expiration date.
+    '';
+    license = licenses.unfree;
+    homepage = "http://makemkv.com";
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/manim/default.nix b/nixpkgs/pkgs/applications/video/manim/default.nix
new file mode 100644
index 000000000000..667b2bb2b885
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/manim/default.nix
@@ -0,0 +1,64 @@
+{ lib, buildPythonApplication, fetchFromGitHub, pythonOlder, file, fetchpatch
+, cairo, ffmpeg_3, sox, xdg_utils, texlive
+, colour, numpy, pillow, progressbar, scipy, tqdm, opencv , pycairo, pydub
+, pbr, fetchPypi
+}:
+buildPythonApplication rec {
+  pname = "manim";
+  version = "0.1.10";
+
+  src = fetchPypi {
+    pname = "manimlib";
+    inherit version;
+    sha256 = "0vg9b3rwypq5zir74pi0pmj47yqlcg7hrvscwrpjzjbqq2yihn49";
+  };
+
+  patches = [ ./remove-dependency-constraints.patch ];
+
+  nativeBuildInputs = [ pbr ];
+
+  propagatedBuildInputs = [
+    colour
+    numpy
+    pillow
+    progressbar
+    scipy
+    tqdm
+    opencv
+    pycairo
+    pydub
+
+    cairo sox ffmpeg_3 xdg_utils
+  ];
+
+  # Test with texlive to see whether it works but don't propagate
+  # because it's huge and optional
+  # TODO: Use smaller TexLive distribution
+  #       Doesn't need everything but it's hard to figure out what it needs
+  checkInputs = [ cairo sox ffmpeg_3 xdg_utils texlive.combined.scheme-full ];
+
+  # Simple test and complex test with LaTeX
+  checkPhase = ''
+    for scene in SquareToCircle OpeningManimExample
+    do
+      python3 manim.py example_scenes.py $scene -l
+      tail -n 20 files/Tex/*.log  # Print potential LaTeX erorrs
+      ${file}/bin/file videos/example_scenes/480p15/$scene.mp4 \
+        | tee | grep -F "ISO Media, MP4 Base Media v1 [IS0 14496-12:2003]"
+    done
+  '';
+
+  disabled = pythonOlder "3.7";
+
+  meta = {
+    description = "Animation engine for explanatory math videos";
+    longDescription = ''
+      Manim is an animation engine for explanatory math videos. It's used to
+      create precise animations programmatically, as seen in the videos of
+      3Blue1Brown on YouTube.
+    '';
+    homepage = "https://github.com/3b1b/manim";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ johnazoidberg ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/manim/remove-dependency-constraints.patch b/nixpkgs/pkgs/applications/video/manim/remove-dependency-constraints.patch
new file mode 100644
index 000000000000..4a7da45d0f57
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/manim/remove-dependency-constraints.patch
@@ -0,0 +1,26 @@
+diff --git i/requirements.txt w/requirements.txt
+index 556122ad..11fd49d5 100644
+--- i/requirements.txt
++++ w/requirements.txt
+@@ -1,11 +1,10 @@
+-argparse==1.4.0
+-colour==0.1.5
+-numpy==1.15.0
+-Pillow==5.2.0
+-progressbar==2.5
+-scipy==1.1.0
+-tqdm==4.24.0
+-opencv-python==3.4.2.17
+-pycairo==1.17.1; sys_platform == 'linux'
+-pycairo>=1.18.0; sys_platform == 'win32'
+-pydub==0.23.0
++colour
++numpy
++Pillow
++progressbar
++scipy
++tqdm
++pycairo
++pycairo>=1.18.1; sys_platform == 'win32'
++pydub
++pyreadline==2.1; sys_platform == 'win32'
diff --git a/nixpkgs/pkgs/applications/video/mapmap/default.nix b/nixpkgs/pkgs/applications/video/mapmap/default.nix
new file mode 100644
index 000000000000..20ab4d750326
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mapmap/default.nix
@@ -0,0 +1,64 @@
+{ stdenv 
+, fetchFromGitHub
+, qttools
+, qtmultimedia
+, liblo
+, gst_all_1
+, qmake
+, pkgconfig
+}:
+
+with stdenv;
+
+mkDerivation rec {
+
+  version = "0.6.1";
+  pname = "mapmap";
+
+  src = fetchFromGitHub {
+    owner = "mapmapteam";
+    repo = "mapmap";
+    rev = version;
+    sha256 = "15km6xmfkxhrflq4sl9m9r85zi4shrr4k5h15x17v7x0qkc3xgsh";
+  };
+
+  nativeBuildInputs = [
+    qmake
+    pkgconfig
+  ];
+
+  buildInputs = [
+    qttools
+    qtmultimedia
+    liblo
+    gst_all_1.gstreamer
+    gst_all_1.gstreamermm
+    gst_all_1.gst-libav
+    gst_all_1.gst-vaapi
+  ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp mapmap $out/bin/mapmap
+    mkdir -p $out/share/applications/
+    sed 's|Icon=/usr/share/icons/hicolor/scalable/apps/mapmap.svg|Icon=mapmap|g' resources/texts/mapmap.desktop > $out/share/applications/mapmap.desktop
+    mkdir -p $out/share/icons/hicolor/scalable/apps/
+    cp resources/images/logo/mapmap.* $out/share/icons/hicolor/scalable/apps/
+  '';
+
+  # RPATH in /tmp hack
+  # preFixup = ''
+  #   rm -r $NIX_BUILD_TOP/__nix_qt5__
+  # '';
+
+  meta = with stdenv.lib; {
+    description = "Open source video mapping software";
+    homepage = "https://github.com/mapmapteam/mapmap";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.erictapen ];
+    platforms = platforms.linux;
+    # binary segfaults at the moment
+    broken = true;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/video/mediathekview/default.nix b/nixpkgs/pkgs/applications/video/mediathekview/default.nix
new file mode 100644
index 000000000000..7c7ceb914ae7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mediathekview/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, makeWrapper, jre }:
+
+stdenv.mkDerivation rec {
+  version = "13.5.1";
+  pname = "mediathekview";
+  src = fetchurl {
+    url = "https://download.mediathekview.de/stabil/MediathekView-${version}-linux.tar.gz";
+    sha256 = "0fixr6drim0wmh4q44zikcla4mrnm44nm95d5naqsgx6idalddrc";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib}
+
+    install -m644 MediathekView.jar $out/lib
+
+    makeWrapper ${jre}/bin/java $out/bin/mediathek \
+      --add-flags "-Xmx1G -jar $out/lib/MediathekView.jar"
+
+    makeWrapper ${jre}/bin/java $out/bin/MediathekView \
+      --add-flags "-Xmx1G -jar $out/lib/MediathekView.jar"
+
+    makeWrapper ${jre}/bin/java $out/bin/MediathekView_ipv4 \
+      --add-flags "-Xmx1G -Djava.net.preferIPv4Stack=true -jar $out/lib/MediathekView.jar"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Offers access to the Mediathek of different tv stations (ARD, ZDF, Arte, etc.)";
+    homepage = "https://mediathekview.de/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ moredread ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/minitube/default.nix b/nixpkgs/pkgs/applications/video/minitube/default.nix
new file mode 100644
index 000000000000..690b8355340c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/minitube/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, wrapQtAppsHook, phonon, phonon-backend-vlc, qtbase, qmake
+, qtdeclarative, qttools, qtx11extras, mpv
+
+# "Free" key generated by nckx <github@tobias.gr>. I no longer have a Google
+# account. You'll need to generate (and please share :-) a new one if it breaks.
+, withAPIKey ? "AIzaSyBtFgbln3bu1swQC-naMxMtKh384D3xJZE" }:
+
+stdenv.mkDerivation rec {
+  pname = "minitube";
+  version = "3.2";
+
+  src = fetchFromGitHub {
+    sha256 = "0175sgqmszakqd631bni4aqjpx68h6n49zjvg23fb1yyancnkn4c";
+    rev = version;
+    repo = "minitube";
+    owner = "flaviotordini";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ phonon phonon-backend-vlc qtbase qtdeclarative qttools qtx11extras mpv ];
+  nativeBuildInputs = [ wrapQtAppsHook qmake ];
+
+  qmakeFlags = [ "DEFINES+=APP_GOOGLE_API_KEY=${withAPIKey}" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Stand-alone YouTube video player";
+    longDescription = ''
+      Watch YouTube videos in a new way: you type a keyword, Minitube gives
+      you an endless video stream. Minitube is not about cloning the YouTube
+      website, it aims to create a new TV-like experience.
+    '';
+    homepage = "https://flavio.tordini.org/minitube";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mjpg-streamer/default.nix b/nixpkgs/pkgs/applications/video/mjpg-streamer/default.nix
new file mode 100644
index 000000000000..d1efae4a9244
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mjpg-streamer/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake, libjpeg }:
+
+stdenv.mkDerivation {
+  pname = "mjpg-streamer";
+  version = "unstable-2019-05-24";
+
+  src = fetchFromGitHub {
+    owner = "jacksonliam";
+    repo = "mjpg-streamer";
+    rev = "501f6362c5afddcfb41055f97ae484252c85c912";
+    sha256 = "1cl159svfs1zzzrd3zgn4x7qy6751bvlnxfwf5hn5fmg4iszajw7";
+  };
+
+  prePatch = ''
+    cd mjpg-streamer-experimental
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libjpeg ];
+
+  postFixup = ''
+    patchelf --set-rpath "$(patchelf --print-rpath $out/bin/mjpg_streamer):$out/lib/mjpg-streamer" $out/bin/mjpg_streamer
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/jacksonliam/mjpg-streamer";
+    description = "MJPG-streamer takes JPGs from Linux-UVC compatible webcams, filesystem or other input plugins and streams them as M-JPEG via HTTP to webbrowsers, VLC and other software";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mkclean/default.nix b/nixpkgs/pkgs/applications/video/mkclean/default.nix
new file mode 100644
index 000000000000..4a3cbc81b35e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mkclean/default.nix
@@ -0,0 +1,37 @@
+{ dos2unix, fetchurl, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "mkclean";
+  version = "0.8.10";
+
+  hardeningDisable = [ "format" ];
+  nativeBuildInputs = [ dos2unix ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/matroska/${pname}-${version}.tar.bz2";
+    sha256 = "0zbpi4sm68zb20d53kbss93fv4aafhcmz7dsd0zdf01vj1r3wxwn";
+  };
+
+  configurePhase = ''
+    dos2unix ./mkclean/configure.compiled
+    ./mkclean/configure.compiled
+  '';
+
+  buildPhase = ''
+    make -C mkclean
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib}
+    mv release/gcc_linux_*/*.* $out/lib
+    mv release/gcc_linux_*/* $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "mkclean is a command line tool to clean and optimize Matroska (.mkv / .mka / .mks / .mk3d) and WebM (.webm / .weba) files that have already been muxed.";
+    homepage = "https://www.matroska.org";
+    license = licenses.bsdOriginal;
+    maintainers = with maintainers; [ chrisaw ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mkvtoolnix/default.nix b/nixpkgs/pkgs/applications/video/mkvtoolnix/default.nix
new file mode 100644
index 000000000000..68f3cac1bfac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mkvtoolnix/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitLab, pkgconfig, autoconf, automake, libiconv, drake
+, ruby, docbook_xsl, file, xdg_utils, gettext, expat, boost, libebml, zlib
+, fmt, libmatroska, libogg, libvorbis, flac, libxslt, cmark
+, withGUI ? true
+  , qtbase ? null
+  , qtmultimedia ? null
+  , wrapQtAppsHook ? null
+}:
+
+assert withGUI -> qtbase != null && qtmultimedia != null && wrapQtAppsHook != null;
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "mkvtoolnix";
+  version = "47.0.0";
+
+  src = fetchFromGitLab {
+    owner  = "mbunkus";
+    repo   = "mkvtoolnix";
+    rev    = "release-${version}";
+    sha256 = "1s8y9khyfjg06mr7rmm26pk0b3nbkcrs56r29a9l57wbkqyl7qp9";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig autoconf automake gettext
+    drake ruby docbook_xsl libxslt
+  ];
+
+  buildInputs = [
+    expat file xdg_utils boost libebml zlib fmt
+    libmatroska libogg libvorbis flac cmark
+  ] ++ optional  stdenv.isDarwin libiconv
+    ++ optionals withGUI [ qtbase qtmultimedia wrapQtAppsHook ];
+
+  preConfigure = "./autogen.sh; patchShebangs .";
+  buildPhase   = "drake -j $NIX_BUILD_CORES";
+  installPhase = "drake install -j $NIX_BUILD_CORES";
+
+  configureFlags = [
+    "--enable-magic"
+    "--enable-optimization"
+    "--with-boost-libdir=${boost.out}/lib"
+    "--disable-debug"
+    "--disable-profiling"
+    "--disable-precompiled-headers"
+    "--disable-static-qt"
+    "--with-gettext"
+    "--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
+    (enableFeature withGUI "qt")
+  ];
+
+  CXXFLAGS = optional stdenv.cc.isClang "-std=c++17";
+
+  dontWrapQtApps = true;
+  postFixup = optionalString withGUI ''
+    wrapQtApp $out/bin/mkvtoolnix-gui
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Cross-platform tools for Matroska";
+    homepage    = "http://www.bunkus.org/videotools/mkvtoolnix/";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ codyopel rnhmjoj ];
+    platforms   = platforms.linux
+      ++ optionals (!withGUI) platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mlv-app/aarch64-flags.patch b/nixpkgs/pkgs/applications/video/mlv-app/aarch64-flags.patch
new file mode 100644
index 000000000000..b8c025b3b3fc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mlv-app/aarch64-flags.patch
@@ -0,0 +1,13 @@
+diff --git a/platform/qt/MLVApp.pro b/platform/qt/MLVApp.pro
+index ebdc552..3e37573 100644
+--- a/platform/qt/MLVApp.pro
++++ b/platform/qt/MLVApp.pro
+@@ -84,7 +84,7 @@ win32{
+
+ # Linux
+ linux-g++*{
+-    QMAKE_CFLAGS += -O3 -fopenmp -msse4.1 -mssse3 -msse3 -msse2 -msse -std=c99
++    QMAKE_CFLAGS += -O3 -fopenmp -march=native -std=c99
+     QMAKE_CXXFLAGS += -fopenmp
+     LIBS += -lgomp
+ }
diff --git a/nixpkgs/pkgs/applications/video/mlv-app/default.nix b/nixpkgs/pkgs/applications/video/mlv-app/default.nix
new file mode 100644
index 000000000000..757759b1146f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mlv-app/default.nix
@@ -0,0 +1,62 @@
+{ fetchFromGitHub
+, lib
+, mkDerivation
+, qmake
+, qtbase
+, qtmultimedia
+, stdenv
+}:
+
+mkDerivation rec {
+  pname = "mlv-app";
+  version = "1.11";
+
+  src = fetchFromGitHub {
+    owner = "ilia3101";
+    repo = "MLV-App";
+    rev = "QTv${version}";
+    sha256 = "0s5sjdxi8a17ddvih4ara7mlb2xrc9xqx52jmhfaca6ng341gi4x";
+  };
+
+  patches = if stdenv.isAarch64 then ./aarch64-flags.patch else null;
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm555 -t $out/bin                mlvapp
+    install -Dm444 -t $out/share/applications mlvapp.desktop
+    install -Dm444 -t $out/share/icons/hicolor/512x512/apps RetinaIMG/MLVAPP.png
+    runHook postInstall
+  '';
+
+  qmakeFlags = [ "MLVApp.pro" ];
+
+  preConfigure = ''
+    export HOME=$TMPDIR
+    cd platform/qt/
+  '';
+
+  buildInputs = [
+    qtmultimedia
+    qtbase
+  ];
+
+  dontWrapQtApps = true;
+
+  preFixup = ''
+    wrapQtApp "$out/bin/mlvapp"
+  '';
+
+  nativeBuildInputs = [
+    qmake
+  ];
+
+  meta = with lib; {
+    description = "All in one MLV processing app that is pretty great";
+    homepage = "https://mlv.app";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [
+      kiwi
+    ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/motion/default.nix b/nixpkgs/pkgs/applications/video/motion/default.nix
new file mode 100644
index 000000000000..175958afb7e0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/motion/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+, ffmpeg_3, libjpeg, libmicrohttpd }:
+
+stdenv.mkDerivation rec {
+  pname = "motion";
+  version = "4.3.0";
+
+  src = fetchFromGitHub {
+    owner  = "Motion-Project";
+    repo   = "motion";
+    rev    = "Release-${version}";
+    sha256 = "08mm7ajgs0qnrydywxxyzcll09z80crjnjkjnckdi6ljsj6s96j8";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = [ ffmpeg_3 libjpeg libmicrohttpd ];
+
+  meta = with stdenv.lib; {
+    description = "Monitors the video signal from cameras";
+    homepage = "https://motion-project.github.io/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ puffnfresh veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mpc-qt/default.nix b/nixpkgs/pkgs/applications/video/mpc-qt/default.nix
new file mode 100644
index 000000000000..07b4c79a5b3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpc-qt/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, mkDerivation, fetchFromGitLab, pkgconfig, qmake, qtx11extras, qttools, mpv }:
+
+mkDerivation rec {
+  pname = "mpc-qt";
+  version = "2019-06-09";
+
+  src = fetchFromGitLab {
+    owner = "mpc-qt";
+    repo = "mpc-qt";
+    rev = "2abe6e7fc643068d50522468fe75d614861555ad";
+    sha256 = "1cis8dl9pm91mpnp696zvwsfp96gkwr8jgs45anbwd7ldw78w4x5";
+  };
+
+  nativeBuildInputs = [ pkgconfig qmake qttools ];
+
+  buildInputs = [ mpv qtx11extras ];
+
+  qmakeFlags = [ "QMAKE_LUPDATE=${qttools.dev}/bin/lupdate" ];
+
+  meta = with stdenv.lib; {
+    description = "Media Player Classic Qute Theater";
+    homepage = "https://gitlab.com/mpc-qt/mpc-qt";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mplayer/default.nix b/nixpkgs/pkgs/applications/video/mplayer/default.nix
new file mode 100644
index 000000000000..f00b5aabf977
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mplayer/default.nix
@@ -0,0 +1,226 @@
+{ config, stdenv, fetchurl, pkgconfig, freetype, yasm, ffmpeg_3
+, aalibSupport ? true, aalib ? null
+, fontconfigSupport ? true, fontconfig ? null, freefont_ttf ? null
+, fribidiSupport ? true, fribidi ? null
+, x11Support ? true, libX11 ? null, libXext ? null, libGLU, libGL ? null
+, xineramaSupport ? true, libXinerama ? null
+, xvSupport ? true, libXv ? null
+, alsaSupport ? stdenv.isLinux, alsaLib ? null
+, screenSaverSupport ? true, libXScrnSaver ? null
+, vdpauSupport ? false, libvdpau ? null
+, cddaSupport ? !stdenv.isDarwin, cdparanoia ? null
+, dvdnavSupport ? !stdenv.isDarwin, libdvdnav ? null
+, dvdreadSupport ? true, libdvdread ? null
+, bluraySupport ? true, libbluray ? null
+, amrSupport ? false, amrnb ? null, amrwb ? null
+, cacaSupport ? true, libcaca ? null
+, lameSupport ? true, lame ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, x264Support ? false, x264 ? null
+, jackaudioSupport ? false, libjack2 ? null
+, pulseSupport ? config.pulseaudio or false, libpulseaudio ? null
+, bs2bSupport ? false, libbs2b ? null
+# For screenshots
+, libpngSupport ? true, libpng ? null
+, libjpegSupport ? true, libjpeg ? null
+, useUnfreeCodecs ? false
+, darwin ? null
+, buildPackages
+}:
+
+assert fontconfigSupport -> (fontconfig != null);
+assert (!fontconfigSupport) -> (freefont_ttf != null);
+assert fribidiSupport -> (fribidi != null);
+assert x11Support -> (libX11 != null && libXext != null && libGLU != null && libGL != null);
+assert xineramaSupport -> (libXinerama != null && x11Support);
+assert xvSupport -> (libXv != null && x11Support);
+assert alsaSupport -> alsaLib != null;
+assert screenSaverSupport -> libXScrnSaver != null;
+assert vdpauSupport -> libvdpau != null;
+assert cddaSupport -> cdparanoia != null;
+assert dvdnavSupport -> libdvdnav != null;
+assert dvdreadSupport -> libdvdread != null;
+assert bluraySupport -> libbluray != null;
+assert amrSupport -> (amrnb != null && amrwb != null);
+assert cacaSupport -> libcaca != null;
+assert lameSupport -> lame != null;
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert x264Support -> x264 != null;
+assert jackaudioSupport -> libjack2 != null;
+assert pulseSupport -> libpulseaudio != null;
+assert bs2bSupport -> libbs2b != null;
+assert libpngSupport -> libpng != null;
+assert libjpegSupport -> libjpeg != null;
+
+let
+
+  codecs_src =
+    let
+      dir = "http://www.mplayerhq.hu/MPlayer/releases/codecs/";
+      version = "20071007";
+    in
+    if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
+      url = "${dir}/essential-${version}.tar.bz2";
+      sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic";
+    } else if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
+      url = "${dir}/essential-amd64-${version}.tar.bz2";
+      sha256 = "13xf5b92w1ra5hw00ck151lypbmnylrnznq9hhb0sj36z5wz290x";
+    } else if stdenv.hostPlatform.system == "powerpc-linux" then fetchurl {
+      url = "${dir}/essential-ppc-${version}.tar.bz2";
+      sha256 = "18mlj8dp4wnz42xbhdk1jlz2ygra6fbln9wyrcyvynxh96g1871z";
+    } else null;
+
+  codecs = if codecs_src != null then stdenv.mkDerivation {
+    pname = "MPlayer-codecs-essential";
+
+    src = codecs_src;
+
+    installPhase = ''
+      mkdir $out
+      cp -prv * $out
+    '';
+
+    meta.license = stdenv.lib.licenses.unfree;
+  } else null;
+
+  crossBuild = stdenv.hostPlatform != stdenv.buildPlatform;
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "mplayer";
+  version = "1.4";
+
+  src = fetchurl {
+    url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-${version}.tar.xz";
+    sha256 = "0j5mflr0wnklxsvnpmxvk704hscyn2785hvvihj2i3a7b3anwnc2";
+  };
+
+  prePatch = ''
+    sed -i /^_install_strip/d configure
+
+    rm -rf ffmpeg
+  '';
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ pkgconfig yasm ];
+  buildInputs = with stdenv.lib;
+    [ freetype ffmpeg_3 ]
+    ++ optional aalibSupport aalib
+    ++ optional fontconfigSupport fontconfig
+    ++ optional fribidiSupport fribidi
+    ++ optionals x11Support [ libX11 libXext libGLU libGL ]
+    ++ optional alsaSupport alsaLib
+    ++ optional xvSupport libXv
+    ++ optional theoraSupport libtheora
+    ++ optional cacaSupport libcaca
+    ++ optional xineramaSupport libXinerama
+    ++ optional dvdnavSupport libdvdnav
+    ++ optional dvdreadSupport libdvdread
+    ++ optional bluraySupport libbluray
+    ++ optional cddaSupport cdparanoia
+    ++ optional jackaudioSupport libjack2
+    ++ optionals amrSupport [ amrnb amrwb ]
+    ++ optional x264Support x264
+    ++ optional pulseSupport libpulseaudio
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional lameSupport lame
+    ++ optional vdpauSupport libvdpau
+    ++ optional speexSupport speex
+    ++ optional libpngSupport libpng
+    ++ optional libjpegSupport libjpeg
+    ++ optional bs2bSupport libbs2b
+    ++ (with darwin.apple_sdk.frameworks; optionals stdenv.isDarwin [ Cocoa OpenGL ])
+    ;
+
+  configurePlatforms = [ ];
+  configureFlags = with stdenv.lib; [
+    "--enable-freetype"
+    (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig")
+    (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl")
+    (if xineramaSupport then "--enable-xinerama" else "--disable-xinerama")
+    (if xvSupport then "--enable-xv" else "--disable-xv")
+    (if alsaSupport then "--enable-alsa" else "--disable-alsa")
+    (if screenSaverSupport then "--enable-xss" else "--disable-xss")
+    (if vdpauSupport then "--enable-vdpau" else "--disable-vdpau")
+    (if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia")
+    (if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav")
+    (if bluraySupport then "--enable-bluray" else "--disable-bluray")
+    (if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb")
+    (if cacaSupport then "--enable-caca" else "--disable-caca")
+    (if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc")
+    (if speexSupport then "--enable-speex" else "--disable-speex")
+    (if theoraSupport then "--enable-theora" else "--disable-theora")
+    (if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc")
+    (if jackaudioSupport then "" else "--disable-jack")
+    (if pulseSupport then "--enable-pulse" else "--disable-pulse")
+    "--disable-xanim"
+    "--disable-ivtv"
+    "--disable-xvid --disable-xvid-lavc"
+    "--disable-ossaudio"
+    "--disable-ffmpeg_a"
+    "--yasm=${buildPackages.yasm}/bin/yasm"
+    # Note, the `target` vs `host` confusion is intensional.
+    "--target=${stdenv.hostPlatform.config}"
+  ] ++ optional
+         (useUnfreeCodecs && codecs != null && !crossBuild)
+         "--codecsdir=${codecs}"
+    ++ optional
+         ((stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) && !crossBuild)
+         "--enable-runtime-cpudetection"
+    ++ optional fribidiSupport "--enable-fribidi"
+    ++ optional stdenv.isLinux "--enable-vidix"
+    ++ optional stdenv.isLinux "--enable-fbdev"
+    ++ optionals (crossBuild) [
+    "--enable-cross-compile"
+    "--disable-vidix-pcidb"
+    "--with-vidix-drivers=no"
+  ];
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--cc=$CC"
+      "--host-cc=$CC_FOR_BUILD"
+      "--as=$AS"
+      "--nm=$NM"
+      "--ar=$AR"
+      "--ranlib=$RANLIB"
+      "--windres=$WINDRES"
+    )
+  '';
+
+  postConfigure = ''
+    echo CONFIG_MPEGAUDIODSP=yes >> config.mak
+  '';
+
+  NIX_LDFLAGS = with stdenv.lib; toString (
+       optional  fontconfigSupport "-lfontconfig"
+    ++ optional  fribidiSupport "-lfribidi"
+    ++ optionals x11Support [ "-lX11" "-lXext" ]
+    ++ [ "-lfreetype" ]
+  );
+
+  installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui";
+
+  enableParallelBuilding = true;
+
+  # Provide a reasonable standard font when not using fontconfig. Maybe we should symlink here.
+  postInstall = stdenv.lib.optionalString (!fontconfigSupport)
+    ''
+      mkdir -p $out/share/mplayer
+      cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
+      if test -f $out/share/applications/mplayer.desktop ; then
+        echo "NoDisplay=True" >> $out/share/applications/mplayer.desktop
+      fi
+    '';
+
+  meta = {
+    description = "A movie player that supports many video formats";
+    homepage = "http://mplayerhq.hu";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mpv/default.nix b/nixpkgs/pkgs/applications/video/mpv/default.nix
new file mode 100644
index 000000000000..697a468f8908
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/default.nix
@@ -0,0 +1,237 @@
+{ config, stdenv, fetchurl, fetchFromGitHub, fetchpatch
+, addOpenGLRunpath, docutils, perl, pkgconfig, python3, wafHook, which
+, ffmpeg, freefont_ttf, freetype, libass, libpthreadstubs, mujs
+, nv-codec-headers, lua, libuchardet, libiconv ? null
+, CoreFoundation, Cocoa, CoreAudio, MediaPlayer
+
+, waylandSupport ? stdenv.isLinux
+  , wayland           ? null
+  , wayland-protocols ? null
+  , libxkbcommon      ? null
+
+, x11Support ? stdenv.isLinux
+  , libGLU, libGL ? null
+  , libX11          ? null
+  , libXext         ? null
+  , libXxf86vm      ? null
+  , libXrandr       ? null
+
+, cddaSupport ? false
+  , libcdio          ? null
+  , libcdio-paranoia ? null
+
+, vulkanSupport ? stdenv.isLinux
+  , libplacebo     ? null
+  , shaderc        ? null
+  , vulkan-headers ? null
+  , vulkan-loader  ? null
+
+, drmSupport ? stdenv.isLinux
+  , libdrm ? null
+  , mesa   ? null
+
+, alsaSupport        ? stdenv.isLinux, alsaLib       ? null
+, bluraySupport      ? true,           libbluray     ? null
+, bs2bSupport        ? true,           libbs2b       ? null
+, cacaSupport        ? true,           libcaca       ? null
+, cmsSupport         ? true,           lcms2         ? null
+, dvdnavSupport      ? stdenv.isLinux, libdvdnav     ? null
+, libpngSupport      ? true,           libpng        ? null
+, pulseSupport       ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
+, rubberbandSupport  ? stdenv.isLinux, rubberband    ? null
+# NOTE: samba support should be removed on the next mpv release, see also:
+# https://github.com/NixOS/nixpkgs/pull/89145#issuecomment-636424362
+# Please remove this line on the next mpv release.
+, sambaSupport       ? false,          samba         ? null
+, screenSaverSupport ? true,           libXScrnSaver ? null
+, sdl2Support        ? true,           SDL2          ? null
+, sndioSupport       ? true,           sndio         ? null
+, speexSupport       ? true,           speex         ? null
+, swiftSupport       ? false,          swift         ? null
+, theoraSupport      ? true,           libtheora     ? null
+, vaapiSupport       ? stdenv.isLinux, libva         ? null
+, vdpauSupport       ? true,           libvdpau      ? null
+, xineramaSupport    ? stdenv.isLinux, libXinerama   ? null
+, xvSupport          ? stdenv.isLinux, libXv         ? null
+, zimgSupport        ? true,           zimg          ? null
+, archiveSupport     ? true,           libarchive    ? null
+, jackaudioSupport   ? false,          libjack2      ? null
+, openalSupport      ? true,           openalSoft    ? null
+, vapoursynthSupport ? false,          vapoursynth   ? null
+}:
+
+with stdenv.lib;
+
+let
+  available = x: x != null;
+in
+assert alsaSupport        -> available alsaLib;
+assert archiveSupport     -> available libarchive;
+assert bluraySupport      -> available libbluray;
+assert bs2bSupport        -> available libbs2b;
+assert cacaSupport        -> available libcaca;
+assert cddaSupport        -> all available [ libcdio libcdio-paranoia ];
+assert cmsSupport         -> available lcms2;
+assert drmSupport         -> all available [ libdrm mesa ];
+assert dvdnavSupport      -> available libdvdnav;
+assert jackaudioSupport   -> available libjack2;
+assert libpngSupport      -> available libpng;
+assert openalSupport      -> available openalSoft;
+assert pulseSupport       -> available libpulseaudio;
+assert rubberbandSupport  -> available rubberband;
+assert screenSaverSupport -> available libXScrnSaver;
+assert sambaSupport       -> available samba;
+assert sdl2Support        -> available SDL2;
+assert sndioSupport       -> available sndio;
+assert speexSupport       -> available speex;
+assert theoraSupport      -> available libtheora;
+assert vaapiSupport       -> available libva;
+assert vapoursynthSupport -> available vapoursynth;
+assert vdpauSupport       -> available libvdpau;
+assert vulkanSupport      -> all available [ libplacebo shaderc vulkan-headers vulkan-loader ];
+assert waylandSupport     -> all available [ wayland wayland-protocols libxkbcommon ];
+assert x11Support         -> all available [ libGLU libGL libX11 libXext libXxf86vm libXrandr ];
+assert xineramaSupport    -> x11Support && available libXinerama;
+assert xvSupport          -> x11Support && available libXv;
+assert zimgSupport        -> available zimg;
+
+let
+  luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
+
+in stdenv.mkDerivation rec {
+  pname = "mpv";
+  version = "0.32.0";
+
+  src = fetchFromGitHub {
+    owner  = "mpv-player";
+    repo   = "mpv";
+    rev    = "v${version}";
+    sha256 = "0kmy1q0hp87vq4rpv7py04x8bpg1wmlzaibavmkf713jqp6qy596";
+  };
+
+  postPatch = ''
+    patchShebangs ./TOOLS/
+  '';
+
+  passthru = {
+    inherit
+    # The wrapper consults luaEnv and lua.version
+    luaEnv
+    lua
+    # In the wrapper, we want to reference vapoursynth which has the
+    # `python3` passthru attribute (which has the `sitePrefix`
+    # attribute). This way we'll be sure that in the wrapper we'll
+    # use the same python3.sitePrefix used to build vapoursynth.
+    vapoursynthSupport
+    vapoursynth
+    ;
+  };
+
+  NIX_LDFLAGS = optionalString x11Support "-lX11 -lXext "
+              + optionalString stdenv.isDarwin "-framework CoreFoundation";
+
+  wafConfigureFlags = [
+    "--enable-libmpv-shared"
+    "--enable-manpage-build"
+    "--disable-libmpv-static"
+    "--disable-static-build"
+    "--disable-build-date" # Purity
+    (enableFeature archiveSupport  "libarchive")
+    (enableFeature cddaSupport     "cdda")
+    (enableFeature dvdnavSupport   "dvdnav")
+    (enableFeature openalSupport   "openal")
+    (enableFeature sambaSupport    "libsmbclient")
+    (enableFeature sdl2Support     "sdl2")
+    (enableFeature sndioSupport    "sndio")
+    (enableFeature vaapiSupport    "vaapi")
+    (enableFeature waylandSupport  "wayland")
+    (enableFeature stdenv.isLinux  "dvbin")
+  ] # Disable whilst Swift isn't supported
+    ++ stdenv.lib.optional (!swiftSupport) "--disable-macos-cocoa-cb";
+
+  nativeBuildInputs = [
+    addOpenGLRunpath docutils perl pkgconfig python3 wafHook which
+  ]
+    ++ optional swiftSupport swift;
+
+  buildInputs = [
+    ffmpeg freetype libass libpthreadstubs
+    luaEnv libuchardet mujs
+  ] ++ optional alsaSupport        alsaLib
+    ++ optional archiveSupport     libarchive
+    ++ optional bluraySupport      libbluray
+    ++ optional bs2bSupport        libbs2b
+    ++ optional cacaSupport        libcaca
+    ++ optional cmsSupport         lcms2
+    ++ optional jackaudioSupport   libjack2
+    ++ optional libpngSupport      libpng
+    ++ optional openalSupport      openalSoft
+    ++ optional pulseSupport       libpulseaudio
+    ++ optional rubberbandSupport  rubberband
+    ++ optional sambaSupport       samba
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional sdl2Support        SDL2
+    ++ optional sndioSupport       sndio
+    ++ optional speexSupport       speex
+    ++ optional theoraSupport      libtheora
+    ++ optional vaapiSupport       libva
+    ++ optional vapoursynthSupport vapoursynth
+    ++ optional vdpauSupport       libvdpau
+    ++ optional xineramaSupport    libXinerama
+    ++ optional xvSupport          libXv
+    ++ optional zimgSupport        zimg
+    ++ optional stdenv.isDarwin    libiconv
+    ++ optional stdenv.isLinux     nv-codec-headers
+    ++ optionals cddaSupport       [ libcdio libcdio-paranoia ]
+    ++ optionals drmSupport        [ libdrm mesa ]
+    ++ optionals dvdnavSupport     [ libdvdnav libdvdnav.libdvdread ]
+    ++ optionals waylandSupport    [ wayland wayland-protocols libxkbcommon ]
+    ++ optionals x11Support        [ libX11 libXext libGLU libGL libXxf86vm libXrandr ]
+    ++ optionals vulkanSupport     [ libplacebo shaderc vulkan-headers vulkan-loader ]
+    ++ optionals stdenv.isDarwin   [ CoreFoundation Cocoa CoreAudio MediaPlayer ];
+
+  enableParallelBuilding = true;
+
+  postBuild = optionalString stdenv.isDarwin ''
+    python3 TOOLS/osxbundle.py -s build/mpv
+  '';
+
+  patches = stdenv.lib.optionals stdenv.isDarwin [
+    # Fix cocoa backend. Remove with the next release
+    (fetchpatch {
+      url = "https://github.com/mpv-player/mpv/commit/188169854313b99d01da8f69fe129f0a487eb7c4.patch";
+      sha256 = "062sz4666prb2wg1rn5q8brqkzlq6lxn8sxic78a8lb0125c01f7";
+    })
+  ];
+
+  postInstall = ''
+    # Use a standard font
+    mkdir -p $out/share/mpv
+    ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf
+
+    cp TOOLS/umpv $out/bin
+  '' + optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    cp -r build/mpv.app $out/Applications
+  '';
+
+  # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.
+  # See the explanation in addOpenGLRunpath.
+  postFixup = optionalString stdenv.isLinux ''
+    addOpenGLRunpath $out/bin/mpv
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A media player that supports many video formats (MPlayer and mplayer2 fork)";
+    homepage = "https://mpv.io";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres fpletz globin ma27 tadeokondrak ];
+    platforms = platforms.darwin ++ platforms.linux;
+
+    longDescription = ''
+      mpv is a free and open-source general-purpose video player,
+      based on the MPlayer and mplayer2 projects, with great
+      improvements above both.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mpv/scripts/convert.nix b/nixpkgs/pkgs/applications/video/mpv/scripts/convert.nix
new file mode 100644
index 000000000000..ce0695203328
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/scripts/convert.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchgit, lib
+, yad, mkvtoolnix-cli, libnotify }:
+
+stdenv.mkDerivation {
+  pname = "mpv-convert-script";
+  version = "2016-03-18";
+  src = fetchgit {
+    url = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
+    rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d";
+    sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck";
+  };
+
+  patches = [ ./convert.patch ];
+
+  postPatch =
+    let
+      t = k: v: '' 'local ${k} = "${v}"' '';
+      subs = var: orig: repl: "--replace " + t var orig + t var repl;
+    in ''
+      substituteInPlace convert_script.lua \
+        ${subs "NOTIFY_CMD" "notify-send" "${libnotify}/bin/notify-send"} \
+        ${subs "YAD_CMD" "yad" "${yad}/bin/yad"} \
+        ${subs "MKVMERGE_CMD" "mkvmerge" "${mkvtoolnix-cli}/bin/mkvmerge"}
+  '';
+
+  dontBuild = true;
+  installPhase = ''
+    mkdir -p $out/share/mpv/scripts
+    cp convert_script.lua $out/share/mpv/scripts
+  '';
+  passthru.scriptName = "convert_script.lua";
+
+  meta = {
+    description = "Convert parts of a video while you are watching it in mpv";
+    homepage = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
+    maintainers = [ lib.maintainers.Profpatsch ];
+    longDescription = ''
+      When this script is loaded into mpv, you can hit Alt+W to mark the beginning
+      and Alt+W again to mark the end of the clip. Then a settings window opens.
+    '';
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/video/mpv/scripts/convert.patch b/nixpkgs/pkgs/applications/video/mpv/scripts/convert.patch
new file mode 100644
index 000000000000..82171210b415
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/scripts/convert.patch
@@ -0,0 +1,67 @@
+--- convert/convert_script.lua	2016-03-18 19:30:49.675401969 +0100
++++ convert_script.lua	2016-03-19 01:18:00.801897043 +0100
+@@ -3,6 +3,10 @@
+ local opt = require 'mp.options'
+ local utils = require 'mp.utils'
+ 
++local NOTIFY_CMD = "notify-send"
++local YAD_CMD = "yad"
++local MKVMERGE_CMD = "mkvmerge"
++
+ -- default options, convert_script.conf is read
+ local options = {
+     bitrate_multiplier = 0.975,			-- to make sure the file won’t go over the target file size, set it to 1 if you don’t care
+@@ -247,12 +247,12 @@
+     if string.len(vf) > 0 then
+         vf = vf .. ","
+     end
+-    local sub_file_table = mp.get_property_native("options/sub-file")
++    local sub_file_table = mp.get_property_native("options/sub-files")
+     local sub_file = ""
+     for index, param in pairs(sub_file_table) do
+         sub_file = sub_file .. " --sub-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
+     end
+-    local audio_file_table = mp.get_property_native("options/audio-file")
++    local audio_file_table = mp.get_property_native("options/audio-files")
+     local audio_file = ""
+     for index, param in pairs(audio_file_table) do
+         audio_file = audio_file .. " --audio-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
+@@ -354,9 +358,9 @@
+     if ovc == "gif" then
+         full_command = full_command .. ' --vf-add=lavfi=graph=\\"framestep=' .. framestep .. '\\" && convert ' 
+         .. tmpfolder .. '/*.png -set delay ' .. delay .. ' -loop 0 -fuzz ' .. fuzz .. '% ' .. dither .. ' -layers optimize '
+-        .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && notify-send "Gif done") & disown'
++        .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && ' .. NOTIFY_CMD .. ' "Gif done") & disown'
+     else
+-        full_command = full_command .. ' && notify-send "Encoding done"; mkvpropedit '
++        full_command = full_command .. ' && ' .. NOTIFY_CMD .. ' "Encoding done"; mkvpropedit '
+         .. full_output_path .. ' -s title="' .. metadata_title .. '") & disown'
+     end
+     
+@@ -409,7 +413,7 @@
+     sep = ",+"
+     
+     if enc then
+-        local command = "mkvmerge '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
++        local command = MKVMERGE_CMD .. " '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
+         msg.info(command)
+         os.execute(command)
+         clear()
+@@ -508,7 +512,7 @@
+     end
+     
+     
+-    local yad_command = [[LC_NUMERIC=C yad --title="Convert Script" --center --form --fixed --always-print-result \
++    local yad_command = [[LC_NUMERIC=C ]] .. YAD_CMD .. [[ --title="Convert Script" --center --form --fixed --always-print-result \
+     --name "convert script" --class "Convert Script" --field="Resize to height:NUM" "]] .. scale_sav		--yad_table 1
+     .. [[" --field="Resize to width instead:CHK" ]] .. resize_to_width_instead .. " "				--yad_table 2
+     if options.legacy_yad then
+@@ -543,7 +547,7 @@
+     yad_command = yad_command .. [[ --button="Crop:1" --button="gtk-cancel:2" --button="gtk-ok:0"; ret=$? && echo $ret]]
+     
+     if gif_dialog then
+-        yad_command = [[echo $(LC_NUMERIC=C yad --title="Gif settings" --name "convert script" --class "Convert Script" \
++        yad_command = [[echo $(LC_NUMERIC=C ]] .. YAD_CMD .. [[ --title="Gif settings" --name "convert script" --class "Convert Script" \
+         --center --form --always-print-result --separator="…" \
+         --field="Fuzz Factor:NUM" '1!0..100!0.5!1' \
+         --field="Framestep:NUM" '3!1..3!1' \
diff --git a/nixpkgs/pkgs/applications/video/mpv/scripts/mpris.nix b/nixpkgs/pkgs/applications/video/mpv/scripts/mpris.nix
new file mode 100644
index 000000000000..f19db554d045
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/scripts/mpris.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchpatch, fetchFromGitHub, pkgconfig, glib, mpv }:
+
+stdenv.mkDerivation rec {
+  pname = "mpv-mpris";
+  version = "0.5";
+
+  src = fetchFromGitHub {
+    owner = "hoyon";
+    repo = "mpv-mpris";
+    rev = version;
+    sha256 = "07p6li5z38pkfd40029ag2jqx917vyl3ng5p2i4v5a0af14slcnk";
+  };
+  patches = [
+    # Enables to "make SCRIPTS_DIR=... install" https://github.com/hoyon/mpv-mpris/pull/38
+    (fetchpatch {
+      url = "https://github.com/hoyon/mpv-mpris/commit/f1482350868bf20e4575f923943ec998469b255e.patch";
+      sha256 = "1lqy867wpmj6hv3zgi6g679a7x3dv5skpw24hwd05b28galnyd4l";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ glib mpv ];
+
+  installFlags = [ "SCRIPTS_DIR=$(out)/share/mpv/scripts" ];
+
+  # Otherwise, the shared object isn't `strip`ped. See:
+  # https://discourse.nixos.org/t/debug-why-a-derivation-has-a-reference-to-gcc/7009
+  stripDebugList = [ "share/mpv/scripts" ];
+  passthru.scriptName = "mpris.so";
+
+  meta = with stdenv.lib; {
+    description = "MPRIS plugin for mpv";
+    homepage = "https://github.com/hoyon/mpv-mpris";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix b/nixpkgs/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
new file mode 100644
index 000000000000..d51434e241c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
@@ -0,0 +1,33 @@
+{ stdenv
+, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "simple-mpv-ui";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "open-dynaMIX";
+    repo = "simple-mpv-webui";
+    rev = "v${version}";
+    sha256 = "1glrnnl1slcl0ri0zs4j64lc9aa52p9ffh6av0d81fk95nm98917";
+  };
+
+  dontBuild = true;
+  installPhase = ''
+    mkdir -p $out/share/mpv/scripts
+    cp -r webui.lua webui-page $out/share/mpv/scripts/
+  '';
+  passthru.scriptName = "webui.lua";
+
+  meta = with stdenv.lib; {
+    description = "A web based user interface with controls for the mpv mediaplayer";
+    homepage = "https://github.com/open-dynaMIX/simple-mpv-webui";
+    maintainers = [ maintainers.cript0nauta ];
+    longDescription = ''
+      You can access the webui when accessing http://127.0.0.1:8080 or
+      http://[::1]:8080 in your webbrowser. By default it listens on
+      0.0.0.0:8080 and [::0]:8080
+    '';
+    license = licenses.mit;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/video/mpv/wrapper.nix b/nixpkgs/pkgs/applications/video/mpv/wrapper.nix
new file mode 100644
index 000000000000..5b3ad7a98311
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mpv/wrapper.nix
@@ -0,0 +1,83 @@
+# Arguments that this derivation gets when it is created with `callPackage`
+{ stdenv
+, lib
+, symlinkJoin
+, makeWrapper
+, youtube-dl
+}:
+
+# the unwrapped mpv derivation - 1st argument to `wrapMpv`
+mpv:
+
+let
+  # arguments to the function (called `wrapMpv` in all-packages.nix)
+  wrapper = {
+    extraMakeWrapperArgs ? [],
+    youtubeSupport ? true,
+    # a set of derivations (probably from `mpvScripts`) where each is
+    # expected to have a `scriptName` passthru attribute that points to the
+    # name of the script that would reside in the script's derivation's
+    # `$out/share/mpv/scripts/`.
+    scripts ? [],
+    extraUmpvWrapperArgs ? []
+  }:
+  let
+    binPath = lib.makeBinPath ([
+      mpv.luaEnv
+    ] ++ lib.optionals youtubeSupport [
+      youtube-dl
+    ] ++ lib.optionals mpv.vapoursynthSupport [
+      mpv.vapoursynth.python3
+    ]);
+    # All arguments besides the input and output binaries (${mpv}/bin/mpv and
+    # $out/bin/mpv). These are used by the darwin specific makeWrapper call
+    # used to wrap $out/Applications/mpv.app/Contents/MacOS/mpv as well.
+    mostMakeWrapperArgs = lib.strings.escapeShellArgs ([ "--argv0" "'$0'"
+      # These are always needed (TODO: Explain why)
+      "--prefix" "LUA_CPATH" ";" "${mpv.luaEnv}/lib/lua/${mpv.lua.luaversion}/?.so"
+      "--prefix" "LUA_PATH" ";" "${mpv.luaEnv}/share/lua/${mpv.lua.luaversion}/?.lua"
+    ] ++ lib.optionals mpv.vapoursynthSupport [
+      "--prefix" "PYTHONPATH" ":" "${mpv.vapoursynth}/lib/${mpv.vapoursynth.python3.sitePackages}"
+    ] ++ lib.optionals (binPath != "") [
+      "--prefix" "PATH" ":" binPath
+    ] ++ (lib.lists.flatten (map
+      # For every script in the `scripts` argument, add the necessary flags to the wrapper
+      (script:
+        [
+          "--add-flags"
+          # Here we rely on the existence of the `scriptName` passthru
+          # attribute of the script derivation from the `scripts`
+          "--script=${script}/share/mpv/scripts/${script.scriptName}"
+        ]
+      ) scripts
+    )) ++ extraMakeWrapperArgs)
+    ;
+    umpvWrapperArgs = lib.strings.escapeShellArgs ([
+      "--argv0" "'$0'"
+      "--set" "MPV" "${placeholder "out"}/bin/mpv"
+    ] ++ extraUmpvWrapperArgs)
+    ;
+  in
+    symlinkJoin {
+      name = "mpv-with-scripts-${mpv.version}";
+
+      paths = [ mpv ];
+
+      buildInputs = [ makeWrapper ];
+
+      passthru.unwrapped = mpv;
+
+      postBuild = ''
+        # wrapProgram can't operate on symlinks
+        rm "$out/bin/mpv"
+        makeWrapper "${mpv}/bin/mpv" "$out/bin/mpv" ${mostMakeWrapperArgs}
+        rm "$out/bin/umpv"
+        makeWrapper "${mpv}/bin/umpv" "$out/bin/umpv" ${umpvWrapperArgs}
+      '' + lib.optionalString stdenv.isDarwin ''
+        # wrapProgram can't operate on symlinks
+        rm "$out/Applications/mpv.app/Contents/MacOS/mpv"
+        makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs}
+      '';
+    };
+in
+  lib.makeOverridable wrapper
diff --git a/nixpkgs/pkgs/applications/video/mythtv/default.nix b/nixpkgs/pkgs/applications/video/mythtv/default.nix
new file mode 100644
index 000000000000..2f1d3a3a1c91
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mythtv/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, mkDerivation, fetchFromGitHub, which, qtbase, qtwebkit, qtscript, xlibsWrapper
+, libpulseaudio, fftwSinglePrec , lame, zlib, libGLU, libGL, alsaLib, freetype
+, perl, pkgconfig , libsamplerate, libbluray, lzo, libX11, libXv, libXrandr, libXvMC, libXinerama, libXxf86vm
+, libXmu , yasm, libuuid, taglib, libtool, autoconf, automake, file, exiv2, linuxHeaders
+, libXNVCtrl, enableXnvctrl ? false
+}:
+
+mkDerivation rec {
+  pname = "mythtv";
+  version = "30.0";
+
+  src = fetchFromGitHub {
+    owner = "MythTV";
+    repo = "mythtv";
+    rev = "v${version}";
+    sha256 = "1pfzjb07xwd3mfgmbr4kkiyfyvwy9fkl13ik7bvqds86m0ws5bw4";
+  };
+
+  patches = [
+    # Fixes build with exiv2 0.27.1.
+    ./exiv2.patch
+    # Disables OS detection used while checking for xnvctrl support.
+    ./disable-os-detection.patch
+  ];
+
+  setSourceRoot = ''sourceRoot=$(echo */mythtv)'';
+
+  buildInputs = [
+    freetype qtbase qtwebkit qtscript lame zlib xlibsWrapper libGLU libGL
+    perl libsamplerate libbluray lzo alsaLib libpulseaudio fftwSinglePrec libX11 libXv libXrandr libXvMC
+    libXmu libXinerama libXxf86vm libXmu libuuid taglib exiv2
+  ] ++ stdenv.lib.optional enableXnvctrl libXNVCtrl;
+  nativeBuildInputs = [ pkgconfig which yasm libtool autoconf automake file ];
+
+  configureFlags = 
+    [ "--dvb-path=${linuxHeaders}/include" ]
+    ++ stdenv.lib.optionals (!enableXnvctrl) [  "--disable-xnvctrl" ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://www.mythtv.org/";
+    description = "Open Source DVR";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/mythtv/disable-os-detection.patch b/nixpkgs/pkgs/applications/video/mythtv/disable-os-detection.patch
new file mode 100644
index 000000000000..5a35dc2d1ddf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mythtv/disable-os-detection.patch
@@ -0,0 +1,51 @@
+--- a/configure	1970-01-01 01:00:01.000000000 +0100
++++ b/configure	2019-10-26 11:54:01.920776490 +0200
+@@ -6642,29 +6642,29 @@
+     require libXinerama X11/extensions/Xinerama.h XineramaQueryExtension -lXinerama
+     require libXext "X11/Xdefs.h X11/Xlib.h X11/extensions/Xext.h" XMissingExtension -lXext
+     if enabled xnvctrl; then
+-        case $target_os in
+-            linux)
++#        case $target_os in
++#            linux)
+                 # Bah. Suse linux doesn't have xnvctrl.
+-                . /etc/os-release
+-                case $ID in
+-                    *suse*)
++#                . /etc/os-release
++#                case $ID in
++#                    *suse*)
+ 			# This is hopefully temporary.
+-			disable xnvctrl_external
+-			;;
+-		    *)
+-                        require XNVctrl "X11/Xlib.h NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h" XNVCTRLIsNvScreen -lXNVCtrl || disable xnvctrl
+-                        ;;
+-                esac
+-                ;;
+-            freebsd)
++#			disable xnvctrl_external
++#			;;
++#		    *)
++        require XNVctrl "X11/Xlib.h NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h" XNVCTRLIsNvScreen -lXNVCtrl || disable xnvctrl
++#                        ;;
++#                esac
++#                ;;
++#            freebsd)
+                 # This is hopefully temporary, and will eventually
+                 # check for a system library too.
+-                disable xnvctrl_external
+-                ;;
+-            *)
+-                disable xnvctrl
+-                ;;
+-        esac
++#                disable xnvctrl_external
++#                ;;
++#            *)
++#                disable xnvctrl
++#                ;;
++#        esac
+     fi
+ fi
+ 
diff --git a/nixpkgs/pkgs/applications/video/mythtv/exiv2.patch b/nixpkgs/pkgs/applications/video/mythtv/exiv2.patch
new file mode 100644
index 000000000000..29bf1f5967bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/mythtv/exiv2.patch
@@ -0,0 +1,19 @@
+Patch source: https://aur.archlinux.org/cgit/aur.git/plain/004-exiv2.patch?h=mythtv&id=76ea37f8556805b205878772ad7874e487c0d946
+--- a/libs/libmythmetadata/imagemetadata.cpp
++++ b/libs/libmythmetadata/imagemetadata.cpp
+@@ -7,14 +7,7 @@
+ #include "exitcodes.h"        // for ffprobe
+ 
+ // libexiv2 for Exif metadata
+-//#include <exiv2/exiv2.hpp>
+-// Note: Older versions of Exiv2 don't have the exiv2.hpp include
+-// file.  Using image.hpp instead seems to work.
+-#ifdef _MSC_VER
+-#include <exiv2/src/image.hpp>
+-#else
+-#include <exiv2/image.hpp>
+-#endif
++#include <exiv2/exiv2.hpp>
+ 
+ // To read FFMPEG Metadata
+ extern "C" {
diff --git a/nixpkgs/pkgs/applications/video/natron/config.pri b/nixpkgs/pkgs/applications/video/natron/config.pri
new file mode 100644
index 000000000000..c0d236c6b975
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/natron/config.pri
@@ -0,0 +1,20 @@
+boost: LIBS += -lboost_serialization
+expat: LIBS += -lexpat
+expat: PKGCONFIG -= expat
+cairo {
+        PKGCONFIG += cairo
+        LIBS -=  $$system(pkg-config --variable=libdir cairo)/libcairo.a
+}
+pyside {
+        PKGCONFIG -= pyside
+        INCLUDEPATH += $$system(pkg-config --variable=includedir pyside)
+        INCLUDEPATH += $$system(pkg-config --variable=includedir pyside)/QtCore
+        INCLUDEPATH += $$system(pkg-config --variable=includedir pyside)/QtGui
+        INCLUDEPATH += $$system(pkg-config --variable=includedir QtGui)
+        LIBS += -lpyside-python2.7
+}
+shiboken {
+        PKGCONFIG -= shiboken
+        INCLUDEPATH += $$system(pkg-config --variable=includedir shiboken)
+        LIBS += -lshiboken-python2.7
+}
diff --git a/nixpkgs/pkgs/applications/video/natron/default.nix b/nixpkgs/pkgs/applications/video/natron/default.nix
new file mode 100644
index 000000000000..dede7d6b29e0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/natron/default.nix
@@ -0,0 +1,129 @@
+{ lib, stdenv, fetchurl, qt4, pkgconfig, boost, expat, cairo, python2Packages,
+  cmake, flex, bison, pango, librsvg, librevenge, libxml2, libcdr, libzip,
+  poppler, imagemagick, openexr, ffmpeg_3, opencolorio, openimageio,
+  qmake4Hook, libpng, libGL, lndir }:
+
+let
+  minorVersion = "2.1";
+  version = "${minorVersion}.9";
+  OpenColorIO-Configs = fetchurl {
+    url = "https://github.com/MrKepzie/OpenColorIO-Configs/archive/Natron-v${minorVersion}.tar.gz";
+    sha256 = "9eec5a02ca80c9cd8e751013cb347ea982fdddd592a4a9215cce462e332dac51";
+  };
+  seexpr = stdenv.mkDerivation rec {
+    version = "1.0.1";
+    pname = "seexpr";
+    src = fetchurl {
+      url = "https://github.com/wdas/SeExpr/archive/rel-${version}.tar.gz";
+      sha256 = "1ackh0xs4ip7mk34bam8zd4qdymkdk0dgv8x0f2mf6gbyzzyh7lp";
+    };
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ libpng flex bison ];
+  };
+  buildPlugin = { pluginName, sha256, nativeBuildInputs ? [], buildInputs ? [], preConfigure ? "" }:
+    stdenv.mkDerivation {
+      name = "openfx-${pluginName}-${version}";
+      src = fetchurl {
+        url = "https://github.com/MrKepzie/Natron/releases/download/${version}/openfx-${pluginName}-${version}.tar.xz";
+        inherit sha256;
+      };
+      inherit nativeBuildInputs buildInputs;
+      preConfigure = ''
+        makeFlagsArray+=("CONFIG=release")
+        makeFlagsArray+=("PLUGINPATH=$out/Plugins/OFX/Natron")
+        ${preConfigure}
+      '';
+    };
+  lodepngcpp = fetchurl {
+    url = "https://raw.githubusercontent.com/lvandeve/lodepng/a70c086077c0eaecbae3845e4da4424de5f43361/lodepng.cpp";
+    sha256 = "1dxkkr4jbmvlwfr7m16i1mgcj1pqxg9s1a7y3aavs9rrk0ki8ys2";
+  };
+  lodepngh = fetchurl {
+    url = "https://raw.githubusercontent.com/lvandeve/lodepng/a70c086077c0eaecbae3845e4da4424de5f43361/lodepng.h";
+    sha256 = "14drdikd0vws3wwpyqq7zzm5z3kg98svv4q4w0hr45q6zh6hs0bq";
+  };
+  CImgh = fetchurl {
+    url = "https://raw.githubusercontent.com/dtschump/CImg/572c12d82b2f59ece21be8f52645c38f1dd407e6/CImg.h";
+    sha256 = "0n4qfxj8j6rmj4svf68gg2pzg8d1pb74bnphidnf8i2paj6lwniz";
+  };
+  plugins = map buildPlugin [
+    ({
+      pluginName = "arena";
+      sha256 = "0qba13vn9qdfax7nqlz1ps27zspr5kh795jp1xvbmwjzjzjpkqkf";
+      nativeBuildInputs = [ pkgconfig ];
+      buildInputs = [
+        pango librsvg librevenge libcdr opencolorio libxml2 libzip
+        poppler imagemagick
+      ];
+      preConfigure = ''
+        sed -i 's|pkg-config poppler-glib|pkg-config poppler poppler-glib|g' Makefile.master
+        for i in Extra Bundle; do
+          cp ${lodepngcpp} $i/lodepng.cpp
+          cp ${lodepngh} $i/lodepng.h
+        done
+      '';
+    })
+    ({
+      pluginName = "io";
+      sha256 = "0s196i9fkgr9iw92c94mxgs1lkxbhynkf83vmsgrldflmf0xjky7";
+      nativeBuildInputs = [ pkgconfig ];
+      buildInputs = [
+        libpng ffmpeg_3 openexr opencolorio openimageio boost libGL
+        seexpr
+      ];
+    })
+    ({
+      pluginName = "misc";
+      sha256 = "02h79jrll0c17azxj16as1mks3lmypm4m3da4mms9sg31l3n82qi";
+      buildInputs = [
+        libGL
+      ];
+      preConfigure = ''
+        cp ${CImgh} CImg/CImg.h
+      '';
+    })
+  ];
+in
+stdenv.mkDerivation {
+  inherit version;
+  name = "natron-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/MrKepzie/Natron/releases/download/${version}/Natron-${version}.tar.xz";
+    sha256 = "1wdc0zqriw2jhlrhzs6af3kagrv22cm086ffnbr1x43mgc9hfhjp";
+  };
+
+  nativeBuildInputs = [ qmake4Hook pkgconfig python2Packages.wrapPython ];
+
+  buildInputs = [
+    qt4 boost expat cairo python2Packages.pyside python2Packages.pysideShiboken
+  ];
+
+  preConfigure = ''
+    export MAKEFLAGS=-j$NIX_BUILD_CORES
+    cp ${./config.pri} config.pri
+    mkdir OpenColorIO-Configs
+    tar -xf ${OpenColorIO-Configs} --strip-components=1 -C OpenColorIO-Configs
+  '';
+
+  postFixup = ''
+    for i in ${lib.escapeShellArgs plugins}; do
+      ${lndir}/bin/lndir $i $out
+    done
+    wrapProgram $out/bin/Natron \
+      --set PYTHONPATH "$PYTHONPATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Node-graph based, open-source compositing software";
+    longDescription = ''
+      Node-graph based, open-source compositing software. Similar in
+      functionalities to Adobe After Effects and Nuke by The Foundry.
+    '';
+    homepage = "https://natron.fr/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ maintainers.puffnfresh ];
+    platforms = platforms.linux;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/default.nix b/nixpkgs/pkgs/applications/video/obs-studio/default.nix
new file mode 100644
index 000000000000..8a2cd1728227
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/default.nix
@@ -0,0 +1,107 @@
+{ config, stdenv
+, mkDerivation
+, fetchFromGitHub
+, addOpenGLRunpath
+, cmake
+, fdk_aac
+, ffmpeg
+, jansson
+, libjack2
+, libxkbcommon
+, libpthreadstubs
+, libXdmcp
+, qtbase
+, qtx11extras
+, qtsvg
+, speex
+, libv4l
+, x264
+, curl
+, xorg
+, makeWrapper
+, pkgconfig
+, vlc
+, mbedtls
+
+, scriptingSupport ? true
+, luajit
+, swig
+, python3
+
+, alsaSupport ? stdenv.isLinux
+, alsaLib
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
+, libpulseaudio
+}:
+
+let
+  inherit (stdenv.lib) optional optionals;
+
+in mkDerivation rec {
+  pname = "obs-studio";
+  version = "25.0.8";
+
+  src = fetchFromGitHub {
+    owner = "obsproject";
+    repo = "obs-studio";
+    rev = version;
+    sha256 = "0j2k65q3wfyfxhvkl6icz4qy0s3kfqhksizy2i3ah7yml266axbj";
+  };
+
+  nativeBuildInputs = [ addOpenGLRunpath cmake pkgconfig ];
+
+  buildInputs = [
+    curl
+    fdk_aac
+    ffmpeg
+    jansson
+    libjack2
+    libv4l
+    libxkbcommon
+    libpthreadstubs
+    libXdmcp
+    qtbase
+    qtx11extras
+    qtsvg
+    speex
+    x264
+    vlc
+    makeWrapper
+    mbedtls
+  ]
+  ++ optionals scriptingSupport [ luajit swig python3 ]
+  ++ optional alsaSupport alsaLib
+  ++ optional pulseaudioSupport libpulseaudio;
+
+  # obs attempts to dlopen libobs-opengl, it fails unless we make sure
+  # DL_OPENGL is an explicit path. Not sure if there's a better way
+  # to handle this.
+  cmakeFlags = [
+    "-DCMAKE_CXX_FLAGS=-DDL_OPENGL=\\\"$(out)/lib/libobs-opengl.so\\\""
+    "-DOBS_VERSION_OVERRIDE=${version}"
+    "-Wno-dev" # kill dev warnings that are useless for packaging
+  ];
+
+  postInstall = ''
+      wrapProgram $out/bin/obs \
+        --prefix "LD_LIBRARY_PATH" : "${xorg.libX11.out}/lib:${vlc}/lib"
+  '';
+
+  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+      addOpenGLRunpath $out/lib/lib*.so
+      addOpenGLRunpath $out/lib/obs-plugins/*.so
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Free and open source software for video recording and live streaming";
+    longDescription = ''
+      This project is a rewrite of what was formerly known as "Open Broadcaster
+      Software", software originally designed for recording and streaming live
+      video content, efficiently
+    '';
+    homepage = "https://obsproject.com";
+    maintainers = with maintainers; [ jb55 MP2E ];
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/fix-search-path.patch b/nixpkgs/pkgs/applications/video/obs-studio/fix-search-path.patch
new file mode 100644
index 000000000000..4503447ff5dc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/fix-search-path.patch
@@ -0,0 +1,13 @@
+diff --git a/external/FindLibObs.cmake b/external/FindLibObs.cmake
+index ab0a3de..19c63ee 100644
+--- a/external/FindLibObs.cmake
++++ b/external/FindLibObs.cmake
+@@ -95,7 +95,7 @@ if(LIBOBS_FOUND)
+ 
+ 	set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIR} ${W32_PTHREADS_INCLUDE_DIR})
+ 	set(LIBOBS_LIBRARIES ${LIBOBS_LIB} ${W32_PTHREADS_LIB})
+-	include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
++	include(external/ObsPluginHelpers.cmake)
+ 
+ 	# allows external plugins to easily use/share common dependencies that are often included with libobs (such as FFmpeg)
+ 	if(NOT DEFINED INCLUDED_LIBOBS_CMAKE_MODULES)
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/hardcode-ndi-path.patch b/nixpkgs/pkgs/applications/video/obs-studio/hardcode-ndi-path.patch
new file mode 100644
index 000000000000..caef96c381f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/hardcode-ndi-path.patch
@@ -0,0 +1,17 @@
+diff --git a/src/obs-ndi.cpp b/src/obs-ndi.cpp
+index 493831c..7b0f8db 100644
+--- a/src/obs-ndi.cpp
++++ b/src/obs-ndi.cpp
+@@ -197,11 +197,7 @@ const char* obs_module_description()
+ const NDIlib_v4* load_ndilib()
+ {
+ 	QStringList locations;
+-	locations << QString(qgetenv(NDILIB_REDIST_FOLDER));
+-#if defined(__linux__) || defined(__APPLE__)
+-	locations << "/usr/lib";
+-	locations << "/usr/local/lib";
+-#endif
++	locations << "@NDI@/lib";
+ 
+ 	for (QString path : locations) {
+ 		blog(LOG_INFO, "Trying '%s'", path.toUtf8().constData());
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/linuxbrowser.nix b/nixpkgs/pkgs/applications/video/obs-studio/linuxbrowser.nix
new file mode 100644
index 000000000000..a33383937fb8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/linuxbrowser.nix
@@ -0,0 +1,49 @@
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f . -iA obs-linuxbrowser
+# mkdir -p ~/.config/obs-studio/plugins
+# ln -s ~/.nix-profile/share/obs/obs-plugins/obs-linuxbrowser ~/.config/obs-studio/plugins/
+
+{ stdenv, fetchFromGitHub, obs-studio, cmake, libcef }:
+
+stdenv.mkDerivation rec {
+  pname = "obs-linuxbrowser";
+  version = "0.6.1-6-gf86dba6";
+
+  src = fetchFromGitHub {
+    owner = "bazukas";
+    repo = "obs-linuxbrowser";
+    rev = version;
+    sha256 = "08d7qz0721va88bcyia8p0ycw50f6x3yk97s3vzhsc9xpq691kpi";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ obs-studio ];
+  postUnpack = ''
+    mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/
+    for i in ${libcef}/share/cef/*; do
+      ln -s $i cef/Release/
+      ln -s $i cef/Resources/
+    done
+    ln -s ${libcef}/lib/libcef.so cef/Release/
+    ln -s ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/
+    ln -s ${libcef}/include cef/
+  '';
+  cmakeFlags = [
+    "-DCEF_ROOT_DIR=../../cef"
+    "-DOBS_INCLUDE_SEARCH_DIR=${obs-studio}/include/obs"
+  ];
+  installPhase = ''
+    mkdir -p $out/share/obs/obs-plugins
+    cp -r build/obs-linuxbrowser $out/share/obs/obs-plugins/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Browser source plugin for obs-studio based on Chromium Embedded Framework";
+    homepage = "https://github.com/bazukas/obs-linuxbrowser";
+    maintainers = with maintainers; [ puffnfresh ];
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/obs-ndi.nix b/nixpkgs/pkgs/applications/video/obs-studio/obs-ndi.nix
new file mode 100644
index 000000000000..79f38fa8fe40
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/obs-ndi.nix
@@ -0,0 +1,41 @@
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f "<nixpkgs>" -iA obs-ndi
+# mkdir -p ~/.config/obs-studio/plugins/bin
+# ln -s ~/.nix-profile/lib/obs-plugins/obs-ndi.so ~/.config/obs-studio/plugins/bin/
+
+{ stdenv, fetchFromGitHub, obs-studio, cmake, qt5, ndi }:
+
+stdenv.mkDerivation rec {
+  pname = "obs-ndi";
+  version = "4.7.1";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ obs-studio qt5.qtbase ndi ];
+
+  src = fetchFromGitHub {
+    owner = "Palakis";
+    repo = "obs-ndi";
+    rev = version;
+    sha256 = "040fkbf3f3qgqcrd3072y3zrjb4fwga8zr10jym744xd7bgyylqh";
+  };
+
+  patches = [ ./fix-search-path.patch ./hardcode-ndi-path.patch ];
+
+  postPatch = "sed -i -e s,@NDI@,${ndi},g src/obs-ndi.cpp";
+
+  cmakeFlags = [
+    "-DLIBOBS_INCLUDE_DIR=${obs-studio}/include/obs"
+    "-DLIBOBS_LIB=${obs-studio}/lib"
+    "-DCMAKE_CXX_FLAGS=-I${obs-studio.src}/UI/obs-frontend-api"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Network A/V plugin for OBS Studio";
+    homepage = "https://github.com/Palakis/obs-ndi";
+    maintainers = with maintainers; [ peti ];
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/v4l2sink.nix b/nixpkgs/pkgs/applications/video/obs-studio/v4l2sink.nix
new file mode 100644
index 000000000000..97eae68b6e72
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/v4l2sink.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, qtbase
+, obs-studio
+}:
+
+stdenv.mkDerivation rec {
+  pname = "obs-v4l2sink";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "CatxFish";
+    repo = "obs-v4l2sink";
+    rev = version;
+    sha256 = "0l4lavaywih5lzwgxcbnvdrxhpvkrmh56li06s3aryikngxwsk3z";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qtbase obs-studio ];
+
+  patches = [
+    # Fixes the segfault when stopping the plugin
+    (fetchpatch {
+      url = "https://github.com/CatxFish/obs-v4l2sink/commit/6604f01796d1b84a95714730ea51a6b8ac0e450b.diff";
+      sha256 = "0crcvw02dj0aqy7hnhizjdsnhiw03zmg6cbdkasxz2mrrbyc3s88";
+    })
+  ];
+
+  cmakeFlags = with lib; [
+    "-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs"
+  ];
+
+  # obs-studio expects the shared object to be located in bin/32bit or bin/64bit
+  # https://github.com/obsproject/obs-studio/blob/d60c736cb0ec0491013293c8a483d3a6573165cb/libobs/obs-nix.c#L48
+  postInstall = let
+    pluginPath = {
+      i686-linux = "bin/32bit";
+      x86_64-linux = "bin/64bit";
+    }.${stdenv.targetPlatform.system} or (throw "Unsupported system: ${stdenv.targetPlatform.system}");
+  in ''
+    mkdir -p $out/share/obs/obs-plugins/v4l2sink/${pluginPath}
+    ln -s $out/lib/obs-plugins/v4l2sink.so $out/share/obs/obs-plugins/v4l2sink/${pluginPath}
+  '';
+
+  meta = with lib; {
+    description = "obs studio output plugin for Video4Linux2 device";
+    homepage = "https://github.com/CatxFish/obs-v4l2sink";
+    maintainers = with maintainers; [ colemickens peelz ];
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix b/nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix
new file mode 100644
index 000000000000..77ef09d3c24d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix
@@ -0,0 +1,42 @@
+# (the following is somewhat lifted from ./linuxbrowser.nix)
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f . -iA obs-wlrobs
+# mkdir -p ~/.config/obs-studio/plugins/wlrobs/bin/64bit
+# ln -s ~/.nix-profile/share/obs/obs-plugins/wlrobs/bin/64bit/libwlrobs.so ~/.config/obs-studio/plugins/wlrobs/bin/64bit
+{ stdenv, fetchhg, wayland, obs-studio
+, meson, ninja, pkgconfig, libX11
+, dmabufSupport ? false, libdrm ? null, libGL ? null}:
+
+assert dmabufSupport -> libdrm != null && libGL != null;
+
+stdenv.mkDerivation {
+  pname = "obs-wlrobs";
+  version = "20200111";
+
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/wlrobs";
+    rev = "8345bf985e390896d89e35e2feae1fa37722f4be";
+    sha256 = "0j01wkhwhhla4qx8mwyrq2qj9cfhxksxaq2k8rskmy2qbdkvvdpb";
+  };
+
+  buildInputs = [ libX11 libGL libdrm meson ninja pkgconfig wayland obs-studio ];
+
+  installPhase = ''
+    mkdir -p $out/share/obs/obs-plugins/wlrobs/bin/64bit
+    cp ./libwlrobs.so $out/share/obs/obs-plugins/wlrobs/bin/64bit/
+  '';
+
+  mesonFlags = [
+    "-Duse_dmabuf=${if dmabufSupport then "true" else "false"}"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "An obs-studio plugin that allows you to screen capture on wlroots based wayland compositors";
+    homepage = "https://hg.sr.ht/~scoopta/wlrobs";
+    maintainers = with maintainers; [ grahamc ];
+    license = licenses.gpl3;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/ogmtools/default.nix b/nixpkgs/pkgs/applications/video/ogmtools/default.nix
new file mode 100644
index 000000000000..c9c5190dc539
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/ogmtools/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, libogg, libvorbis, libdvdread }:
+
+stdenv.mkDerivation rec {
+  name = "ogmtools-1.5";
+
+  src = fetchurl {
+    url = "https://www.bunkus.org/videotools/ogmtools/${name}.tar.bz2";
+    sha256 = "1spx81p5wf59ksl3r3gvf78d77sh7gj8a6lw773iv67bphfivmn8";
+  };
+
+  buildInputs = [libogg libvorbis libdvdread];
+
+  meta = {
+    description = "Tools for modifying and inspecting OGG media streams";
+    longDescription = ''
+      These tools allow information about (ogminfo) or extraction from
+      (ogmdemux) or creation of (ogmmerge) OGG media streams. Includes dvdxchap
+      tool for extracting chapter information from DVD.
+    '';
+    homepage = "https://www.bunkus.org/videotools/ogmtools/";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/olive-editor/default.nix b/nixpkgs/pkgs/applications/video/olive-editor/default.nix
new file mode 100644
index 000000000000..b1e70cd037c7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/olive-editor/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, pkgconfig, which, qmake, mkDerivation,
+  qtmultimedia, wrapQtAppsHook, frei0r, opencolorio, ffmpeg-full,
+  CoreFoundation }:
+
+mkDerivation rec {
+  pname = "olive-editor";
+  version = "0.1.2";
+
+  src = fetchFromGitHub {
+    owner = "olive-editor";
+    repo = "olive";
+    rev = version;
+    sha256 = "151g6jwhipgbq4llwib92sq23p1s9hm6avr7j4qq3bvykzrm8z1a";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    which
+    qmake
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    ffmpeg-full
+    frei0r
+    opencolorio
+    qtmultimedia
+  ] ++ stdenv.lib.optional stdenv.isDarwin CoreFoundation;
+
+  meta = with stdenv.lib; {
+    description = "Professional open-source NLE video editor";
+    homepage = "https://www.olivevideoeditor.org/";
+    downloadPage = "https://www.olivevideoeditor.org/download.php";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.balsoft ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/omxplayer/default.nix b/nixpkgs/pkgs/applications/video/omxplayer/default.nix
new file mode 100644
index 000000000000..28df8ead0c80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/omxplayer/default.nix
@@ -0,0 +1,86 @@
+{ stdenv, fetchurl
+, raspberrypifw, pcre, boost, freetype, zlib
+}:
+
+let
+  ffmpeg = stdenv.mkDerivation rec {
+    name = "ffmpeg-1.1.3";
+    
+    src = fetchurl {
+      url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
+      sha256 = "03s1zsprz5p6gjgwwqcf7b6cvzwwid6l8k7bamx9i0f1iwkgdm0j";
+    };
+    
+    configurePlatforms = [];
+    configureFlags = [
+      "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
+    ] ++ stdenv.lib.optionals stdenv.hostPlatform.isAarch32 [
+      # TODO be better with condition
+      "--cpu=arm1176jzf-s"
+    ] ++ [
+      "--disable-muxers"
+      "--enable-muxer=spdif"
+      "--enable-muxer=adts"
+      "--disable-encoders"
+      "--enable-encoder=ac3"
+      "--enable-encoder=aac"
+      "--disable-decoder=mpeg_xvmc"
+      "--disable-devices"
+      "--disable-ffprobe"
+      "--disable-ffplay"
+      "--disable-ffserver"
+      "--disable-ffmpeg"
+      "--enable-shared"
+      "--disable-doc"
+      "--enable-postproc"
+      "--enable-gpl"
+      "--enable-protocol=http"
+      "--enable-pthreads"
+      "--disable-runtime-cpudetect"
+      "--enable-pic"
+      "--disable-armv5te"
+      "--disable-neon"
+      "--enable-armv6t2"
+      "--enable-armv6"
+      "--enable-hardcoded-tables"
+      "--disable-runtime-cpudetect"
+      "--disable-debug"
+      "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
+      "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
+    ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      "--cross-prefix=${stdenv.cc.targetPrefix}"
+      "--enable-cross-compile"
+    ];
+
+    enableParallelBuilding = true;
+
+    meta = {
+      homepage = "http://www.ffmpeg.org/";
+      description = "A complete, cross-platform solution to record, convert and stream audio and video";
+    };
+  };
+in
+stdenv.mkDerivation rec {
+  name = "omxplayer-20130328-fbee325dc2";
+  src = fetchurl {
+    url = "https://github.com/huceke/omxplayer/tarball/fbee325dc2";
+    name = "${name}.tar.gz";
+    sha256 = "0fkvv8il7ffqxki2gp8cxa5shh6sz9jsy5vv3f4025g4gss6afkg";
+  };
+  patchPhase = ''
+    sed -i 1d Makefile
+    export INCLUDES="-I${raspberrypifw}/include/interface/vcos/pthreads -I${raspberrypifw}/include/interface/vmcs_host/linux/"
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    cp omxplayer.bin $out/bin
+  '';
+  buildInputs = [ raspberrypifw ffmpeg pcre boost freetype zlib ];
+
+  meta = {
+    homepage = "https://github.com/huceke/omxplayer";
+    description = "Commandline OMX player for the Raspberry Pi";
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.arm;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/openshot-qt/default.nix b/nixpkgs/pkgs/applications/video/openshot-qt/default.nix
new file mode 100644
index 000000000000..cd3176249f8a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/openshot-qt/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, mkDerivationWith, fetchFromGitHub, fetchpatch
+, doxygen, python3Packages, libopenshot
+, wrapGAppsHook, gtk3 }:
+
+mkDerivationWith python3Packages.buildPythonApplication rec {
+  pname = "openshot-qt";
+  version = "2.5.1";
+
+  src = fetchFromGitHub {
+    owner = "OpenShot";
+    repo = "openshot-qt";
+    rev = "v${version}";
+    sha256 = "0qc5i0ay6j2wab1whl41sjb71cj02pg6y79drf7asrprq8b2rmfq";
+  };
+
+  nativeBuildInputs = [ doxygen wrapGAppsHook ];
+
+  buildInputs = [ gtk3 ];
+
+  propagatedBuildInputs = with python3Packages; [ libopenshot pyqt5_with_qtwebkit requests sip httplib2 pyzmq ];
+
+  dontWrapGApps = true;
+  dontWrapQtApps = true;
+
+  preConfigure = ''
+    # tries to create caching directories during install
+    export HOME=$(mktemp -d)
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/openshot-qt \
+      "''${gappsWrapperArgs[@]}" \
+      "''${qtWrapperArgs[@]}"
+  '';
+
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = "http://openshot.org/";
+    description = "Free, open-source video editor";
+    longDescription = ''
+      OpenShot Video Editor is a free, open-source video editor for Linux.
+      OpenShot can take your videos, photos, and music files and help you
+      create the film you have always dreamed of. Easily add sub-titles,
+      transitions, and effects, and then export your film to DVD, YouTube,
+      Vimeo, Xbox 360, and many other common formats.
+    '';
+    license = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot-audio.nix b/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot-audio.nix
new file mode 100644
index 000000000000..d1a368b43ba2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot-audio.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, pkgconfig, cmake, doxygen, alsaLib , libX11, libXft, libXrandr, libXinerama, libXext, libXcursor }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  pname = "libopenshot-audio";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenShot";
+    repo = "libopenshot-audio";
+    rev = "v${version}";
+    sha256 = "13if0m5mvlqly8gmbhschzb9papkgp3yqivklhb949dhy16m8zgf";
+  };
+
+  nativeBuildInputs =
+  [ pkgconfig cmake doxygen ];
+
+  buildInputs =
+  [ alsaLib libX11 libXft libXrandr libXinerama libXext libXcursor ];
+
+  doCheck = false;
+
+  meta = {
+    homepage = "http://openshot.org/";
+    description = "High-quality sound editing library";
+    longDescription = ''
+      OpenShot Audio Library (libopenshot-audio) is a program that allows the
+      high-quality editing and playback of audio, and is based on the amazing
+      JUCE library.
+    '';
+    license = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot.nix b/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot.nix
new file mode 100644
index 000000000000..e24b6ee41f85
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/openshot-qt/libopenshot.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub
+, pkgconfig, cmake, doxygen
+, libopenshot-audio, imagemagick, ffmpeg_3
+, swig, python3
+, unittest-cpp, cppzmq, zeromq
+, qtbase, qtmultimedia }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  pname = "libopenshot";
+  version = "0.2.5";
+
+  src = fetchFromGitHub {
+    owner = "OpenShot";
+    repo = "libopenshot";
+    rev = "v${version}";
+    sha256 = "1mxjkgjmjzgf628y3rscc6rqf55hxgjpmvwxlncfk1216i5xskwp";
+  };
+
+  patchPhase = ''
+    sed -i 's/{UNITTEST++_INCLUDE_DIR}/ENV{UNITTEST++_INCLUDE_DIR}/g' tests/CMakeLists.txt
+    sed -i 's/{_REL_PYTHON_MODULE_PATH}/ENV{_REL_PYTHON_MODULE_PATH}/g' src/bindings/python/CMakeLists.txt
+    export _REL_PYTHON_MODULE_PATH=$(toPythonPath $out)
+  '';
+
+  nativeBuildInputs = [ pkgconfig cmake doxygen ];
+
+  buildInputs =
+  [ imagemagick ffmpeg_3 swig python3 unittest-cpp
+    cppzmq zeromq qtbase qtmultimedia ];
+
+  LIBOPENSHOT_AUDIO_DIR = libopenshot-audio;
+  "UNITTEST++_INCLUDE_DIR" = "${unittest-cpp}/include/UnitTest++";
+
+  doCheck = false;
+
+  cmakeFlags = [ "-DENABLE_RUBY=OFF" ];
+
+  meta = {
+    homepage = "http://openshot.org/";
+    description = "Free, open-source video editor library";
+    longDescription = ''
+      OpenShot Library (libopenshot) is an open-source project dedicated to
+      delivering high quality video editing, animation, and playback solutions
+      to the world. API currently supports C++, Python, and Ruby.
+    '';
+    license = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/p2pvc/default.nix b/nixpkgs/pkgs/applications/video/p2pvc/default.nix
new file mode 100644
index 000000000000..91468ea1ee60
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/p2pvc/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, pkgconfig, fetchFromGitHub, opencv2, ncurses, portaudio }:
+
+stdenv.mkDerivation {
+  name = "p2pvc";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ opencv2 ncurses portaudio ];
+
+  enableParallelBuilding = true;
+
+  installPhase = "mkdir -p $out/bin; cp p2pvc $out/bin/";
+
+  src = fetchFromGitHub {
+    owner = "mofarrell";
+    repo = "p2pvc";
+    rev = "d7b1c70288a7750fc8f9a22dbddbe51d34b5b9e5";
+    sha256 = "0d4vvrsjad5gk4rrjwgydn9ffj12jfb4aksw2px6jw75hp9pzmka";
+  };
+
+  meta = {
+    description = "A point to point color terminal video chat";
+    homepage = "https://github.com/mofarrell/p2pvc";
+    license = stdenv.lib.licenses.mit;
+    maintainers = with stdenv.lib.maintainers; [ trino ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/peek/default.nix b/nixpkgs/pkgs/applications/video/peek/default.nix
new file mode 100644
index 000000000000..24c44c248f58
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/peek/default.nix
@@ -0,0 +1,78 @@
+{ stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, gettext
+, desktop-file-utils
+, appstream-glib
+, pkgconfig
+, txt2man
+, gzip
+, vala
+, wrapGAppsHook
+, gsettings-desktop-schemas
+, gtk3
+, glib
+, cairo
+, keybinder3
+, ffmpeg_3
+, python3
+, libxml2
+, gst_all_1
+, which
+, gifski
+}:
+
+stdenv.mkDerivation rec {
+  pname = "peek";
+  version = "1.5.1";
+
+  src = fetchFromGitHub {
+    owner = "phw";
+    repo = "peek";
+    rev = version;
+    sha256 = "1xwlfizga6hvjqq127py8vabaphsny928ar7mwqj9cyqfl6fx41x";
+  };
+
+  nativeBuildInputs = [
+    appstream-glib
+    desktop-file-utils
+    gettext
+    gzip
+    meson
+    ninja
+    libxml2
+    pkgconfig
+    txt2man
+    python3
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    cairo
+    glib
+    gsettings-desktop-schemas
+    gtk3
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-plugins-ugly
+    keybinder3
+  ];
+
+  postPatch = ''
+    patchShebangs build-aux/meson/postinstall.py data/man/build_man.sh
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix PATH : ${stdenv.lib.makeBinPath [ which ffmpeg_3 gifski ]})
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/phw/peek";
+    description = "Simple animated GIF screen recorder with an easy to use interface";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ puffnfresh worldofpeace ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/pitivi/default.nix b/nixpkgs/pkgs/applications/video/pitivi/default.nix
new file mode 100644
index 000000000000..276c2fa787f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/pitivi/default.nix
@@ -0,0 +1,81 @@
+{ stdenv, fetchFromGitHub, fetchurl, pkgconfig, intltool, itstool, python3, wrapGAppsHook
+, python3Packages, gst_all_1, gtk3
+, gobject-introspection, librsvg, gnome3, libnotify, gsound
+, meson, ninja, gsettings-desktop-schemas
+}:
+
+let
+  version = "0.999";
+
+  # gst-transcoder will eventually be merged with gstreamer (according to
+  # gst-transcoder 1.8.0 release notes). For now the only user is pitivi so we
+  # don't bother exposing the package to all of nixpkgs.
+  gst-transcoder = stdenv.mkDerivation rec {
+    version = "1.14.1";
+    pname = "gst-transcoder";
+    src = fetchFromGitHub {
+      owner = "pitivi";
+      repo = "gst-transcoder";
+      rev = version;
+      sha256 = "16skiz9akavssii529v9nr8zd54w43livc14khdyzv164djg9q8f";
+    };
+    nativeBuildInputs = [ pkgconfig meson ninja gobject-introspection python3 ];
+    buildInputs = with gst_all_1; [ gstreamer gst-plugins-base ];
+  };
+
+in python3Packages.buildPythonApplication rec {
+  name = "pitivi-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/pitivi/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "0mxp2p4gg976fp1vj3rb5rmpl5mqfzncm9vw2719irl32f1qlvyb";
+  };
+
+  format = "other";
+
+  patches = [
+    # By default, the build picks up environment variables like PYTHONPATH
+    # and saves them to the generated binary. This would make the build-time
+    # dependencies part of the closure so we remove it.
+    ./prevent-closure-contamination.patch
+  ];
+
+  postPatch = ''
+    patchShebangs ./getenvvar.py
+  '';
+
+  nativeBuildInputs = [ meson ninja pkgconfig intltool itstool python3 wrapGAppsHook ];
+
+  buildInputs = [
+    gobject-introspection gtk3 librsvg gnome3.gnome-desktop gsound
+    gnome3.adwaita-icon-theme
+    gsettings-desktop-schemas libnotify
+    gst-transcoder
+  ] ++ (with gst_all_1; [
+    gstreamer gst-editing-services
+    gst-plugins-base (gst-plugins-good.override { gtkSupport = true; })
+    gst-plugins-bad gst-plugins-ugly gst-libav gst-validate
+  ]);
+
+  pythonPath = with python3Packages; [ pygobject3 gst-python pyxdg numpy pycairo matplotlib dbus-python ];
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = "pitivi";
+      versionPolicy = "none"; # we are using dev version, since the stable one is too old
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Non-Linear video editor utilizing the power of GStreamer";
+    homepage = "http://pitivi.org/";
+    longDescription = ''
+      Pitivi is a video editor built upon the GStreamer Editing Services.
+      It aims to be an intuitive and flexible application
+      that can appeal to newbies and professionals alike.
+    '';
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/pitivi/prevent-closure-contamination.patch b/nixpkgs/pkgs/applications/video/pitivi/prevent-closure-contamination.patch
new file mode 100644
index 000000000000..0025ecd0a4cf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/pitivi/prevent-closure-contamination.patch
@@ -0,0 +1,23 @@
+--- a/meson.build
++++ b/meson.build
+@@ -26,15 +26,15 @@
+ geteenvvar = find_program('getenvvar.py')
+ cdata = configuration_data()
+ cdata.set('CONFIGURED_PYTHONPATH',
+-          run_command(geteenvvar, 'PYTHONPATH').stdout().strip())
++          '')
+ cdata.set('CONFIGURED_GI_TYPELIB_PATH',
+-          run_command(geteenvvar, 'GI_TYPELIB_PATH').stdout().strip())
++          '')
+ cdata.set('CONFIGURED_LD_LIBRARY_PATH',
+-          run_command(geteenvvar, 'LD_LIBRARY_PATH').stdout().strip())
++          '')
+ cdata.set('CONFIGURED_GST_PLUGIN_PATH',
+-          run_command(geteenvvar, 'GST_PLUGIN_PATH').stdout().strip())
++          '')
+ cdata.set('CONFIGURED_GST_PLUGIN_SYSTEM_PATH',
+-          run_command(geteenvvar, 'GST_PLUGIN_SYSTEM_PATH').stdout().strip())
++          '')
+ cdata.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
+ cdata.set('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
+ cdata.set('PACKAGE_NAME', 'Pitivi')
diff --git a/nixpkgs/pkgs/applications/video/plex-media-player/default.nix b/nixpkgs/pkgs/applications/video/plex-media-player/default.nix
new file mode 100644
index 000000000000..d08a4a852428
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/plex-media-player/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, fetchurl, pkgconfig, cmake, python3, mkDerivation
+, libX11, libXrandr, qtbase, qtwebchannel, qtwebengine, qtx11extras
+, libvdpau, SDL2, mpv, libGL }:
+let
+  # During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
+  # which then downloads a handful of web client-related files. To enable
+  # sandboxed builds, we manually download them and save them so these files
+  # are fetched ahead-of-time instead of during the CMake build. To update
+  # plex-media-player use the update.sh script, so the versions and hashes
+  # for these files are are also updated!
+  depSrcs = import ./deps.nix { inherit fetchurl; };
+in mkDerivation rec {
+  pname = "plex-media-player";
+  version = "2.55.0.1069";
+  vsnHash = "2369bed9";
+
+  src = fetchFromGitHub {
+    owner = "plexinc";
+    repo = "plex-media-player";
+    rev = "v${version}-${vsnHash}";
+    sha256 = "1jq4592sgaia0xy2h7n3vh5i7c84sdh4l64fdc774r4i0bmg66qi";
+  };
+
+  nativeBuildInputs = [ pkgconfig cmake python3 ];
+  buildInputs = [ libX11 libXrandr qtbase qtwebchannel qtwebengine qtx11extras
+                  libvdpau SDL2 mpv libGL ];
+
+  preConfigure = with depSrcs; ''
+    mkdir -p build/dependencies
+    ln -s ${webClient} build/dependencies/buildid-${webClientBuildId}.cmake
+    ln -s ${webClientDesktopHash} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1
+    ln -s ${webClientDesktop} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz
+    ln -s ${webClientTvHash} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz.sha1
+    ln -s ${webClientTv} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz
+  '';
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
+
+  passthru.updateScript = ./update.sh;
+
+  meta = with stdenv.lib; {
+    description = "Streaming media player for Plex";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ kylewlacy ];
+    homepage = "https://plex.tv";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/plex-media-player/deps.nix b/nixpkgs/pkgs/applications/video/plex-media-player/deps.nix
new file mode 100644
index 000000000000..26b57532615a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/plex-media-player/deps.nix
@@ -0,0 +1,28 @@
+{ fetchurl }:
+
+rec {
+  webClientBuildId = "180-afec74de50e175";
+  webClientDesktopBuildId = "4.29.2-e50e175";
+  webClientTvBuildId = "4.29.3-afec74d";
+
+  webClient = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake";
+    sha256 = "0rabrg3lk9vgpswk8npa54hzqf2v8ghqqnysxpwn12wrp1pc2rr9";
+  };
+  webClientDesktopHash = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1";
+    sha256 = "02b5yq4yc411qlg2dkw5j9lrr3cn2y4d27sin0skf6qza180473g";
+  };
+  webClientDesktop = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz";
+    sha256 = "0l3xv48kr2rx878a40zrgwif2ga2ikv6fdcbq9pylycnmm41pxmh";
+  };
+  webClientTvHash = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1";
+    sha256 = "0wq115y2xrgwqrzr43nhkq8ba237z20yfp426ki2kdypsq8fjqka";
+  };
+  webClientTv = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz";
+    sha256 = "1wax1qslm226l2w53m2fnl849jw349qhg3rjghx7vip5pmb43vw9";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/plex-media-player/update.sh b/nixpkgs/pkgs/applications/video/plex-media-player/update.sh
new file mode 100755
index 000000000000..a8493a16c989
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/plex-media-player/update.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl common-updater-scripts nix-prefetch-scripts jq
+
+set -xeuo pipefail
+
+nixpkgs="$(git rev-parse --show-toplevel)"
+
+oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; plex-media-player.version or (builtins.parseDrvName plex-media-player.name).version" | tr -d '"')"
+latestTag="$(curl -s https://api.github.com/repos/plexinc/plex-media-player/tags  | jq -r '.[] | .name' | sort --version-sort | tail -1)"
+latestVersion="$(expr $latestTag : 'v\(.*\)-.*')"
+latestHash="$(expr $latestTag : 'v.*-\(.*\)')"
+
+if [ ! "$oldVersion" = "$latestVersion" ]; then
+  # update default.nix with the new version and hash
+  expectedHash=$(nix-prefetch-git --url https://github.com/plexinc/plex-media-player.git --rev $latestTag --quiet | jq -r '.sha256')
+  update-source-version plex-media-player --version-key=vsnHash "${latestHash}" 0000
+  update-source-version plex-media-player "${latestVersion}" $expectedHash
+
+  # extract the webClientBuildId from the source folder
+  src="$(nix-build --no-out-link $nixpkgs -A plex-media-player.src)"
+  webClientBuildId="$(grep 'set(WEB_CLIENT_BUILD_ID' $src/CMakeModules/WebClient.cmake | cut -d' ' -f2 | tr -d ')')"
+
+  # retreive the included cmake file and hash
+  { read -r webClientBuildIdHash; read -r webClientBuildIdPath; } < \
+    <(nix-prefetch-url --print-path "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake")
+  webClientDesktopBuildId="$(grep 'set(DESKTOP_VERSION' $webClientBuildIdPath | cut -d' ' -f2 | tr -d ')')"
+  webClientTvBuildId="$(grep 'set(TV_VERSION' $webClientBuildIdPath | cut -d' ' -f2 | tr -d ')')"
+
+  # get the hashes for the other files
+  webClientDesktopHash="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1")"
+  webClientDesktop="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz")"
+  webClientTvHash="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1")"
+  webClientTv="$(nix-prefetch-url "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz")"
+
+  # update deps.nix
+  cat > $nixpkgs/pkgs/applications/video/plex-media-player/deps.nix <<EOF
+{ fetchurl }:
+
+rec {
+  webClientBuildId = "${webClientBuildId}";
+  webClientDesktopBuildId = "${webClientDesktopBuildId}";
+  webClientTvBuildId = "${webClientTvBuildId}";
+
+  webClient = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/buildid.cmake";
+    sha256 = "${webClientBuildIdHash}";
+  };
+  webClientDesktopHash = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-desktop-\${webClientDesktopBuildId}.tar.xz.sha1";
+    sha256 = "${webClientDesktopHash}";
+  };
+  webClientDesktop = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-desktop-\${webClientDesktopBuildId}.tar.xz";
+    sha256 = "${webClientDesktop}";
+  };
+  webClientTvHash = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-tv-\${webClientTvBuildId}.tar.xz.sha1";
+    sha256 = "${webClientTvHash}";
+  };
+  webClientTv = fetchurl {
+    url = "https://artifacts.plex.tv/web-client-pmp/\${webClientBuildId}/web-client-tv-\${webClientTvBuildId}.tar.xz";
+    sha256 = "${webClientTv}";
+  };
+}
+EOF
+
+  git add "$nixpkgs"/pkgs/applications/video/plex-media-player/{default,deps}.nix
+  git commit -m "plex-media-player: ${oldVersion} -> ${latestVersion}"
+else
+  echo "plex-media-player is already up-to-date"
+fi
diff --git a/nixpkgs/pkgs/applications/video/plex-mpv-shim/default.nix b/nixpkgs/pkgs/applications/video/plex-mpv-shim/default.nix
new file mode 100644
index 000000000000..993bdd67b0d0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/plex-mpv-shim/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildPythonApplication, fetchFromGitHub, mpv, requests, python-mpv-jsonipc }:
+
+buildPythonApplication rec {
+  pname = "plex-mpv-shim";
+  version = "1.8.0";
+
+  src = fetchFromGitHub {
+    owner = "iwalton3";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0fi0glnl7nr6754r9jk7d7dsnjbdm7civvhcj2l009yxiv2rxzj3";
+  };
+
+  propagatedBuildInputs = [ mpv requests python-mpv-jsonipc ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/iwalton3/plex-mpv-shim";
+    description = "Allows casting of videos to MPV via the Plex mobile and web app.";
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/pyca/default.nix b/nixpkgs/pkgs/applications/video/pyca/default.nix
new file mode 100644
index 000000000000..0fed17bb9999
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/pyca/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, buildPythonApplication, fetchFromGitHub, pycurl, dateutil, configobj, sqlalchemy, sdnotify, flask }:
+
+buildPythonApplication rec {
+  pname = "pyca";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "opencast";
+    repo = "pyCA";
+    rev = "v${version}";
+    sha256 = "0cvkmdlcax9da9iw4ls73vw0pxvm8wvchab5gwdy9w9ibqdpcmwh";
+  };
+
+  propagatedBuildInputs = [
+    pycurl
+    dateutil
+    configobj
+    sqlalchemy
+    sdnotify
+    flask
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A fully functional Opencast capture agent written in Python";
+    homepage = "https://github.com/opencast/pyCA";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ pmiddend ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/video/qarte/default.nix b/nixpkgs/pkgs/applications/video/qarte/default.nix
new file mode 100644
index 000000000000..26b3153019fb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/qarte/default.nix
@@ -0,0 +1,42 @@
+{ mkDerivation, lib, fetchbzr, python3, rtmpdump }:
+
+let
+  pythonEnv = python3.withPackages (ps: with ps; [ pyqt5_with_qtmultimedia ]);
+in mkDerivation {
+  name = "qarte-4.6.0";
+  src = fetchbzr {
+    url = "http://bazaar.launchpad.net/~vincent-vandevyvre/qarte/qarte-4";
+    rev = "22";
+    sha256 = "0v4zpj8w67ydvnmanxbl8pwvn0cfv70c0mlw36a1r4n0rvgxffcn";
+  };
+
+  buildInputs = [ pythonEnv ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    mv qarte $out/bin/
+    substituteInPlace $out/bin/qarte \
+      --replace '/usr/share' "$out/share"
+
+    mkdir -p $out/share/man/man1/
+    mv qarte.1 $out/share/man/man1/
+
+    mkdir -p $out/share/qarte
+    mv * $out/share/qarte/
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    wrapQtApp $out/bin/qarte \
+      --prefix PATH : ${rtmpdump}/bin
+  '';
+
+  meta = {
+    homepage = "https://launchpad.net/qarte";
+    description = "A recorder for Arte TV Guide and Arte Concert";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ vbgl ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/qmediathekview/default.nix b/nixpkgs/pkgs/applications/video/qmediathekview/default.nix
new file mode 100644
index 000000000000..7556727a80d3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/qmediathekview/default.nix
@@ -0,0 +1,32 @@
+{ mkDerivation, stdenv, fetchFromGitHub, qtbase, qttools, xz, boost, qmake, pkgconfig }:
+
+mkDerivation rec {
+  pname = "QMediathekView";
+  version = "2019-01-06";
+
+  src = fetchFromGitHub {
+    owner = "adamreichold";
+    repo = pname;
+    rev = "e098aaec552ec4e367078bf19953a08067316b4b";
+    sha256 = "0i9hac9alaajbra3lx23m0iiq6ww4is00lpbzg5x70agjrwj0nd6";
+  };
+
+  postPatch = ''
+    substituteInPlace ${pname}.pro \
+      --replace /usr ""
+  '';
+
+  buildInputs = [ qtbase qttools xz boost ];
+
+  nativeBuildInputs = [ qmake pkgconfig ];
+
+  installFlags = [ "INSTALL_ROOT=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "An alternative Qt-based front-end for the database maintained by the MediathekView project";
+    inherit (src.meta) homepage;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/qstopmotion/default.nix b/nixpkgs/pkgs/applications/video/qstopmotion/default.nix
new file mode 100644
index 000000000000..dbb2128b50bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/qstopmotion/default.nix
@@ -0,0 +1,82 @@
+{ stdenv
+, mkDerivation
+, fetchurl
+, qtbase
+, qtmultimedia
+, qtquickcontrols
+, qtimageformats
+, qtxmlpatterns
+, ffmpeg_3
+, guvcview
+, cmake
+, ninja
+, libxml2
+, gettext
+, pkgconfig
+, libgphoto2
+, gphoto2
+, v4l-utils
+, libv4l
+, pcre
+, qwt
+, extra-cmake-modules
+}:
+
+mkDerivation rec {
+  pname = "qstopmotion";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/${pname}/Version_${builtins.replaceStrings ["."] ["_"] version}/${pname}-${version}-Source.tar.gz";
+    sha256 = "03r6jxyq0bak2vsy2b78nk27m7fm96hnl8cx11l3l17704j4iglh";
+  };
+
+  buildInputs = [
+    qtbase
+    qtmultimedia
+    qtquickcontrols
+    qtimageformats
+    qtxmlpatterns
+    v4l-utils
+    libv4l
+    pcre
+    ffmpeg_3
+    guvcview
+    qwt
+  ];
+
+  nativeBuildInputs = [
+    pkgconfig
+    cmake
+    extra-cmake-modules
+    ninja
+    gettext
+    libgphoto2
+    gphoto2
+    libxml2
+    libv4l
+  ];
+
+  patchPhase = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "find_package(Qt5 REQUIRED COMPONENTS Core Widgets Xml" \
+                "find_package(Qt5 REQUIRED COMPONENTS Core Widgets Xml Multimedia"
+    grep -rl 'qwt' . | xargs sed -i 's@<qwt/qwt_slider.h>@<qwt_slider.h>@g'
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.qstopmotion.org";
+    description = "Create stopmotion animation with a (web)camera";
+    longDescription = ''
+      Qstopmotion is a tool to create stopmotion
+      animation. Its users are able to create stop-motions from pictures
+      imported from a camera or from the harddrive and export the
+      animation to different video formats such as mpeg or avi.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ maintainers.leenaars ];
+    broken = stdenv.isAarch64;
+    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/quvi/library.nix b/nixpkgs/pkgs/applications/video/quvi/library.nix
new file mode 100644
index 000000000000..c4926bedd727
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/quvi/library.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libproxy, libgcrypt, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libquvi";
+  version="0.9.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/quvi/libquvi-${version}.tar.xz";
+    sha256 = "1cl1kbgxl1jnx2nwx4z90l0lap09lnnj1fg7hxsxk3m6aj4y4grd";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ lua5 curl quvi_scripts libproxy libgcrypt glib ];
+
+  meta = {
+    description = "Web video downloader";
+    homepage = "http://quvi.sf.net";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/quvi/scripts.nix b/nixpkgs/pkgs/applications/video/quvi/scripts.nix
new file mode 100644
index 000000000000..462c2df9962c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/quvi/scripts.nix
@@ -0,0 +1,21 @@
+{stdenv, fetchurl, pkgconfig}:
+
+stdenv.mkDerivation rec {
+  pname = "quvi-scripts";
+  version="0.9.20131130";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/quvi/libquvi-scripts-${version}.tar.xz";
+    sha256 = "1qvp6z5k1qgcys7vf7jd6fm0g07xixmciwj14ypn1kqhmjgizwhp";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "Web video downloader";
+    homepage = "http://quvi.sf.net";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/quvi/tool.nix b/nixpkgs/pkgs/applications/video/quvi/tool.nix
new file mode 100644
index 000000000000..b2746ef82333
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/quvi/tool.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libquvi, lua5_sockets, glib, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  pname = "quvi";
+  version="0.9.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/quvi/quvi-${version}.tar.xz";
+    sha256 = "1h52s265rp3af16dvq1xlscp2926jqap2l4ah94vrfchv6m1hffb";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ lua5 curl quvi_scripts libquvi glib makeWrapper ];
+  postInstall = ''
+      wrapProgram $out/bin/quvi --set LUA_PATH "${lua5_sockets}/share/lua/${lua5.luaversion}/?.lua"
+  '';
+
+  meta = {
+    description = "Web video downloader";
+    homepage = "http://quvi.sf.net";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/screenkey/default.nix b/nixpkgs/pkgs/applications/video/screenkey/default.nix
new file mode 100644
index 000000000000..7e2bc3a3ec0c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/screenkey/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, substituteAll
+, buildPythonApplication
+, fetchFromGitHub
+, distutils_extra
+, setuptools-git
+, intltool
+, pygtk
+, libX11
+, libXtst
+, wrapGAppsHook
+, gnome3
+}:
+buildPythonApplication rec {
+  pname = "screenkey";
+  version = "0.9";
+
+  src = fetchFromGitHub {
+    owner = "wavexx";
+    repo = "screenkey";
+    rev = "screenkey-${version}";
+    sha256 = "14g7fiv9n7m03djwz1pp5034pffi87ssvss9bc1q8vq0ksn23vrw";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./paths.patch;
+      inherit libX11 libXtst;
+    })
+  ];
+
+  nativeBuildInputs = [
+    distutils_extra
+    setuptools-git
+    intltool
+
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gnome3.adwaita-icon-theme
+  ];
+
+  propagatedBuildInputs = [
+    pygtk
+  ];
+
+  # screenkey does not have any tests
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://www.thregr.org/~wavexx/software/screenkey/";
+    description = "A screencast tool to display your keys inspired by Screenflick";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.rasendubi ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/screenkey/paths.patch b/nixpkgs/pkgs/applications/video/screenkey/paths.patch
new file mode 100644
index 000000000000..7e5ed47fc19d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/screenkey/paths.patch
@@ -0,0 +1,20 @@
+--- a/Screenkey/xlib.py
++++ b/Screenkey/xlib.py
+@@ -6,7 +6,7 @@
+ from ctypes import *
+ 
+ ## base X11
+-libX11 = CDLL('libX11.so.6')
++libX11 = CDLL('@libX11@/lib/libX11.so.6')
+ 
+ # types
+ Atom = c_ulong
+@@ -278,7 +278,7 @@
+ 
+ 
+ ## record extensions
+-libXtst = CDLL('libXtst.so.6')
++libXtst = CDLL('@libXtst@/lib/libXtst.so.6')
+ 
+ # types
+ XPointer = String
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/video/shotcut/0001-encodedock.cpp-connect-to-VAAPI-via-DRM-not-X11.patch b/nixpkgs/pkgs/applications/video/shotcut/0001-encodedock.cpp-connect-to-VAAPI-via-DRM-not-X11.patch
new file mode 100644
index 000000000000..475788ba3a40
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/shotcut/0001-encodedock.cpp-connect-to-VAAPI-via-DRM-not-X11.patch
@@ -0,0 +1,33 @@
+From 247baa7e9210bbe5462b6155014c3dcd4a60e56a Mon Sep 17 00:00:00 2001
+From: Peter Simons <simons@cryp.to>
+Date: Tue, 24 Sep 2019 10:27:17 +0200
+Subject: [PATCH] encodedock.cpp: connect to VAAPI via DRM, not X11
+
+---
+ src/docks/encodedock.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/docks/encodedock.cpp b/src/docks/encodedock.cpp
+index f2d64fc8..63d20787 100644
+--- a/src/docks/encodedock.cpp
++++ b/src/docks/encodedock.cpp
+@@ -766,7 +766,6 @@ Mlt::Properties* EncodeDock::collectProperties(int realtime)
+                     setIfNotSet(p, "pix_fmt", "nv12");
+                 } else if (vcodec.endsWith("_vaapi")) {
+                     setIfNotSet(p, "vprofile", "main");
+-                    setIfNotSet(p, "connection_type", "x11");
+                 }
+             }
+             setIfNotSet(p, "width", ui->widthSpinner->value());
+@@ -1890,7 +1889,7 @@ void EncodeDock::on_hwencodeCheckBox_clicked(bool checked)
+             QStringList args;
+             args << "-hide_banner" << "-f" << "lavfi" << "-i" << "color=s=640x360" << "-frames" << "1" << "-an";
+             if (codec.endsWith("_vaapi"))
+-                args << "-init_hw_device" << "vaapi=vaapi0:,connection_type=x11" << "-filter_hw_device" << "vaapi0" << "-vf" << "format=nv12,hwupload";
++                args << "-init_hw_device" << "vaapi=vaapi0" << "-filter_hw_device" << "vaapi0" << "-vf" << "format=nv12,hwupload";
+             else if (codec == "hevc_qsv")
+                 args << "-load_plugin" << "hevc_hw";
+             args << "-c:v" << codec << "-f" << "rawvideo" << "pipe:";
+-- 
+2.24.1
+
diff --git a/nixpkgs/pkgs/applications/video/shotcut/default.nix b/nixpkgs/pkgs/applications/video/shotcut/default.nix
new file mode 100644
index 000000000000..9c0435a351c8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/shotcut/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitHub, fetchpatch, mkDerivation, SDL2, frei0r, gettext, mlt
+, jack1, pkgconfig, qtbase, qtmultimedia, qtwebkit, qtx11extras, qtwebsockets
+, qtquickcontrols, qtgraphicaleffects, libmlt, qmake, qttools
+}:
+
+assert stdenv.lib.versionAtLeast libmlt.version "6.18.0";
+assert stdenv.lib.versionAtLeast mlt.version "6.18.0";
+
+mkDerivation rec {
+  pname = "shotcut";
+  version = "20.04.12";
+
+  src = fetchFromGitHub {
+    owner = "mltframework";
+    repo = "shotcut";
+    rev = "v${version}";
+    sha256 = "05yyv9192f722j8fhfjrphxadgp3crvbq4pi23ln560zh9s1m8r4";
+  };
+
+  patches = [ ./0001-encodedock.cpp-connect-to-VAAPI-via-DRM-not-X11.patch ];
+
+  enableParallelBuilding = true;
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [
+    SDL2 frei0r gettext mlt libmlt
+    qtbase qtmultimedia qtwebkit qtx11extras qtwebsockets qtquickcontrols
+    qtgraphicaleffects
+  ];
+
+  NIX_CFLAGS_COMPILE = "-I${libmlt}/include/mlt++ -I${libmlt}/include/mlt";
+  qmakeFlags = [ "QMAKE_LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" "SHOTCUT_VERSION=${version}" ];
+
+  prePatch = ''
+    sed 's_shotcutPath, "qmelt"_"${mlt}/bin/melt"_' -i src/jobs/meltjob.cpp
+    sed 's_shotcutPath, "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/jobs/ffmpegjob.cpp
+    sed 's_qApp->applicationDirPath(), "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/docks/encodedock.cpp
+    NICE=$(type -P nice)
+    sed "s_/usr/bin/nice_''${NICE}_" -i src/jobs/meltjob.cpp src/jobs/ffmpegjob.cpp
+  '';
+
+  qtWrapperArgs = [
+    "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1"
+    "--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [jack1 SDL2]}"
+    "--prefix PATH : ${mlt}/bin"
+    ];
+
+  postInstall = ''
+    mkdir -p $out/share/shotcut
+    cp -r src/qml $out/share/shotcut/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A free, open source, cross-platform video editor";
+    longDescription = ''
+      An official binary for Shotcut, which includes all the
+      dependencies pinned to specific versions, is provided on
+      http://shotcut.org.
+
+      If you encounter problems with this version, please contact the
+      nixpkgs maintainer(s). If you wish to report any bugs upstream,
+      please use the official build from shotcut.org instead.
+    '';
+    homepage = "https://shotcut.org";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ goibhniu woffs peti ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/simplescreenrecorder/default.nix b/nixpkgs/pkgs/applications/video/simplescreenrecorder/default.nix
new file mode 100644
index 000000000000..7176f5e2f09c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/simplescreenrecorder/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, mkDerivation, fetchurl, alsaLib, ffmpeg_3, libjack2, libX11, libXext, qtx11extras
+, libXfixes, libGLU, libGL, pkgconfig, libpulseaudio, qtbase, cmake, ninja
+}:
+
+mkDerivation rec {
+  pname = "simplescreenrecorder";
+  version = "0.3.11";
+
+  src = fetchurl {
+    url = "https://github.com/MaartenBaert/ssr/archive/${version}.tar.gz";
+    sha256 = "0l6irdadqpajvv0dj3ngs1231n559l0y1pykhs2h7526qm4w7xal";
+  };
+
+  cmakeFlags = [ "-DWITH_QT5=TRUE" ];
+
+  patches = [ ./fix-paths.patch ];
+
+  postPatch = ''
+    for i in scripts/ssr-glinject src/AV/Input/GLInjectInput.cpp; do
+      substituteInPlace $i \
+        --subst-var out \
+        --subst-var-by sh ${stdenv.shell}
+    done
+  '';
+
+  nativeBuildInputs = [ pkgconfig cmake ninja ];
+  buildInputs = [
+    alsaLib ffmpeg_3 libjack2 libX11 libXext libXfixes libGLU libGL
+    libpulseaudio qtbase qtx11extras
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A screen recorder for Linux";
+    homepage = "https://www.maartenbaert.be/simplescreenrecorder";
+    license = licenses.gpl3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/simplescreenrecorder/fix-paths.patch b/nixpkgs/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
new file mode 100644
index 000000000000..ba02240ce1f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
@@ -0,0 +1,35 @@
+diff --git a/scripts/ssr-glinject b/scripts/ssr-glinject
+index 48be48d..5038d4c 100755
+--- a/scripts/ssr-glinject
++++ b/scripts/ssr-glinject
+@@ -59,6 +59,6 @@ do
+ 	fi
+ done
+ 
+-echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:libssr-glinject.so"
++echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:@out@/lib/libssr-glinject.so"
+ echo "ssr-glinject: command = $@"
+-LD_PRELOAD="$LD_PRELOAD:libssr-glinject.so" "$@"
++LD_PRELOAD="$LD_PRELOAD:@out@/lib/libssr-glinject.so" "$@"
+diff --git a/src/AV/Input/GLInjectInput.cpp b/src/AV/Input/GLInjectInput.cpp
+index 6b378f8..cbcf82b 100644
+--- a/src/AV/Input/GLInjectInput.cpp
++++ b/src/AV/Input/GLInjectInput.cpp
+@@ -96,7 +96,7 @@ void GLInjectInput::SetCapturing(bool capturing) {
+ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permissions, const QString& command, const QString& working_directory) {
+ 
+ 	// prepare command
+-	QString full_command = "LD_PRELOAD=\"libssr-glinject.so\" ";
++	QString full_command = "LD_PRELOAD=\"@out@/lib/libssr-glinject.so\" ";
+ 	full_command += "SSR_CHANNEL=\"" + ShellEscape(channel) + "\" ";
+ 	if(relax_permissions)
+ 		full_command += "SSR_STREAM_RELAX_PERMISSIONS=1 ";
+@@ -106,7 +106,7 @@ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permiss
+ 	QStringList args;
+ 	args.push_back("-c");
+ 	args.push_back(full_command);
+-	return QProcess::startDetached("/bin/sh", args, working_directory);
++	return QProcess::startDetached("@sh@", args, working_directory);
+ 
+ }
+ 
diff --git a/nixpkgs/pkgs/applications/video/smplayer/default.nix b/nixpkgs/pkgs/applications/video/smplayer/default.nix
new file mode 100644
index 000000000000..85c71e86a649
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/smplayer/default.nix
@@ -0,0 +1,26 @@
+{ lib, mkDerivation, fetchurl, qmake, qtscript }:
+
+mkDerivation rec {
+  pname = "smplayer";
+  version = "20.4.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "0kqdx6q2274gm83rycvdcglka60ymdk4iw2lc39iw7z1zgsv6ky3";
+  };
+
+  buildInputs = [ qtscript ];
+  nativeBuildInputs = [ qmake ];
+
+  dontUseQmakeConfigure = true;
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = {
+    description = "A complete front-end for MPlayer";
+    longDescription = "Either mplayer or mpv should also be installed for smplayer to play medias";
+    homepage = "https://www.smplayer.info";
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/smtube/default.nix b/nixpkgs/pkgs/applications/video/smtube/default.nix
new file mode 100644
index 000000000000..1cd6fb693e81
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/smtube/default.nix
@@ -0,0 +1,28 @@
+{ lib, mkDerivation, fetchurl, qmake, qtscript, qtwebkit }:
+
+mkDerivation rec {
+  version = "20.1.0";
+  pname = "smtube";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/smtube/SMTube/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "00x7gyk06d01hrr1lcqbrffbkkpj2j0j1fy9mkxc7slbzqcl27dz";
+  };
+
+  makeFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  dontUseQmakeConfigure = true;
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtscript qtwebkit ];
+
+  meta = with lib; {
+    description = "Play and download Youtube videos";
+    homepage = "http://smplayer.sourceforge.net/smtube.php";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ vbgl ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/streamlink/default.nix b/nixpkgs/pkgs/applications/video/streamlink/default.nix
new file mode 100644
index 000000000000..c1066bf283a4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/streamlink/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, pythonPackages, fetchFromGitHub, rtmpdump, ffmpeg_3 }:
+
+pythonPackages.buildPythonApplication rec {
+  version = "1.4.1";
+  pname = "streamlink";
+
+  src = fetchFromGitHub {
+    owner = "streamlink";
+    repo = "streamlink";
+    rev = version;
+    sha256 = "1q3h48qwf7vs2wnbkwv0xnm6s65mkcyqdz7z6z3vrsmif2sb19l2";
+  };
+
+  checkInputs = with pythonPackages; [ pytest mock requests-mock freezegun ];
+
+  propagatedBuildInputs = (with pythonPackages; [ pycryptodome requests iso-639 iso3166 websocket_client isodate ]) ++ [ rtmpdump ffmpeg_3 ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/streamlink/streamlink";
+    description = "CLI for extracting streams from various websites to video player of your choosing";
+    longDescription = ''
+      Streamlink is a CLI utility that pipes flash videos from online
+      streaming services to a variety of video players such as VLC, or
+      alternatively, a browser.
+
+      Streamlink is a fork of the livestreamer project.
+    '';
+    license = licenses.bsd2;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ dezgeg zraexy enzime ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/subdl/default.nix b/nixpkgs/pkgs/applications/video/subdl/default.nix
new file mode 100644
index 000000000000..b2b020a20d23
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/subdl/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, python3 }:
+
+stdenv.mkDerivation {
+  name = "subdl-0.0pre.2017.11.06";
+
+  src = fetchFromGitHub {
+    owner = "alexanderwink";
+    repo = "subdl";
+    rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
+    sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
+  };
+
+  meta = {
+    homepage = "https://github.com/alexanderwink/subdl";
+    description = "A command-line tool to download subtitles from opensubtitles.org";
+    platforms = stdenv.lib.platforms.all;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.exfalso ];
+  };
+
+  buildInputs = [ python3 ];
+
+  installPhase = ''
+    install -vD subdl $out/bin/subdl
+  '';  
+}
diff --git a/nixpkgs/pkgs/applications/video/subtitleeditor/default.nix b/nixpkgs/pkgs/applications/video/subtitleeditor/default.nix
new file mode 100644
index 000000000000..29e2de6b6c0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/subtitleeditor/default.nix
@@ -0,0 +1,64 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, intltool, file,
+  desktop-file-utils, enchant, gtk3, gtkmm3, gst_all_1, hicolor-icon-theme,
+  libsigcxx, libxmlxx, xdg_utils, isocodes, wrapGAppsHook
+}:
+
+let
+  version = "0.54.0";
+in
+
+stdenv.mkDerivation {
+  pname = "subtitleeditor";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "kitone";
+    repo = "subtitleeditor";
+    rev = version;
+    sha256 = "0vxcscc9m6gymgj173ahk2g9hlk9588z5fdaavmkpyriqdlhwm11";
+  };
+
+  nativeBuildInputs =  [
+    autoreconfHook
+    pkgconfig
+    intltool
+    file
+    wrapGAppsHook
+  ];
+
+  buildInputs =  [
+    desktop-file-utils
+    enchant
+    gtk3
+    gtkmm3
+    gst_all_1.gstreamer
+    gst_all_1.gstreamermm
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    hicolor-icon-theme
+    libsigcxx
+    libxmlxx
+    xdg_utils
+    isocodes
+  ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file";
+
+  configureFlags = [ "--disable-debug" ];
+
+  meta = {
+    description = "GTK 3 application to edit video subtitles";
+    longDescription = ''
+      Subtitle Editor is a GTK 3 tool to edit subtitles for GNU/Linux/*BSD. It
+      can be used for new subtitles or as a tool to transform, edit, correct
+      and refine existing subtitle. This program also shows sound waves, which
+      makes it easier to synchronise subtitles to voices.
+      '';
+    homepage = "http://kitone.github.io/subtitleeditor/";
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.plcplc ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/tartube/default.nix b/nixpkgs/pkgs/applications/video/tartube/default.nix
new file mode 100644
index 000000000000..23ee76eb4693
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/tartube/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gdk-pixbuf
+, gobject-introspection
+, gtk3
+, libnotify
+, pango
+, python3Packages
+, wrapGAppsHook
+, youtube-dl
+, glib
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "tartube";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "axcore";
+    repo = "tartube";
+    rev = "v${version}";
+    sha256 = "1klqjwqm29y2f6nc8gn222ykfvb5d64z1w2kifw9bq5bv0np9bda";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  strictDeps = false;
+
+  propagatedBuildInputs = with python3Packages; [
+    moviepy
+    pygobject3
+    pyxdg
+    requests
+    feedparser
+    playsound
+  ];
+
+  buildInputs = [
+    gdk-pixbuf
+    gtk3
+    glib
+    libnotify
+    pango
+  ];
+
+  postPatch = ''
+    sed -i "/^\s*install_requires/s/, 'gi'\|'gi', \|'gi'//" setup.py
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/{man/man1,applications,pixmaps}
+    cp pack/tartube.1 $out/share/man/man1
+    cp pack/tartube.desktop $out/share/applications
+    cp pack/tartube.{png,xpm} $out/share/pixmaps
+  '';
+
+  doCheck = false;
+
+  makeWrapperArgs = [
+    "--prefix PATH : ${stdenv.lib.makeBinPath [ youtube-dl ]}"
+  ];
+
+  meta = with lib; {
+    description = "A GUI front-end for youtube-dl";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mkg20001 luc65r ];
+    homepage = "https://tartube.sourceforge.io/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/tivodecode/default.nix b/nixpkgs/pkgs/applications/video/tivodecode/default.nix
new file mode 100644
index 000000000000..33e04b77c4b4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/tivodecode/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+let
+  version = "0.2pre4";
+
+in
+
+stdenv.mkDerivation {
+  pname = "tivodecode";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tivodecode/tivodecode/${version}/tivodecode-${version}.tar.gz";
+    sha256 = "1pww5r2iygscqn20a1cz9xbfh18p84a6a5ifg4h5nvyn9b63k23q";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Converts a .TiVo file (produced by TiVoToGo) to a normal MPEG file";
+    homepage = "http://tivodecode.sourceforge.net";
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/uvccapture/default.nix b/nixpkgs/pkgs/applications/video/uvccapture/default.nix
new file mode 100644
index 000000000000..f52ffa923d28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/uvccapture/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, libjpeg }:
+
+let
+  debianPatches = fetchurl {
+    url = "mirror://debian/pool/main/u/uvccapture/uvccapture_0.5-3.debian.tar.gz";
+    sha256 = "0m29by13nw1r8sch366qzdxg5rsd1k766kqg1nj2pdb8f7pwjh9r";
+  };
+
+in
+
+stdenv.mkDerivation {
+  name = "uvccapture-0.5";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/u/uvccapture/uvccapture_0.5.orig.tar.gz";
+    sha256 = "1b3akkcmr3brbf93akr8xi20w8zqf2g0qfq928500wy04qi6jqpi";
+  };
+
+  buildInputs = [ libjpeg ];
+
+  patchPhase = ''
+    tar xvf "${debianPatches}"
+    for fname in debian/patches/fix_videodev_include_FTBFS.patch \
+                 debian/patches/warnings.patch \
+                 debian/patches/numbuffers.patch
+    do
+        echo "Applying patch $fname"
+        patch < "$fname"
+    done
+  '';
+
+  makeFlagsArray = [ "PREFIX=$(out)/bin/" ];
+
+  preInstall = ''
+    mkdir -p "$out/bin"
+  '';
+
+  # Upstream has no man page, install one from Debian
+  postInstall = ''
+    mkdir -p "$out/share/man/man1"
+    cp -v debian/uvccapture.1 "$out/share/man/man1/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Capture image from USB webcam at a specified interval";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vdr/default.nix b/nixpkgs/pkgs/applications/video/vdr/default.nix
new file mode 100644
index 000000000000..d025554835ef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vdr/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, fontconfig, libjpeg, libcap, freetype, fribidi, pkgconfig
+, gettext, systemd, perl, lib
+, enableSystemd ? true
+, enableBidi ? true
+}: stdenv.mkDerivation rec {
+
+  pname = "vdr";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url = "ftp://ftp.tvdr.de/vdr/${pname}-${version}.tar.bz2";
+    sha256 = "1p51b14aqzncx3xpfg0rjplc48pg7520035i5p6r5zzkqhszihr5";
+  };
+
+  enableParallelBuilding = true;
+
+  postPatch = "substituteInPlace Makefile --replace libsystemd-daemon libsystemd";
+
+  buildInputs = [ fontconfig libjpeg libcap freetype perl ]
+  ++ lib.optional enableSystemd systemd
+  ++ lib.optional enableBidi fribidi;
+
+  buildFlags = [ "vdr" "i18n" ]
+  ++ lib.optional enableSystemd "SDNOTIFY=1"
+  ++ lib.optional enableBidi "BIDI=1";
+
+  nativeBuildInputs = [ perl ];
+
+  # plugins uses the same build environment as vdr
+  propagatedNativeBuildInputs = [ pkgconfig gettext ];
+
+  installFlags = [
+    "DESTDIR=$(out)"
+    "PREFIX=" # needs to be empty, otherwise plugins try to install at same prefix
+  ];
+
+  installTargets = [ "install-pc" "install-bin" "install-doc" "install-i18n"
+    "install-includes" ];
+
+  postInstall = ''
+    mkdir -p $out/lib/vdr # only needed if vdr is started without any plugin
+    mkdir -p $out/share/vdr/conf
+    cp *.conf $out/share/vdr/conf
+    '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  meta = with lib; {
+    homepage = "http://www.tvdr.de/";
+    description = "Video Disc Recorder";
+    maintainers = [ maintainers.ck3d ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vdr/plugins.nix b/nixpkgs/pkgs/applications/video/vdr/plugins.nix
new file mode 100644
index 000000000000..2ae4cbac4d73
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vdr/plugins.nix
@@ -0,0 +1,338 @@
+{ stdenv, fetchurl, fetchgit, vdr, alsaLib, fetchFromGitHub
+, libvdpau, libxcb, xcbutilwm, graphicsmagick, libav, pcre, xorgserver, ffmpeg_3
+, libiconv, boost, libgcrypt, perl, utillinux, groff, libva, xorg, ncurses
+, callPackage
+}: let
+  mkPlugin = name: stdenv.mkDerivation {
+    name = "vdr-${vdr.version}-${name}";
+    inherit (vdr) src;
+    buildInputs = [ vdr ];
+    preConfigure = "cd PLUGINS/src/${name}";
+    installFlags = [ "DESTDIR=$(out)" ];
+  };
+in {
+
+  xineliboutput = callPackage ./xineliboutput {};
+
+  skincurses = (mkPlugin "skincurses").overrideAttrs(oldAttr: {
+    buildInputs = oldAttr.buildInputs ++ [ ncurses ];
+  });
+
+  inherit (stdenv.lib.genAttrs [
+    "epgtableid0" "hello" "osddemo" "pictures" "servicedemo" "status" "svdrpdemo"
+  ] mkPlugin);
+
+  femon = stdenv.mkDerivation rec {
+
+    name = "vdr-femon-2.4.0";
+
+    buildInputs = [ vdr ];
+
+    src = fetchurl {
+      url = "http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${name}.tgz";
+      sha256 = "1hra1xslj8s68zbyr8zdqp8yap0aj1p6rxyc6cwy1j122kwcnapp";
+    };
+
+    postPatch = "substituteInPlace Makefile --replace /bin/true true";
+
+    makeFlags = [ "DESTDIR=$(out)" ];
+
+    meta = with stdenv.lib; {
+      homepage = "http://www.saunalahti.fi/~rahrenbe/vdr/femon/";
+      description = "DVB Frontend Status Monitor plugin for VDR";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+
+  };
+
+  vaapidevice = stdenv.mkDerivation {
+
+    name = "vdr-vaapidevice-0.7.0";
+
+    buildInputs = [
+      vdr libxcb xcbutilwm ffmpeg_3
+      alsaLib
+      libvdpau # vdpau
+      libva # va-api
+    ] ++ (with xorg; [ libxcb libX11 ]);
+
+    makeFlags = [ "DESTDIR=$(out)" ];
+
+    postPatch = ''
+      substituteInPlace softhddev.c --replace /usr/bin/X ${xorgserver}/bin/X
+    '';
+
+    src = fetchFromGitHub {
+      owner = "pesintta";
+      repo = "vdr-plugin-vaapidevice";
+      sha256 = "072y61fpkh3i2dragg0nsd4g3malgwxkwpdrb1ykdljyzf52s5hs";
+      rev = "c99afc23a53e6d91f9afaa99af59b30e68e626a8";
+    };
+
+    meta = with stdenv.lib; {
+      homepage = "https://github.com/pesintta/vdr-plugin-vaapidevice";
+      description = "VDR SoftHDDevice Plug-in (with VA-API VPP additions)";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+
+  };
+
+
+  markad = stdenv.mkDerivation rec {
+    name = "vdr-markad-2017-03-13";
+
+    src = fetchgit {
+      url = "git://projects.vdr-developer.org/vdr-plugin-markad.git";
+      sha256 = "0jvy70r8bcmbs7zdqilfz019z5xkz5c6rs57h1dsgv8v6x86c2i4";
+      rev = "ea2e182ec798375f3830f8b794e7408576f139ad";
+    };
+
+    buildInputs = [ vdr libav ];
+
+    postPatch = ''
+      substituteInPlace command/Makefile --replace '$(DESTDIR)/usr' '$(DESTDIR)'
+
+      substituteInPlace plugin/markad.cpp \
+        --replace "/usr/bin" "$out/bin" \
+        --replace "/var/lib/markad" "$out/var/lib/markad"
+
+      substituteInPlace command/markad-standalone.cpp \
+        --replace "/var/lib/markad" "$out/var/lib/markad"
+    '';
+
+    preBuild = ''
+      mkdir -p $out/lib/vdr
+    '';
+
+    buildFlags = [
+      "DESTDIR=$(out)"
+      "LIBDIR=$(out)/lib/vdr"
+      "VDRDIR=${vdr.dev}/include/vdr"
+      "LOCALEDIR=$(DESTDIR)/share/locale"
+    ];
+
+    installFlags = buildFlags;
+
+    meta = with stdenv.lib; {
+      homepage = "https://projects.vdr-developer.org/projects/plg-markad";
+      description = "Ein Programm zum automatischen Setzen von Schnittmarken bei Werbeeinblendungen während einer Sendung.";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+
+  };
+
+  epgsearch = stdenv.mkDerivation rec {
+    pname = "vdr-epgsearch";
+    version = "2.4.0";
+
+    src = fetchurl {
+      url = "https://projects.vdr-developer.org/git/vdr-plugin-epgsearch.git/snapshot/vdr-plugin-epgsearch-${version}.tar.bz2";
+      sha256 = "0xfgn17vicyjwdf0rbkrik4q16mnfi305d4wmi8f0qk825pa0z3y";
+    };
+
+    postPatch = ''
+      for f in *.sh; do
+        patchShebangs "$f"
+      done
+    '';
+
+    nativeBuildInputs = [
+      perl # for pod2man and pos2html
+      utillinux
+      groff
+    ];
+
+    buildInputs = [
+      vdr
+      pcre
+    ];
+
+    buildFlags = [
+      "SENDMAIL="
+      "REGEXLIB=pcre"
+    ];
+
+    installFlags = [
+      "DESTDIR=$(out)"
+    ];
+
+    outputs = [ "out" "man" ];
+
+    meta = with stdenv.lib; {
+      homepage = "http://winni.vdr-developer.org/epgsearch";
+      description = "Searchtimer and replacement of the VDR program menu";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+
+  };
+
+  vnsiserver = let
+    name = "vnsiserver";
+    version = "1.8.0";
+  in stdenv.mkDerivation {
+    name = "vdr-${name}-${version}";
+
+    buildInputs = [ vdr ];
+
+    installFlags = [ "DESTDIR=$(out)" ];
+
+    src = fetchFromGitHub {
+      repo = "vdr-plugin-${name}";
+      owner = "FernetMenta";
+      rev = "v${version}";
+      sha256 = "0n7idpxqx7ayd63scl6xwdx828ik4kb2mwz0c30cfjnmnxxd45lw";
+    };
+
+    meta = with stdenv.lib; {
+      homepage = "https://github.com/FernetMenta/vdr-plugin-vnsiserver";
+      description = "VDR plugin to handle KODI clients.";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+
+  };
+
+  text2skin = stdenv.mkDerivation {
+    name = "vdr-text2skin-1.3.4-20170702";
+
+    src = fetchgit {
+      url = "git://projects.vdr-developer.org/vdr-plugin-text2skin.git";
+      sha256 = "19hkwmaw6nwak38bv6cm2vcjjkf4w5yjyxb98qq6zfjjh5wq54aa";
+      rev = "8f7954da2488ced734c30e7c2704b92a44e6e1ad";
+    };
+
+    buildInputs = [ vdr graphicsmagick ];
+
+    buildFlags = [
+      "DESTDIR=$(out)"
+      "IMAGELIB=graphicsmagic"
+      "VDRDIR=${vdr.dev}/include/vdr"
+      "LOCALEDIR=$(DESTDIR)/share/locale"
+      "LIBDIR=$(DESTDIR)/lib/vdr"
+    ];
+
+    preBuild = ''
+      mkdir -p $out/lib/vdr
+    '';
+
+    installPhase = ":";
+
+    meta = with stdenv.lib; {
+      homepage = "https://projects.vdr-developer.org/projects/plg-text2skin";
+      description = "VDR Text2Skin Plugin";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+  };
+
+  fritzbox = let
+    libconvpp = stdenv.mkDerivation {
+      name = "jowi24-libconv++-20130216";
+      propagatedBuildInputs = [ libiconv ];
+      CXXFLAGS = "-std=gnu++11 -Os";
+      src = fetchFromGitHub {
+        owner = "jowi24";
+        repo = "libconvpp";
+        rev = "90769b2216bc66c5ea5e41a929236c20d367c63b";
+        sha256 = "0bf0dwxrzd42l84p8nxcsjdk1gvzlhad93nsbn97z6kr61n4cr33";
+      };
+      installPhase = ''
+        mkdir -p $out/lib $out/include/libconv++
+        cp source.a $out/lib/libconv++.a
+        cp *.h $out/include/libconv++
+      '';
+    };
+
+    liblogpp = stdenv.mkDerivation {
+      name = "jowi24-liblogpp-20130216";
+      CXXFLAGS = "-std=gnu++11 -Os";
+      src = fetchFromGitHub {
+        owner = "jowi24";
+        repo = "liblogpp";
+        rev = "eee4046d2ae440974bcc8ceec00b069f0a2c62b9";
+        sha256 = "01aqvwmwh5kk3mncqpim8llwha9gj5qq0c4cvqfn4h8wqi3d9l3p";
+      };
+      installPhase = ''
+        mkdir -p $out/lib $out/include/liblog++
+        cp source.a $out/lib/liblog++.a
+        cp *.h $out/include/liblog++
+      '';
+    };
+
+    libnetpp = stdenv.mkDerivation {
+      name = "jowi24-libnet++-20180628";
+      CXXFLAGS = "-std=gnu++11 -Os";
+      src = fetchFromGitHub {
+        owner = "jowi24";
+        repo = "libnetpp";
+        rev = "212847f0efaeffee8422059b8e202d844174aaf3";
+        sha256 = "0vjl6ld6aj25rzxm26yjv3h2gy7gp7qnbinpw6sf1shg2xim9x0b";
+      };
+      installPhase = ''
+        mkdir -p $out/lib $out/include/libnet++
+        cp source.a $out/lib/libnet++.a
+        cp *.h $out/include/libnet++
+      '';
+      buildInputs = [ boost liblogpp libconvpp ];
+    };
+
+    libfritzpp = stdenv.mkDerivation {
+      name = "jowi24-libfritzpp-20131201";
+      CXXFLAGS = "-std=gnu++11 -Os";
+      src = fetchFromGitHub {
+        owner = "jowi24";
+        repo = "libfritzpp";
+        rev = "ca19013c9451cbac7a90155b486ea9959ced0f67";
+        sha256 = "0jk93zm3qzl9z96gfs6xl1c8ip8lckgbzibf7jay7dbgkg9kyjfg";
+      };
+      installPhase = ''
+        mkdir -p $out/lib $out/include/libfritz++
+        cp source.a $out/lib/libfritz++.a
+        cp *.h $out/include/libfritz++
+      '';
+      propagatedBuildInputs = [ libgcrypt ];
+      buildInputs = [ boost liblogpp libconvpp libnetpp ];
+    };
+
+  in stdenv.mkDerivation rec {
+    pname = "vdr-fritzbox";
+
+    version = "1.5.3";
+
+    src = fetchFromGitHub {
+      owner = "jowi24";
+      repo = "vdr-fritz";
+      rev = version;
+      sha256 = "0wab1kyma9jzhm6j33cv9hd2a5d1334ghgdi2051nmr1bdcfcsw8";
+    };
+
+    postUnpack = ''
+      cp ${libfritzpp}/lib/* $sourceRoot/libfritz++
+      cp ${liblogpp}/lib/* $sourceRoot/liblog++
+      cp ${libnetpp}/lib/* $sourceRoot/libnet++
+      cp ${libconvpp}/lib/* $sourceRoot/libconv++
+    '';
+
+    buildInputs = [ vdr boost libconvpp libfritzpp libnetpp liblogpp ];
+
+    installFlags = [ "DESTDIR=$(out)" ];
+
+    meta = with stdenv.lib; {
+      homepage = "https://github.com/jowi24/vdr-fritz";
+      description = "A plugin for VDR to access AVMs Fritz Box routers";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      platforms = [ "i686-linux" "x86_64-linux" ];
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vdr/wrapper.nix b/nixpkgs/pkgs/applications/video/vdr/wrapper.nix
new file mode 100644
index 000000000000..50d3b9d65a8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vdr/wrapper.nix
@@ -0,0 +1,30 @@
+{ symlinkJoin, lib, makeWrapper, vdr
+, plugins ? []
+}: let
+
+  makeXinePluginPath = l: lib.concatStringsSep ":" (map (p: "${p}/lib/xine/plugins") l);
+
+  requiredXinePlugins = lib.flatten (map (p: p.passthru.requiredXinePlugins or []) plugins);
+
+in symlinkJoin {
+
+  name = "vdr-with-plugins-${lib.getVersion vdr}";
+
+  paths = [ vdr ] ++ plugins;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/vdr \
+      --add-flags "-L $out/lib/vdr --localedir=$out/share/locale" \
+      --prefix XINE_PLUGIN_PATH ":" ${makeXinePluginPath requiredXinePlugins}
+  '';
+
+  meta = with vdr.meta; {
+    inherit license homepage;
+    description = description
+    + " (with plugins: "
+    + lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins))
+    + ")";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vdr/xineliboutput/default.nix b/nixpkgs/pkgs/applications/video/vdr/xineliboutput/default.nix
new file mode 100644
index 000000000000..950cb253c129
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vdr/xineliboutput/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, fetchurl, lib, vdr
+, libav, libcap, libvdpau
+, xineLib, libjpeg, libextractor, libglvnd, libGLU
+, libX11, libXext, libXrender, libXrandr
+, makeWrapper
+}: let
+  makeXinePluginPath = l: lib.concatStringsSep ":" (map (p: "${p}/lib/xine/plugins") l);
+
+  self =  stdenv.mkDerivation rec {
+    pname = "vdr-xineliboutput";
+    version = "2.2.0";
+
+    src = fetchurl {
+      url = "mirror://sourceforge/project/xineliboutput/xineliboutput/${pname}-${version}/${pname}-${version}.tgz";
+      sha256 = "0a24hs5nr7ncf51c5agyfn1xrvb4p70y3i0s6dlyyd9bwbfjldns";
+    };
+
+    postPatch = ''
+      # pkg-config is called with opengl, which do not contain needed glx symbols
+      substituteInPlace configure \
+        --replace "X11  opengl" "X11  gl"
+    '';
+
+    # configure don't accept argument --prefix
+    dontAddPrefix = true;
+
+    postConfigure = ''
+      sed -i config.mak \
+        -e 's,XINEPLUGINDIR=/[^/]*/[^/]*/[^/]*/,XINEPLUGINDIR=/,'
+    '';
+
+    makeFlags = [ "DESTDIR=$(out)" ];
+
+    postFixup = ''
+      for f in $out/bin/*; do
+        wrapProgram $f \
+          --prefix XINE_PLUGIN_PATH ":" "${makeXinePluginPath [ "$out" xineLib ]}"
+      done
+    '';
+
+    nativeBuildInputs = [ makeWrapper ];
+
+    buildInputs = [
+      libav
+      libcap
+      libextractor
+      libjpeg
+      libglvnd
+      libGLU
+      libvdpau
+      libXext
+      libXrandr
+      libXrender
+      libX11
+      vdr
+      xineLib
+    ];
+
+    passthru.requiredXinePlugins = [ xineLib self ];
+
+    meta = with lib;{
+      homepage = "https://sourceforge.net/projects/xineliboutput/";
+      description = "Xine-lib based software output device for VDR";
+      maintainers = [ maintainers.ck3d ];
+      license = licenses.gpl2;
+      inherit (vdr.meta) platforms;
+    };
+  };
+in self
diff --git a/nixpkgs/pkgs/applications/video/vlc/default.nix b/nixpkgs/pkgs/applications/video/vlc/default.nix
new file mode 100644
index 000000000000..91fb36c39748
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vlc/default.nix
@@ -0,0 +1,103 @@
+{ stdenv, fetchurl, autoreconfHook
+, libarchive, perl, xorg, libdvdnav, libbluray
+, zlib, a52dec, libmad, faad2, ffmpeg_3, alsaLib
+, pkgconfig, dbus, fribidi, freefont_ttf, libebml, libmatroska
+, libvorbis, libtheora, speex, lua5, libgcrypt, libgpgerror, libupnp
+, libcaca, libpulseaudio, flac, schroedinger, libxml2, librsvg
+, mpeg2dec, systemd, gnutls, avahi, libcddb, libjack2, SDL, SDL_image
+, libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, libssh2, liboggz
+, libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
+, libvdpau, libsamplerate, live555, fluidsynth, wayland, wayland-protocols
+, onlyLibVLC ? false
+, withQt5 ? true, qtbase ? null, qtsvg ? null, qtx11extras ? null, wrapQtAppsHook ? null
+, jackSupport ? false
+, removeReferencesTo
+, chromecastSupport ? true, protobuf, libmicrodns
+}:
+
+# chromecastSupport requires TCP port 8010 to be open for it to work.
+# If your firewall is enabled, make sure to have something like:
+#   networking.firewall.allowedTCPPorts = [ 8010 ];
+
+with stdenv.lib;
+
+assert (withQt5 -> qtbase != null && qtsvg != null && qtx11extras != null && wrapQtAppsHook != null);
+
+stdenv.mkDerivation rec {
+  pname = "vlc";
+  version = "3.0.11";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/vlc/${version}/${pname}-${version}.tar.xz";
+    sha256 = "06a9hfl60f6l0fs5c9ma5s8np8kscm4ala6m2pdfji9lyfna351y";
+  };
+
+  # VLC uses a *ton* of libraries for various pieces of functionality, many of
+  # which are not included here for no other reason that nobody has mentioned
+  # needing them
+  buildInputs = [
+    zlib a52dec libmad faad2 ffmpeg_3 alsaLib libdvdnav libdvdnav.libdvdread
+    libbluray dbus fribidi libvorbis libtheora speex lua5 libgcrypt libgpgerror
+    libupnp libcaca libpulseaudio flac schroedinger libxml2 librsvg mpeg2dec
+    systemd gnutls avahi libcddb SDL SDL_image libmtp unzip taglib libarchive
+    libkate libtiger libv4l samba libssh2 liboggz libass libdvbpsi libva
+    xorg.xlibsWrapper xorg.libXv xorg.libXvMC xorg.libXpm xorg.xcbutilkeysyms
+    libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate
+    fluidsynth wayland wayland-protocols
+  ] ++ optional (!stdenv.hostPlatform.isAarch64) live555
+    ++ optionals withQt5    [ qtbase qtsvg qtx11extras ]
+    ++ optional jackSupport libjack2
+    ++ optionals chromecastSupport [ protobuf libmicrodns ];
+
+  nativeBuildInputs = [ autoreconfHook perl pkgconfig removeReferencesTo ]
+    ++ optionals withQt5 [ wrapQtAppsHook ];
+
+  enableParallelBuilding = true;
+
+  LIVE555_PREFIX = if (!stdenv.hostPlatform.isAarch64) then live555 else null;
+
+  # vlc depends on a c11-gcc wrapper script which we don't have so we need to
+  # set the path to the compiler
+  BUILDCC = "${stdenv.cc}/bin/gcc";
+
+  postPatch = ''
+    substituteInPlace configure \
+      --replace /bin/echo echo
+
+    substituteInPlace modules/text_renderer/freetype/platform_fonts.h --replace \
+      /usr/share/fonts/truetype/freefont ${freefont_ttf}/share/fonts/truetype
+  '';
+
+  # - Touch plugins (plugins cache keyed off mtime and file size:
+  #     https://github.com/NixOS/nixpkgs/pull/35124#issuecomment-370552830
+  # - Remove references to the Qt development headers (used in error messages)
+  postFixup = ''
+    find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';'
+    $out/lib/vlc/vlc-cache-gen $out/vlc/plugins
+  '' + optionalString withQt5 ''
+    remove-references-to -t "${qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so
+  '';
+
+  # Most of the libraries are auto-detected so we don't need to set a bunch of
+  # "--enable-foo" flags here
+  configureFlags = [
+    "--with-kde-solid=$out/share/apps/solid/actions"
+  ] ++ optional onlyLibVLC "--disable-vlc"
+    ++ optionals chromecastSupport [
+    "--enable-sout"
+    "--enable-chromecast"
+    "--enable-microdns"
+  ];
+
+  # Remove runtime dependencies on libraries
+  postConfigure = ''
+    sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE "<removed>"|g' config.h
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Cross-platform media player and streaming server";
+    homepage = "http://www.videolan.org/vlc/";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vokoscreen/default.nix b/nixpkgs/pkgs/applications/video/vokoscreen/default.nix
new file mode 100644
index 000000000000..0cd3c814b173
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vokoscreen/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchFromGitHub, mkDerivation
+, pkgconfig, qtbase, qttools, qmake, qtmultimedia, qtx11extras, alsaLib, libv4l, libXrandr
+, ffmpeg_3
+}:
+
+mkDerivation rec {
+
+  pname = "vokoscreen";
+  version = "2.5.8-beta";
+
+  src = fetchFromGitHub {
+    owner   = "vkohaupt";
+    repo    = "vokoscreen";
+    rev     = version;
+    sha256  = "1a85vbsi53mhzva49smqwcs61c51wv3ic410nvb9is9nlsbifwan";
+  };
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [
+    alsaLib
+    libv4l
+    qtbase
+    qtmultimedia
+    qttools
+    qtx11extras
+    libXrandr
+  ];
+
+  patches = [
+    ./ffmpeg-out-of-box.patch
+  ];
+
+  preConfigure = ''
+    sed -i 's/lrelease-qt5/lrelease/g' vokoscreen.pro
+  '';
+
+  postConfigure = ''
+    substituteInPlace settings/QvkSettings.cpp --subst-var-by ffmpeg ${ffmpeg_3}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Simple GUI screencast recorder, using ffmpeg";
+    homepage = "https://linuxecke.volkoh.de/vokoscreen/vokoscreen.html";
+    longDescription = ''
+      vokoscreen is an easy to use screencast creator to record
+      educational videos, live recordings of browser, installation,
+      videoconferences, etc.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.league ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/vokoscreen/ffmpeg-out-of-box.patch b/nixpkgs/pkgs/applications/video/vokoscreen/ffmpeg-out-of-box.patch
new file mode 100644
index 000000000000..afcee3f9715f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/vokoscreen/ffmpeg-out-of-box.patch
@@ -0,0 +1,24 @@
+diff --git a/settings/QvkSettings.cpp b/settings/QvkSettings.cpp
+index 3008e62..07485bd 100644
+--- a/settings/QvkSettings.cpp
++++ b/settings/QvkSettings.cpp
+@@ -66,17 +66,8 @@ void QvkSettings::readAll()
+       Minimized = settings.value( "Minimized", 0 ).toUInt();
+       MinimizedByStart = settings.value( "MinimizedByStart", 0 ).toUInt();
+       Countdown = settings.value( "Countdown", 0 ).toUInt();
+-      QFile file;
+-      if ( file.exists( qApp->applicationDirPath().append( "/bin/ffmpeg" ) ) == true )
+-      {
+-        vokoscreenWithLibs = true;
+-        Recorder = qApp->applicationDirPath().append( "/bin/ffmpeg" );
+-      }
+-      else
+-      {
+-        vokoscreenWithLibs = false;
+-        Recorder = settings.value( "Recorder", "ffmpeg" ).toString();
+-      }
++      vokoscreenWithLibs = true;
++      Recorder = settings.value( "Recorder", "@ffmpeg@/bin/ffmpeg" ).toString();
+     settings.endGroup();
+     
+     settings.beginGroup( "Videooptions" );
diff --git a/nixpkgs/pkgs/applications/video/w_scan/default.nix b/nixpkgs/pkgs/applications/video/w_scan/default.nix
new file mode 100644
index 000000000000..7710c7d67a31
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/w_scan/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "w_scan";
+  version = "20170107";
+
+  src = fetchurl {
+    url = "http://wirbel.htpc-forum.de/w_scan/${pname}-${version}.tar.bz2";
+    sha256 = "1zkgnj2sfvckix360wwk1v5s43g69snm45m0drnzyv7hgf5g7q1q";
+  };
+
+  meta = {
+    description = "Small CLI utility to scan DVB and ATSC transmissions";
+    homepage = "http://wirbel.htpc-forum.de/w_scan/index_en.html";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.nico202 ] ;
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/webcamoid/default.nix b/nixpkgs/pkgs/applications/video/webcamoid/default.nix
new file mode 100644
index 000000000000..41304c21ac30
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/webcamoid/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libxcb, mkDerivation, qmake
+, qtbase, qtdeclarative, qtquickcontrols, qtquickcontrols2
+, ffmpeg-full, gstreamer, gst_all_1, libpulseaudio, alsaLib, jack2
+, v4l-utils }:
+mkDerivation rec {
+  pname = "webcamoid";
+  version = "8.7.1";
+
+  src = fetchFromGitHub {
+    sha256 = "1d8g7mq0wf0ycds87xpdhr3zkljgjmb94n3ak9kkxj2fqp9242d2";
+    rev = version;
+    repo = "webcamoid";
+    owner = "webcamoid";
+  };
+
+  buildInputs = [
+    libxcb
+    qtbase qtdeclarative qtquickcontrols qtquickcontrols2
+    ffmpeg-full
+    gstreamer gst_all_1.gst-plugins-base
+    alsaLib libpulseaudio jack2
+    v4l-utils
+  ];
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+
+  qmakeFlags = [
+    "Webcamoid.pro"
+    "INSTALLQMLDIR=${placeholder "out"}/lib/qt/qml"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Webcam Capture Software";
+    longDescription = "Webcamoid is a full featured and multiplatform webcam suite.";
+    homepage = "https://github.com/webcamoid/webcamoid/";
+    license = [ licenses.gpl3Plus ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ robaca ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix b/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix
new file mode 100644
index 000000000000..24c17daa759d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/webtorrent_desktop/default.nix
@@ -0,0 +1,88 @@
+{
+  alsaLib, atk, cairo, cups, dbus, dpkg, expat, fetchurl, fontconfig, freetype,
+  gdk-pixbuf, glib, gnome2, libX11, libXScrnSaver, libXcomposite, libXcursor,
+  libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst,
+  libxcb, nspr, nss, stdenv, udev
+}:
+
+  let
+    rpath = stdenv.lib.makeLibraryPath ([
+    alsaLib
+    atk
+    cairo
+    cups
+    dbus
+    expat
+    fontconfig
+    freetype
+    gdk-pixbuf
+    glib
+    gnome2.GConf
+    gnome2.gtk
+    gnome2.pango
+    libX11
+    libXScrnSaver
+    libXcomposite
+    libXcursor
+    libXdamage
+    libXext
+    libXfixes
+    libXi
+    libXrandr
+    libXrender
+    libXtst
+    libxcb
+    nspr
+    nss
+    stdenv.cc.cc
+    udev
+    ]);
+  in stdenv.mkDerivation rec {
+    pname = "webtorrent-desktop";
+    version = "0.20.0";
+
+    src =
+      if stdenv.hostPlatform.system == "x86_64-linux" then
+        fetchurl {
+          url = "https://github.com/webtorrent/webtorrent-desktop/releases/download/v0.20.0/webtorrent-desktop_${version}-1_amd64.deb";
+          sha256 = "1kkrnbimiip5pn2nwpln35bbdda9gc3cgrjwphq4fqasbjf2781k";
+        }
+        else
+          throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}";
+    phases = [ "unpackPhase" "installPhase" ];
+    nativeBuildInputs = [ dpkg ];
+    unpackPhase = "dpkg-deb -x $src .";
+    installPhase = ''
+      mkdir -p $out
+      cp -R opt $out
+
+      mv ./usr/share $out/share
+      mv $out/opt/webtorrent-desktop $out/libexec
+      chmod +x $out/libexec/WebTorrent
+      rmdir $out/opt
+
+      chmod -R g-w $out
+
+      # Patch WebTorrent
+      patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+               --set-rpath ${rpath}:$out/libexec $out/libexec/WebTorrent
+
+      # Symlink to bin
+      mkdir -p $out/bin
+      ln -s $out/libexec/WebTorrent $out/bin/WebTorrent
+
+      # Fix the desktop link
+      substituteInPlace $out/share/applications/webtorrent-desktop.desktop \
+        --replace /opt/webtorrent-desktop $out/bin
+    '';
+
+    meta = with stdenv.lib; {
+      description = "Streaming torrent app for Mac, Windows, and Linux.";
+      homepage = "https://webtorrent.io/desktop";
+      license = licenses.mit;
+      maintainers = [ maintainers.flokli ];
+      platforms = [
+        "x86_64-linux"
+      ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/video/wf-recorder/default.nix b/nixpkgs/pkgs/applications/video/wf-recorder/default.nix
new file mode 100644
index 000000000000..09b67149f5a9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/wf-recorder/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland, scdoc
+, wayland-protocols, ffmpeg, x264, libpulseaudio, ocl-icd, opencl-headers
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wf-recorder";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "ammen99";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1cw6kpcbl33wh95pvy32xrsrm6kkk1awccr3phyh885xjs3b3iim";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config wayland scdoc ];
+  buildInputs = [
+    wayland-protocols ffmpeg x264 libpulseaudio ocl-icd opencl-headers
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Utility program for screen recording of wlroots-based compositors";
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/ammen99/wf-recorder/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ primeos CrazedProgrammer ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/wxcam/default.nix b/nixpkgs/pkgs/applications/video/wxcam/default.nix
new file mode 100644
index 000000000000..32712d5b9b07
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/wxcam/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl
+, pkgconfig
+, intltool
+, libX11, libXv, libSM
+, gtk, libglade
+, wxGTK
+, perlPackages
+, xvidcore
+, mjpegtools
+, alsaLib
+, libv4l
+, cimg }:
+
+stdenv.mkDerivation rec {
+
+  pname = "wxcam";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/wxcam/wxcam/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1765bvc65fpzn9ycnnj5hais9xkx9v0sm6a878d35x54bpanr859";
+  };
+
+  buildInputs = with stdenv.lib;
+  [ pkgconfig intltool libX11 libXv libSM gtk libglade wxGTK perlPackages.XMLParser xvidcore mjpegtools alsaLib libv4l cimg ];
+
+  NIX_CFLAGS_COMPILE="-I ${cimg}/include/cimg";
+
+  postUnpack = ''
+    sed -ie 's|/usr/share/|'"$out/share/"'|g' $sourceRoot/Makefile.in
+  '';
+
+  installPhase = ''
+    make install prefix="$out" wxcamdocdir="$out/share/doc/wxcam"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An open-source, wxGTK-based webcam app for Linux";
+    longDescription = ''
+    wxCam is a webcam application for linux. It supports video recording
+    (avi uncompressed and Xvid formats), snapshot taking, and some special
+    commands for philips webcams, so you can also use it for astronomy purposes.
+    It supports both video4linux 1 and 2 drivers,
+    so it should work on a very large number of devices.
+    '';
+    homepage = "http://wxcam.sourceforge.net/";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/xawtv/default.nix b/nixpkgs/pkgs/applications/video/xawtv/default.nix
new file mode 100644
index 000000000000..a82ea0444073
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/xawtv/default.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, fetchurl
+, ncurses
+, libjpeg
+, libX11
+, libXt
+, alsaLib
+, aalib
+, libXft
+, xorgproto
+, libv4l
+, libFS
+, libXaw
+, libXpm
+, libXext
+, libSM
+, libICE
+, perl
+}:
+
+stdenv.mkDerivation rec {
+  name = "xawtv-3.107";
+
+  src = fetchurl {
+    url = "https://linuxtv.org/downloads/xawtv/${name}.tar.bz2";
+    sha256 = "055p0wia0xsj073l8mg4ifa6m81dmv6p45qyh99brramq5iylfy5";
+  };
+
+  buildInputs = [
+    ncurses
+    libjpeg
+    libX11
+    libXt
+    libXft
+    xorgproto
+    libFS
+    perl
+    alsaLib
+    aalib
+    libXaw
+    libXpm
+    libXext
+    libSM
+    libICE
+    libv4l
+  ];
+
+  makeFlags = [
+    "SUID_ROOT=" # do not try to setuid
+    "resdir=${placeholder ''out''}/share/X11"
+  ];
+
+  meta = {
+    description = "TV application for Linux with apps and tools such as a teletext browser";
+    license = stdenv.lib.licenses.gpl2;
+    homepage = "https://www.kraxel.org/blog/linux/xawtv/";
+    maintainers = with stdenv.lib.maintainers; [ domenkozar ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/xine-ui/default.nix b/nixpkgs/pkgs/applications/video/xine-ui/default.nix
new file mode 100644
index 000000000000..f52db04928a4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/xine-ui/default.nix
@@ -0,0 +1,34 @@
+{stdenv, fetchurl, pkgconfig, xorg, libpng, xineLib, readline, ncurses, curl
+, lirc, shared-mime-info, libjpeg }:
+
+stdenv.mkDerivation rec {
+  name = "xine-ui-0.99.12";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xine/${name}.tar.xz";
+    sha256 = "10zmmss3hm8gjjyra20qhdc0lb1m6sym2nb2w62bmfk8isfw9gsl";
+  };
+
+  nativeBuildInputs = [ pkgconfig shared-mime-info ];
+
+  buildInputs =
+    [ xineLib libpng readline ncurses curl lirc libjpeg
+      xorg.xlibsWrapper xorg.libXext xorg.libXv xorg.libXxf86vm xorg.libXtst xorg.xorgproto
+      xorg.libXinerama xorg.libXi xorg.libXft
+    ];
+
+  patchPhase = ''sed -e '/curl\/types\.h/d' -i src/xitk/download.c'';
+
+  configureFlags = [ "--with-readline=${readline.dev}" ];
+
+  LIRC_CFLAGS="-I${lirc}/include";
+  LIRC_LIBS="-L ${lirc}/lib -llirc_client";
+#NIX_LDFLAGS = "-lXext -lgcc_s";
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.xine-project.org/";
+    description = "Xlib-based interface to Xine, a video player";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/xscast/default.nix b/nixpkgs/pkgs/applications/video/xscast/default.nix
new file mode 100644
index 000000000000..f9e6a3d6521f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/xscast/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, makeWrapper, ffmpeg_3, imagemagick, dzen2, xorg }:
+
+stdenv.mkDerivation {
+  pname = "xscast-unstable";
+  version = "2016-07-26";
+
+  src = fetchFromGitHub {
+    owner = "KeyboardFire";
+    repo = "xscast";
+    rev = "9e6fd3c28d3f5ae630619f6dbccaf1f6ca594b21";
+    sha256 = "0br27bq9bpglfdpv63h827bipgvhlh10liyhmhcxls4227kagz72";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 xscast.sh $out/bin/xscast
+    install -Dm644 xscast.1 $out/share/man/man1/xscast.1
+    patchShebangs $out/bin
+
+    wrapProgram "$out/bin/xscast" \
+      --prefix PATH : ${stdenv.lib.makeBinPath [ ffmpeg_3 dzen2 xorg.xwininfo xorg.xinput xorg.xmodmap imagemagick ]}
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/KeyboardFire/xscast";
+    license = licenses.mit;
+    description = "Screencasts of windows with list of keystrokes overlayed";
+    maintainers = with maintainers; [ ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/xvidcap/default.nix b/nixpkgs/pkgs/applications/video/xvidcap/default.nix
new file mode 100644
index 000000000000..20d4d84741cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/xvidcap/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, perlPackages, pkgconfig, gtk2
+, scrollkeeper, libglade, libXmu, libX11, libXext, gettext
+, lame, libXfixes, libXdamage }:
+
+stdenv.mkDerivation {
+  name = "xvidcap-1.1.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xvidcap/xvidcap-1.1.7.tar.gz";
+    sha256 = "0p8rhpyhxgy37crf1xk1046z4p663jg7ww776jw92pld3s024ihm";
+  };
+
+  patches = [ ./xlib.patch ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    gtk2 scrollkeeper
+    libglade libXmu gettext lame libXdamage libXfixes libXext libX11
+  ] ++ (with perlPackages; [ perl XMLParser ]);
+
+  # !!! don't know why this is necessary
+  NIX_LDFLAGS = "-lXext -lX11 -lz -lgcc_s";
+
+  meta = with stdenv.lib; {
+    description = "Screencast video catpuring tool";
+    homepage = "http://xvidcap.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/video/xvidcap/xlib.patch b/nixpkgs/pkgs/applications/video/xvidcap/xlib.patch
new file mode 100644
index 000000000000..eb97854386b2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/video/xvidcap/xlib.patch
@@ -0,0 +1,15 @@
+diff --git a/src/app_data.c b/src/app_data.c
+index 5a44363..482b115 100644
+--- a/src/app_data.c
++++ b/src/app_data.c
+@@ -52,9 +52,9 @@
+ #include <pthread.h>
+ #include <signal.h>
+ 
++#include <X11/Xlib.h>
+ #ifdef HAVE_LIBXFIXES
+ #include <X11/X.h>
+-#include <X11/Xlib.h>
+ #include <X11/Xlibint.h>
+ #include <X11/Xproto.h>
+ #include <X11/Xutil.h>