gnu: youtube-dl: Update to 2016.06.14.
[jackhill/guix/guix.git] / gnu / packages / video.scm
index 980c9ef..b447557 100644 (file)
@@ -1,8 +1,12 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2014, 2015, 2016 David Thompson <davet@gnu.org>
+;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
+;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015 Alex Vong <alexvong1995@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages video)
   #:use-module (ice-9 match)
-  #:use-module ((guix licenses)
-                #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 public-domain
-                               fsf-free))
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system waf)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
-  #:use-module (gnu packages doxygen)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages gnupg)
-  #:use-module (gnu packages gnutls)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages openssl)
+  #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages popt)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages ssh)
-  #:use-module (gnu packages texlive)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages yasm)
   #:use-module (gnu packages zip))
 
+(define-public aalib
+  (package
+    (name "aalib")
+    (version "1.4rc5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/aa-project/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("makeinfo" ,texinfo)))
+    (inputs
+     `(("ncurses" ,ncurses)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+                  (lambda* (#:key build inputs outputs #:allow-other-keys)
+                    ;; This old `configure' script doesn't support
+                    ;; variables passed as arguments.
+                    (let ((out     (assoc-ref outputs "out"))
+                          (ncurses (assoc-ref inputs "ncurses")))
+                      (setenv "CONFIG_SHELL" (which "bash"))
+                      (zero? (system* "./configure"
+                                      (string-append "--prefix=" out)
+                                      (string-append "--build=" build)
+                                      (string-append "--with-ncurses="
+                                                     ncurses)))))))))
+    (home-page "http://aa-project.sourceforge.net/aalib/")
+    (synopsis "ASCII-art library")
+    (description
+     "AA-lib is a low level gfx library which does not require graphics device.
+In fact, there is no graphical output possible.  AA-lib replaces those
+old-fashioned output methods with powerful ascii-art renderer.")
+    (license license:lgpl2.0+)))
+
 (define-public liba52
   (package
     (name "liba52")
     (version "0.7.4")
     (source (origin
               (method url-fetch)
-              (uri (string-append "mirror://sourceforge/liba52/a52dec-"
-                                  version ".tar.gz"))
+              (uri (string-append
+                    ;; A mirror://sourceforge URI doesn't work, presumably
+                    ;; because the SourceForge project is misconfigured.
+                    "http://liba52.sourceforge.net/files/a52dec-" version
+                    ".tar.gz"))
               (sha256
                (base32
-                "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))))
+                "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
+              (patches (search-patches "liba52-enable-pic.patch"
+                                       "liba52-set-soname.patch"
+                                       "liba52-use-mtune-not-mcpu.patch"
+                                       "liba52-link-with-libm.patch"))))
     (build-system gnu-build-system)
+    ;; XXX We need to run ./bootstrap because of the build system fixes above.
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (arguments `(#:configure-flags '("--enable-shared")
+                 #:phases
+                 (modify-phases %standard-phases
+                   ;; XXX We need to run ./bootstrap because of the build
+                   ;; system fixes above.
+                   (add-after
+                    'unpack 'bootstrap
+                    (lambda _ (zero? (system* "sh" "bootstrap")))))))
     (home-page "http://liba52.sourceforge.net/")
     (synopsis "ATSC A/52 stream decoder")
     (description "liba52 is a library for decoding ATSC A/52 streams.  The
 A/52 standard is used in a variety of applications, including digital
 television and DVD.  It is also known as AC-3.")
-    (license gpl2+)))
+    (license license:gpl2+)))
+
+(define-public libmpeg2
+  (package
+    (name "libmpeg2")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              ;; A mirror://sourceforge URI doesn't work, presumably
+              ;; because the SourceForge project is misconfigured.
+              (uri (string-append "http://libmpeg2.sourceforge.net/files/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
+    (inputs
+     `(("libx11" ,libx11)
+       ("libxext" ,libxext)
+       ("libxv" ,libxv)
+       ("libsm" ,libsm)
+       ("libice" ,libice)
+       ("sdl" ,sdl)))
+    (build-system gnu-build-system)
+    (home-page "http://libmpeg2.sourceforge.net/")
+    (synopsis "MPEG1 and MPEG2 video decoder library")
+    (description
+     "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
+    (license license:gpl2+)))
+
+(define-public libx264
+  (package
+    (name "libx264")
+    (version "20160220-2245")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://download.videolan.org/pub/x264/snapshots/"
+                                  "x264-snapshot-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "12zyzbiihfhamf7yi4qqaj6k0nisnrydvfr36kxadvmsm7dg4sj3"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("yasm" ,yasm)))
+    ;; TODO: Add gpac input
+    (arguments
+     `(#:tests? #f  ;no check target
+       #:configure-flags '("--enable-shared"
+                           ;; Don't build the command-line program.  If we
+                           ;; want it later, we should do so in a different
+                           ;; package to avoid a circular dependency (the x264
+                           ;; program depends on ffmpeg and ffmpeg depends on
+                           ;; libx264).
+                           "--disable-cli")))
+    (home-page "http://www.videolan.org/developers/x264.html")
+    (synopsis "H.264 video coding library")
+    (description "libx264 is an advanced encoding library for creating
+H.264 (MPEG-4 AVC) video streams.")
+    (license (list license:gpl2+         ;most files
+                   license:isc           ;common/x86/x86inc.asm
+                   license:lgpl2.1+      ;extras/getopt.c
+                   license:bsd-3         ;extras/inttypes.h
+                   (license:non-copyleft ;extras/cl*.h
+                    "file://extras/cl.h"
+                    "See extras/cl.h in the distribution.")))))
+
+(define-public libass
+  (package
+    (name "libass")
+    (version "0.13.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/libass/libass/releases/download/"
+                    version "/libass-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1kpsw4zw95v4cjvild9wpk73dzavn1khsm3bm32kcz6amnkd166n"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("yasm" ,yasm)))
+    (propagated-inputs
+     `(("freetype" ,freetype)
+       ("fribidi" ,fribidi)
+       ("fontconfig" ,fontconfig)
+       ("harfbuzz" ,harfbuzz)
+       ("enca" ,enca)))
+    (home-page "https://github.com/libass/libass")
+    (synopsis "Subtitle rendering library for the ASS/SSA format")
+    (description "libass is a subtitle rendering library for the
+ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
+    (license license:isc)))
 
 (define-public libcaca
   (package
@@ -114,7 +276,7 @@ television and DVD.  It is also known as AC-3.")
 pixels, so that it can work on older video cards or text terminals.  It
 supports Unicode, 2048 colors, dithering of color images, and advanced text
 canvas operations.")
-    (license (fsf-free "file://COPYING")))) ;WTFPL version 2
+    (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
 
 (define-public libdca
   (package
@@ -133,7 +295,7 @@ canvas operations.")
     (synopsis "DTS Coherent Acoustics decoder")
     (description "libdca is a library for decoding DTS Coherent Acoustics
 streams.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public libdv
   (package
@@ -156,55 +318,191 @@ video, the encoding format used by most digital camcorders, typically those
 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface.  Libdv was
 developed according to the official standards for DV video: IEC 61834 and
 SMPTE 314M.")
-    (license lgpl2.1+)))
+    (license license:lgpl2.1+)))
+
+(define-public libva
+  (package
+    (name "libva")
+    (version "1.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
+             version".tar.bz2"))
+       (sha256
+        (base32 "0bjfb5s8dk3lql843l91ffxzlq47isqks5sj19cxh7j3nhzw58kz"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libdrm" ,libdrm)
+       ("libx11" ,libx11)
+       ("libxext" ,libxext)
+       ("libxfixes" ,libxfixes)
+       ("mesa" ,mesa)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before
+          'build 'fix-dlopen-paths
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              (substitute* "va/drm/va_drm_auth_x11.c"
+                (("\"libva-x11\\.so\\.%d\"")
+                 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
+       ;; Most drivers are in mesa's $prefix/lib/dri, so use that.  (Can be
+       ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
+       #:configure-flags
+       (list (string-append "--with-drivers-path="
+                            (assoc-ref %build-inputs "mesa") "/lib/dri"))
+       ;; However, we can't write to mesa's store directory, so override the
+       ;; following make variable to install the dummy driver to libva's
+       ;; $prefix/lib/dri directory.
+       #:make-flags
+       (list (string-append "dummy_drv_video_ladir="
+                            (assoc-ref %outputs "out") "/lib/dri"))))
+    (home-page "http://www.freedesktop.org/wiki/Software/vaapi/")
+    (synopsis "Video acceleration library")
+    (description "The main motivation for VA-API (Video Acceleration API) is
+to enable hardware accelerated video decode/encode at various
+entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
+standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
+    (license license:expat)))
 
 (define-public ffmpeg
   (package
     (name "ffmpeg")
-    (version "2.5.4")
+    (version "3.0.2")
     (source (origin
              (method url-fetch)
-             (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
-                                 version ".tar.bz2"))
+             (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
+                                 version ".tar.xz"))
              (sha256
               (base32
-               "11m2hbhdgphjxjp6hk438cxmipqjg5ixbr1kqnn9mbdhq9kc34fc"))))
+               "08sjp4dxgcinmv9ly7nm24swmn2cnbbhvph44ihlplf4n33kr542"))))
     (build-system gnu-build-system)
     (inputs
      `(("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
+       ("gnutls" ,gnutls)
        ("opus" ,opus)
+       ("ladspa" ,ladspa)
        ("lame" ,lame)
+       ("libass" ,libass)
        ("libbluray" ,libbluray)
        ("libcaca" ,libcaca)
+       ("libcdio-paranoia" ,libcdio-paranoia)
        ("libtheora" ,libtheora)
+       ("libvdpau" ,libvdpau)
        ("libvorbis" ,libvorbis)
        ("libvpx" ,libvpx)
-       ("patchelf" ,patchelf)
+       ("libx11" ,libx11)
+       ("libx264" ,libx264)
+       ("mesa" ,mesa)
+       ("openal" ,openal)
+       ("pulseaudio" ,pulseaudio)
        ("soxr" ,soxr)
        ("speex" ,speex)
        ("twolame" ,twolame)
        ("xvid" ,xvid)
-       ("zlib"zlib)))
+       ("zlib" ,zlib)))
     (native-inputs
      `(("bc" ,bc)
-       ("bzip2" ,bzip2)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
+       ("texinfo" ,texinfo)
        ("python" ,python-2) ; scripts use interpreter python2
        ("speex" ,speex)
        ("yasm" ,yasm)))
     (arguments
      `(#:test-target "fate"
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (guix build rpath)
-                  (srfi srfi-26))
-       #:imported-modules ((guix build gnu-build-system)
-                           (guix build utils)
-                           (guix build rpath))
+       #:configure-flags
+       ;; possible additional inputs:
+       ;;   --enable-avisynth        enable reading of AviSynth script
+       ;;                            files [no]
+       ;;   --enable-frei0r          enable frei0r video filtering
+       ;;   --enable-libaacplus      enable AAC+ encoding via libaacplus [no]
+       ;;   --enable-libcelt         enable CELT decoding via libcelt [no]
+       ;;   --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394
+       ;;                            and libraw1394 [no]
+       ;;   --enable-libfaac         enable AAC encoding via libfaac [no]
+       ;;   --enable-libfdk-aac      enable AAC de/encoding via libfdk-aac [no]
+       ;;   --enable-libflite        enable flite (voice synthesis) support via
+       ;;                            libflite [no]
+       ;;   --enable-libgme          enable Game Music Emu via libgme [no]
+       ;;   --enable-libgsm          enable GSM de/encoding via libgsm [no]
+       ;;   --enable-libiec61883     enable iec61883 via libiec61883 [no]
+       ;;   --enable-libilbc         enable iLBC de/encoding via libilbc [no]
+       ;;   --enable-libmodplug      enable ModPlug via libmodplug [no]
+       ;;   --enable-libnut          enable NUT (de)muxing via libnut,
+       ;;                            native (de)muxer exists [no]
+       ;;   --enable-libopencore-amrnb    enable AMR-NB de/encoding via
+       ;;                                 libopencore-amrnb [no]
+       ;;   --enable-libopencore-amrwb    enable AMR-WB decoding via
+       ;;                                 libopencore-amrwb [no]
+       ;;   --enable-libopencv       enable video filtering via libopencv [no]
+       ;;   --enable-libopenjpeg     enable JPEG 2000 de/encoding via
+       ;;                            OpenJPEG [no]
+       ;;   --enable-librtmp         enable RTMP[E] support via librtmp [no]
+       ;;   --enable-libschroedinger enable Dirac de/encoding via
+       ;;                            libschroedinger [no]
+       ;;   --enable-libshine        enable fixed-point MP3 encoding via
+       ;;                            libshine [no]
+       ;;   --enable-libssh          enable SFTP protocol via libssh [no]
+       ;;                            (libssh2 does not work)
+       ;;   --enable-libstagefright-h264  enable H.264 decoding via
+       ;;                                 libstagefright [no]
+       ;;   --enable-libutvideo      enable Ut Video encoding and decoding via
+       ;;                            libutvideo [no]
+       ;;   --enable-libv4l2         enable libv4l2/v4l-utils [no]
+       ;;   --enable-libvidstab      enable video stabilization using
+       ;;                            vid.stab [no]
+       ;;   --enable-libvo-aacenc    enable AAC encoding via libvo-aacenc [no]
+       ;;   --enable-libvo-amrwbenc  enable AMR-WB encoding via
+       ;;                            libvo-amrwbenc [no]
+       ;;   --enable-libwavpack      enable wavpack encoding via libwavpack [no]
+       ;;   --enable-libxavs         enable AVS encoding via xavs [no]
+       ;;   --enable-libzmq          enable message passing via libzmq [no]
+       ;;   --enable-libzvbi         enable teletext support via libzvbi [no]
+       ;;   --enable-opencl          enable OpenCL code
+       '("--enable-avresample"
+         "--enable-gpl" ; enable optional gpl licensed parts
+         "--enable-shared"
+         "--enable-fontconfig"
+         "--enable-gnutls"
+         "--enable-ladspa"
+         "--enable-libass"
+         "--enable-libbluray"
+         "--enable-libcaca"
+         "--enable-libcdio"
+         "--enable-libfreetype"
+         "--enable-libmp3lame"
+         "--enable-libopus"
+         "--enable-libpulse"
+         "--enable-libsoxr"
+         "--enable-libspeex"
+         "--enable-libtheora"
+         "--enable-libtwolame"
+         "--enable-libvorbis"
+         "--enable-libvpx"
+         "--enable-libxvid"
+         "--enable-libx264"
+         "--enable-openal"
+         "--enable-opengl"
+         "--enable-x11grab"
+
+         "--enable-runtime-cpudetect"
+
+         ;; Runtime cpu detection is not implemented on
+         ;; MIPS, so we disable some features.
+         "--disable-mips32r2"
+         "--disable-mipsdsp"
+         "--disable-mipsdspr2"
+         "--disable-mipsfpu")
        #:phases
-         (alist-replace
+       (modify-phases %standard-phases
+         (replace
           'configure
           ;; configure does not work followed by "SHELL=..." and
           ;; "CONFIG_SHELL=..."; set environment variables instead
@@ -214,121 +512,69 @@ SMPTE 314M.")
                 (("#! /bin/sh") (string-append "#!" (which "bash"))))
               (setenv "SHELL" (which "bash"))
               (setenv "CONFIG_SHELL" (which "bash"))
-;; possible additional inputs:
-;;   --enable-avisynth        enable reading of AviSynth script files [no]
-;;   --enable-frei0r          enable frei0r video filtering
-;;   --enable-ladspa          enable LADSPA audio filtering
-;;   --enable-libaacplus      enable AAC+ encoding via libaacplus [no]
-;;   --enable-libass          enable libass subtitles rendering [no]
-;;   --enable-libcelt         enable CELT decoding via libcelt [no]
-;;   --enable-libcdio         enable audio CD grabbing with libcdio
-;;   --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394
-;;                            and libraw1394 [no]
-;;   --enable-libfaac         enable AAC encoding via libfaac [no]
-;;   --enable-libfdk-aac      enable AAC de/encoding via libfdk-aac [no]
-;;   --enable-libflite        enable flite (voice synthesis) support via libflite [no]
-;;   --enable-libgme          enable Game Music Emu via libgme [no]
-;;   --enable-libgsm          enable GSM de/encoding via libgsm [no]
-;;   --enable-libiec61883     enable iec61883 via libiec61883 [no]
-;;   --enable-libilbc         enable iLBC de/encoding via libilbc [no]
-;;   --enable-libmodplug      enable ModPlug via libmodplug [no]
-;;   --enable-libnut          enable NUT (de)muxing via libnut,
-;;                            native (de)muxer exists [no]
-;;   --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
-;;   --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
-;;   --enable-libopencv       enable video filtering via libopencv [no]
-;;   --enable-libopenjpeg     enable JPEG 2000 de/encoding via OpenJPEG [no]
-;;   --enable-libpulse        enable Pulseaudio input via libpulse [no]
-;;   --enable-libquvi         enable quvi input via libquvi [no]
-;;   --enable-librtmp         enable RTMP[E] support via librtmp [no]
-;;   --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
-;;   --enable-libshine        enable fixed-point MP3 encoding via libshine [no]
-;;   --enable-libssh          enable SFTP protocol via libssh [no]
-;;                            (libssh2 does not work)
-;;   --enable-libstagefright-h264  enable H.264 decoding via libstagefright [no]
-;;   --enable-libutvideo      enable Ut Video encoding and decoding via libutvideo [no]
-;;   --enable-libv4l2         enable libv4l2/v4l-utils [no]
-;;   --enable-libvidstab      enable video stabilization using vid.stab [no]
-;;   --enable-libvo-aacenc    enable AAC encoding via libvo-aacenc [no]
-;;   --enable-libvo-amrwbenc  enable AMR-WB encoding via libvo-amrwbenc [no]
-;;   --enable-libwavpack      enable wavpack encoding via libwavpack [no]
-;;   --enable-libx264         enable H.264 encoding via x264 [no]
-;;   --enable-libxavs         enable AVS encoding via xavs [no]
-;;   --enable-libzmq          enable message passing via libzmq [no]
-;;   --enable-libzvbi         enable teletext support via libzvbi [no]
-;;   --enable-openal          enable OpenAL 1.1 capture support [no]
-;;   --enable-opencl          enable OpenCL code
-;;   --enable-x11grab         enable X11 grabbing [no]
-              (zero? (system*
-                      "./configure"
-                      (string-append "--prefix=" out)
-                      "--enable-gpl" ; enable optional gpl licensed parts
-                      "--enable-shared"
-                      "--enable-fontconfig"
-                      ;; "--enable-gnutls" ; causes test failures
-                      "--enable-libbluray"
-                      "--enable-libcaca"
-                      "--enable-libfreetype"
-                      "--enable-libmp3lame"
-                      "--enable-libopus"
-                      "--enable-libsoxr"
-                      "--enable-libspeex"
-                      "--enable-libtheora"
-                      "--enable-libtwolame"
-                      "--enable-libvorbis"
-                      "--enable-libvpx"
-                      "--enable-libxvid"
-
-                      "--enable-runtime-cpudetect"
-
-                      ;; Runtime cpu detection is not implemented on
-                      ;; MIPS, so we disable some features.
-                      "--disable-mips32r2"
-                      "--disable-mipsdspr1"
-                      "--disable-mipsdspr2"
-                      "--disable-mipsfpu"))))
-       (alist-cons-after
-        'strip 'add-lib-to-runpath
-        (lambda* (#:key outputs #:allow-other-keys)
-          (let* ((out (assoc-ref outputs "out"))
-                 (lib (string-append out "/lib")))
-            ;; Add LIB to the RUNPATH of all the executables and libraries.
-            (with-directory-excursion out
-              (for-each (cut augment-rpath <> lib)
-                        (append (find-files "bin" ".*")
-                                (find-files "lib" "\\.so\\..*\\."))))))
-          %standard-phases))))
-    (home-page "http://www.ffmpeg.org/")
+              (zero? (apply system*
+                            "./configure"
+                            (string-append "--prefix=" out)
+                            ;; Add $libdir to the RUNPATH of all the binaries.
+                            (string-append "--extra-ldflags=-Wl,-rpath="
+                                           out "/lib")
+                            configure-flags)))))
+         (add-before
+          'check 'set-ld-library-path
+          (lambda _
+            ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
+            ;; running tests.
+            (let* ((dso  (find-files "." "\\.so$"))
+                   (path (string-join (map dirname dso) ":")))
+              (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
+              (setenv "LD_LIBRARY_PATH" path)
+              #t))))))
+    (home-page "https://www.ffmpeg.org/")
     (synopsis "Audio and video framework")
     (description "FFmpeg is a complete, cross-platform solution to record,
 convert and stream audio and video.  It includes the libavcodec
 audio/video codec library.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
-;; We need this older ffmpeg because vlc-2.1.5 doesn't work with ffmpeg-2.4.
-(define-public ffmpeg-2.2
-  (package (inherit ffmpeg)
-    (version "2.2.13")
+(define-public ffmpeg-2.8
+  (package
+    (inherit ffmpeg)
+    (version "2.8.6")
     (source (origin
              (method url-fetch)
-             (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
-                                 version ".tar.bz2"))
+             (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
+                                 version ".tar.xz"))
              (sha256
               (base32
-               "1vva8ffwxi3rg44byy09qlbiqrrd1h4rmsl5b1mbmvzvwl1lq1l0"))))))
+               "1yh7dvm7zwdlsspdaq524s5qaggma5md9h95qc4kvb5dmyyyvg15"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments ffmpeg)
+       ((#:configure-flags flags)
+        `(map (lambda (flag)
+                (if (string=? flag "--disable-mipsdsp")
+                    "--disable-mipsdspr1"
+                    flag))
+              ,flags))))))
 
 (define-public vlc
   (package
     (name "vlc")
-    (version "2.2.0")
+    (version "2.2.4")
     (source (origin
              (method url-fetch)
              (uri (string-append
-                   "http://download.videolan.org/pub/videolan/vlc/"
+                   "https://download.videolan.org/pub/videolan/vlc/"
                    version "/vlc-" version ".tar.xz"))
              (sha256
               (base32
-               "05smn9hqdp7iscc1dj4cxp1mrlad7b50lhlnlqisfzf493i2f2jy"))))
+               "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn"))
+             (modules '((guix build utils)))
+             (snippet
+              ;; There are two occurrences where __DATE__ and __TIME__ are
+              ;; used to capture the build time and show it to the user.
+              '(substitute* (find-files "." "help\\.c(pp)?$")
+                 (("__DATE__") "\"2016\"")
+                 (("__TIME__") "\"00:00\"")))))
     (build-system gnu-build-system)
     (native-inputs
      `(("git" ,git) ; needed for a test
@@ -339,7 +585,7 @@ audio/video codec library.")
        ("avahi" ,avahi)
        ("dbus" ,dbus)
        ("flac" ,flac)
-       ("ffmpeg" ,ffmpeg-2.2)     ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4
+       ("ffmpeg" ,ffmpeg-2.8)               ;fails to build against ffmpeg 3.0
        ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
        ("gnutls" ,gnutls)
@@ -363,7 +609,8 @@ audio/video codec library.")
        ("perl" ,perl)
        ("pulseaudio" ,pulseaudio)
        ("python" ,python-wrapper)
-       ("qt" ,qt-4)
+       ("qtbase" ,qtbase)
+       ;("qtx11extras" ,qtx11extras)
        ("sdl" ,sdl)
        ("sdl-image" ,sdl-image)
        ("speex" ,speex)
@@ -373,26 +620,56 @@ audio/video codec library.")
        `("--disable-a52" ; FIXME: reenable once available
          ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
                          (assoc-ref %build-inputs "ffmpeg")
-                         "/lib")))) ; needed for the tests
+                         "/lib"))                 ;needed for the tests
+
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'remove-visual-tests
+           ;; Some of the tests require using the display to test out VLC,
+           ;; which fails in our sandboxed build system
+           (lambda _
+             (substitute* "test/run_vlc.sh"
+                          (("./vlc --ignore-config") "echo"))
+             #t))
+         (add-after 'install 'regenerate-plugin-cache
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The 'install-exec-hook' rule in the top-level Makefile.am
+             ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
+             ;; 'vlc-cache-gen'.  This file includes the mtime of the plugins
+             ;; it references.  Thus, we first reset the timestamps of all
+             ;; these files, and then regenerate the cache such that the
+             ;; mtimes it includes are always zero instead of being dependent
+             ;; on the build time.
+             (let* ((out       (assoc-ref outputs "out"))
+                    (pkglibdir (string-append out "/lib/vlc"))
+                    (plugindir (string-append pkglibdir "/plugins"))
+                    (cachegen  (string-append pkglibdir "/vlc-cache-gen")))
+               ;; TODO: Factorize 'reset-timestamps'.
+               (for-each (lambda (file)
+                           (let ((s (lstat file)))
+                             (unless (eq? (stat:type s) 'symlink)
+                               (utime file 0 0 0 0))))
+                         (find-files plugindir))
+               (zero? (system* cachegen plugindir))))))))
     (home-page "https://www.videolan.org/")
     (synopsis "Audio and video framework")
     (description "VLC is a cross-platform multimedia player and framework
 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
 treaming protocols.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public mplayer
   (package
     (name "mplayer")
-    (version "1.1.1")
+    (version "1.3.0")
     (source (origin
              (method url-fetch)
              (uri (string-append
-                   "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
+                   "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
                    version ".tar.xz"))
              (sha256
               (base32
-               "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
+               "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
     (build-system gnu-build-system)
     ;; FIXME: Add additional inputs once available.
     (native-inputs
@@ -400,20 +677,28 @@ treaming protocols.")
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("cdparanoia" ,cdparanoia)
+       ("ffmpeg" ,ffmpeg)
        ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
-       ("lame" ,lame)
-       ("libmpg123" ,mpg123)                      ; audio codec for MP3
 ;;        ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
+       ("lame" ,lame)
+       ("libass" ,libass)
+       ("libdvdcss" ,libdvdcss)
+       ("libdvdnav" ,libdvdnav)
        ("libjpeg" ,libjpeg)
+       ("libmpeg2" ,libmpeg2)
+       ("libmpg123" ,mpg123)                      ; audio codec for MP3
        ("libpng" ,libpng)
        ("libtheora" ,libtheora)
+       ("libvdpau" ,libvdpau)
        ("libvorbis" ,libvorbis)
        ("libx11" ,libx11)
-       ("libxxf86dga" ,libxxf86dga)
+       ("libx264" ,libx264)
        ("libxinerama" ,libxinerama)
        ("libxv" ,libxv)
+       ("libxxf86dga" ,libxxf86dga)
        ("mesa" ,mesa)
+       ("opus" ,opus)
        ("perl" ,perl)
        ("pulseaudio" ,pulseaudio)
        ("python" ,python-wrapper)
@@ -424,8 +709,8 @@ treaming protocols.")
     (arguments
      `(#:tests? #f ; no test target
        #:phases
-         (alist-replace
-          'configure
+       (modify-phases %standard-phases
+        (replace 'configure
           ;; configure does not work followed by "SHELL=..." and
           ;; "CONFIG_SHELL=..."; set environment variables instead
           (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -439,7 +724,7 @@ treaming protocols.")
                       "./configure"
                       (string-append "--extra-cflags=-I"
                                      libx11 "/include") ; to detect libx11
-                      "--disable-tremor-internal" ; forces external libvorbis
+                      "--disable-ffmpeg_a" ; disables bundled ffmpeg
                       (string-append "--prefix=" out)
                       ;; Enable runtime cpu detection where supported,
                       ;; and choose a suitable target.
@@ -452,101 +737,180 @@ treaming protocols.")
                            '("--enable-runtime-cpudetection"
                              "--target=i686-linux"))
                           ("mips64el-linux"
-                           '("--target=mips3-linux")))
-                      "--disable-armv5te"
-                      "--disable-armv6"
-                      "--disable-armv6t2"
-                      "--disable-armvfp"
-                      "--disable-neon"
-                      "--disable-thumb"
-                      "--disable-iwmmxt"))))
-          %standard-phases)))
-    (home-page "http://www.mplayerhq.hu/design7/news.html")
+                           '("--target=mips3-linux"))
+                          (_ (list (string-append
+                                    "--target="
+                                    (or (%current-target-system)
+                                        (nix-system->gnu-triplet
+                                         (%current-system)))))))
+                      "--disable-iwmmxt"))))))))
+    (home-page "https://www.mplayerhq.hu/design7/news.html")
     (synopsis "Audio and video player")
     (description "MPlayer is a movie player.  It plays most MPEG/VOB, AVI,
 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files.  One can watch VideoCD,
 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
-    (license gpl2)))
+    (license license:gpl2)))
+
+(define-public mpv
+  (package
+    (name "mpv")
+    (version "0.17.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/mpv-player/mpv/archive/v" version
+                    ".tar.gz"))
+              (sha256
+               (base32
+                "0vms3viwqcwl1mrgmf2yy4c69fvv7xpbkyrl693l6zpwynqd4b30"))
+              (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system waf-build-system)
+    (native-inputs
+     `(("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python-docutils" ,python-docutils)))
+    ;; Missing features: libguess, Wayland, V4L2
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("enca" ,enca)
+       ("ffmpeg" ,ffmpeg)
+       ("jack" ,jack-1)
+       ("ladspa" ,ladspa)
+       ("lcms" ,lcms)
+       ("libass" ,libass)
+       ("libbluray" ,libbluray)
+       ("libcaca" ,libcaca)
+       ("libbs2b" ,libbs2b)
+       ("libcdio-paranoia" ,libcdio-paranoia)
+       ("libdvdread" ,libdvdread)
+       ("libdvdnav" ,libdvdnav)
+       ("libjpeg" ,libjpeg)
+       ("libva" ,libva)
+       ("libvdpau" ,libvdpau)
+       ("libx11" ,libx11)
+       ("libxext" ,libxext)
+       ("libxinerama" ,libxinerama)
+       ("libxrandr" ,libxrandr)
+       ("libxscrnsaver" ,libxscrnsaver)
+       ("libxv" ,libxv)
+       ("lua" ,lua)
+       ("mesa" ,mesa)
+       ("mpg123" ,mpg123)
+       ("pulseaudio" ,pulseaudio)
+       ("rsound" ,rsound)
+       ("vapoursynth" ,vapoursynth)
+       ("waf" ,(origin
+                 (method url-fetch)
+                 ;; Keep this in sync with the version in the bootstrap.py
+                 ;; script of the source tarball.
+                 (uri "http://www.freehackers.org/~tnagy/release/waf-1.8.12")
+                 (sha256
+                  (base32
+                   "12y9c352zwliw0zk9jm2lhynsjcf5jy0k1qch1c1av8hnbm2pgq1"))))
+       ("youtube-dl" ,youtube-dl)
+       ("zlib" ,zlib)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before
+          'configure 'setup-waf
+          (lambda* (#:key inputs #:allow-other-keys)
+            (copy-file (assoc-ref inputs "waf") "waf")
+            (setenv "CC" "gcc"))))
+       #:configure-flags (list "--enable-gpl3" "--enable-zsh-comp")
+       ;; No check function defined.
+       #:tests? #f))
+    (home-page "https://mpv.io/")
+    (synopsis "Audio and video player")
+    (description "mpv is a general-purpose audio and video player.  It is a
+fork of mplayer2 and MPlayer.  It shares some features with the former
+projects while introducing many more.")
+    (license license:gpl2+)))
 
 (define-public libvpx
   (package
     (name "libvpx")
-    (version "1.3.0")
+    (version "1.5.0")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
-                                  version ".tar.bz2"))
+              (uri (string-append "http://storage.googleapis.com/"
+                                  "downloads.webmproject.org/releases/webm/"
+                                  name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))
-              (patches
-               (list (search-patch "libvpx-vp9-out-of-bounds-access.patch")
-                     (search-patch "libvpx-fix-ssse3-quantize.patch")
-                     (search-patch "libvpx-fix-armhf-link.patch")))))
+                "15v7qw0ydyxn08ksb6lxn1l51pxgpwgshdwd3275yrr5hs86fv9h"))
+              (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases (alist-replace
-                 'configure
-                 (lambda* (#:key outputs #:allow-other-keys)
-                   (setenv "CONFIG_SHELL" (which "bash"))
-                   (let ((out (assoc-ref outputs "out")))
-                     (zero? (system* "./configure"
-                                     "--enable-shared"
-                                     "--as=yasm"
-                                     ,@(if (and (not (%current-target-system))
-                                                (string-prefix?
-                                                 "armhf-"
-                                                 (%current-system)))
-                                           ;; When building on ARMv7, libvpx
-                                           ;; assumes that NEON will be
-                                           ;; available.  On Guix, armhf
-                                           ;; does not require NEON, so we
-                                           ;; build for ARMv6 and -marm (since
-                                           ;; no thumb2 on ARMv6) to ensure
-                                           ;; compatibility with all ARMv7
-                                           ;; cores we support.  Based on
-                                           ;; the Debian libvpx package.
-                                           '("--target=armv6-linux-gcc"
-                                             "--extra-cflags=-marm"
-                                             "--enable-small")
-                                           '())
-                                     (string-append "--prefix=" out)))))
-                 %standard-phases)
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (setenv "CONFIG_SHELL" (which "bash"))
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "LDFLAGS"
+                       (string-append "-Wl,-rpath=" out "/lib"))
+               (zero? (system* "./configure"
+                               "--enable-shared"
+                               "--as=yasm"
+                               ;; Limit size to avoid CVE-2015-1258
+                               "--size-limit=16384x16384"
+                               (string-append "--prefix=" out)))))))
        #:tests? #f)) ; no check target
     (native-inputs
      `(("perl" ,perl)
        ("yasm" ,yasm)))
     (synopsis "VP8/VP9 video codec")
     (description "libvpx is a codec for the VP8/VP9 video compression format.")
-    (license bsd-3)
+    (license license:bsd-3)
     (home-page "http://www.webmproject.org/")))
 
 (define-public youtube-dl
   (package
     (name "youtube-dl")
-    (version "2015.01.23.4")
+    (version "2016.06.14")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://youtube-dl.org/downloads/"
+              (uri (string-append "https://youtube-dl.org/downloads/"
                                   version "/youtube-dl-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0pvvab9dk1righ3fa79000iz8fzdlcxakscx5sd31730c37j3kj2"))))
+                "0fmvpqipc1xwagvk7ih4slmv1xz1rb6s8wpndhypwvrq4pnnm9ns"))))
     (build-system python-build-system)
-    (inputs `(("setuptools" ,python-setuptools)))
-    (home-page "http://youtube-dl.org")
+    (home-page "https://youtube-dl.org")
+    (arguments
+     ;; The problem here is that the directory for the man page and completion
+     ;; files is relative, and for some reason, setup.py uses the
+     ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
+     ;; So, we need pass the prefix directly.  In addition, make sure the Bash
+     ;; completion file is called 'youtube-dl' rather than
+     ;; 'youtube-dl.bash-completion'.
+     `(#:phases (modify-phases %standard-phases
+                  (add-before 'install 'fix-the-data-directories
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((prefix (assoc-ref outputs "out")))
+                        (mkdir "bash-completion")
+                        (rename-file "youtube-dl.bash-completion"
+                                     "bash-completion/youtube-dl")
+                        (substitute* "setup.py"
+                          (("youtube-dl\\.bash-completion")
+                           "bash-completion/youtube-dl")
+                          (("'etc/")
+                           (string-append "'" prefix "/etc/"))
+                          (("'share/")
+                           (string-append "'" prefix "/share/")))))))))
     (synopsis "Download videos from YouTube.com and other sites")
     (description
-     "youtube-dl is a small command-line program to download videos from
+     "Youtube-dl is a small command-line program to download videos from
 YouTube.com and a few more sites.")
-    (license public-domain)))
+    (license license:public-domain)))
 
 (define-public libbluray
   (package
     (name "libbluray")
-    (version "0.7.0")
+    (version "0.9.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://download.videolan.org/videolan/"
@@ -554,27 +918,25 @@ YouTube.com and a few more sites.")
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "13dngs4b4cv29f6b825dq14n77mfhvk1kjb42axpq494pfgyp6zp"))))
+                "1sp71j4agcsg17g6b85cqz78pn5vknl5pl39rvr6mkib5ps99jgg"))))
     (build-system gnu-build-system)
+    (arguments `(#:configure-flags '("--disable-bdjava")))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("doxygen" ,doxygen)
-       ("fontconfig" ,fontconfig)
+     `(("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
-       ("libxml2" ,libxml2)
-       ("perl" ,perl)                   ;for doxygen
-       ("texlive" ,texlive)))
+       ("libxml2" ,libxml2)))
     (home-page "http://www.videolan.org/developers/libbluray.html")
     (synopsis "Blu-Ray Disc playback library")
     (description
      "libbluray is a library designed for Blu-Ray Disc playback for media
 players, like VLC or MPlayer.")
-    (license lgpl2.1+)))
+    (license license:lgpl2.1+)))
 
 (define-public libdvdread
   (package
     (name "libdvdread")
-    (version "5.0.0")
+    (version "5.0.3")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://download.videolan.org/videolan/"
@@ -582,7 +944,7 @@ players, like VLC or MPlayer.")
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "052z62l3x8ka5jpf5bi1mzp5p323n1z9rxj74nq5c35a88x1myv6"))))
+                "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
     (build-system gnu-build-system)
     (home-page "http://dvdnav.mplayerhq.hu/")
     (synopsis "Library for reading video DVDs")
@@ -592,12 +954,12 @@ disks.  It provides the functionality that is required to access many
 DVDs.  It parses IFO files, reads NAV-blocks, and performs CSS
 authentication and descrambling (if an external libdvdcss library is
 installed).")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public libdvdnav
   (package
     (name "libdvdnav")
-    (version "5.0.1")
+    (version "5.0.3")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://download.videolan.org/videolan/"
@@ -605,7 +967,7 @@ installed).")
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "1ad2lkkiydgwiyqfysra9lkwjv9yqnvcg4hv92hx8qzics1cpcbj"))))
+                "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -624,7 +986,7 @@ a loop regularly calling a function to get the next block, surrounded by
 additional calls to tell the library of user interaction.  The whole
 DVD virtual machine and internal playback states are completely
 encapsulated.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public libdvdnav-4
   (package
@@ -655,22 +1017,22 @@ encapsulated.")
 (define-public libdvdcss
   (package
     (name "libdvdcss")
-    (version "1.3.0")
+    (version "1.4.0")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://download.videolan.org/videolan/"
+              (uri (string-append "http://download.videolan.org/pub/"
                                   name "/" version "/"
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "158k9zagmbk5bkbz96l6lwhh7xcgfcnzflkr4vblskhcab6llhbw"))))
+                "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
     (build-system gnu-build-system)
     (home-page "http://www.videolan.org/developers/libdvdcss.html")
     (synopsis "Library for accessing DVDs as block devices")
     (description
      "libdvdcss is a simple library designed for accessing DVDs like a block
 device without having to bother about the decryption.")
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 (define-public srt2vtt
   (package
@@ -691,12 +1053,12 @@ device without having to bother about the decryption.")
     (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
 for use with HTML5 video.")
     (home-page "http://dthompson.us/pages/software/srt2vtt")
-    (license gpl3+)))
+    (license license:gpl3+)))
 
 (define-public avidemux
   (package
     (name "avidemux")
-    (version "2.6.8")
+    (version "2.6.10")
     (source (origin
              (method url-fetch)
              (uri (string-append
@@ -704,7 +1066,8 @@ for use with HTML5 video.")
                    version ".tar.gz"))
              (sha256
               (base32
-               "10p60wjkzf1bxqcb6i7bx4hbqy3vqg598p3l9lc4v2c9b8iqr682"))))
+               "1vas43bwb15q2wv3dpp7fgp8dc6szinmwl7i0ziq2vv5l2128v0p"))
+             (patches (search-patches "avidemux-install-to-lib.patch"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -715,7 +1078,6 @@ for use with HTML5 video.")
        ("freetype" ,freetype)
        ("fribidi" ,fribidi)
        ("glu" ,glu)
-       ("gtk+" ,gtk+)
        ("jack" ,jack-1)
        ("lame" ,lame)
        ("libvorbis" ,libvorbis)
@@ -724,7 +1086,7 @@ for use with HTML5 video.")
        ("perl" ,perl)
        ("pulseaudio" ,pulseaudio)
        ("python" ,python-wrapper)
-       ("qt" ,qt-4)
+       ("qt" ,qt)
        ("sdl" ,sdl)
        ("sqlite" ,sqlite)
        ("yasm" ,yasm)
@@ -738,26 +1100,29 @@ for use with HTML5 video.")
         'patch-source-shebangs 'unpack-ffmpeg
         (lambda _
           (with-directory-excursion "avidemux_core/ffmpeg_package"
-            (system* "tar" "xf" "ffmpeg-1.2.1.tar.bz2")
-            (delete-file "ffmpeg-1.2.1.tar.bz2")))
+            (system* "tar" "xf" "ffmpeg-2.6.1.tar.bz2")
+            (delete-file "ffmpeg-2.6.1.tar.bz2")))
         (alist-cons-after
          'patch-source-shebangs 'repack-ffmpeg
          (lambda _
            (with-directory-excursion "avidemux_core/ffmpeg_package"
-             (substitute* "ffmpeg-1.2.1/configure"
+             (substitute* "ffmpeg-2.6.1/configure"
                (("#! /bin/sh") (string-append "#!" (which "bash"))))
-             (system* "tar" "cjf" "ffmpeg-1.2.1.tar.bz2" "ffmpeg-1.2.1")
-             (delete-file-recursively "ffmpeg-1.2.1")))
+             (system* "tar" "cjf" "ffmpeg-2.6.1.tar.bz2" "ffmpeg-2.6.1"
+                      ;; avoid non-determinism in the archive
+                      "--sort=name" "--mtime=@0"
+                      "--owner=root:0" "--group=root:0")
+             (delete-file-recursively "ffmpeg-2.6.1")))
          (alist-replace 'configure
           (lambda _
             ;; Copy-paste settings from the cmake build system.
             (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
-            (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH")))
+            (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")))
           (alist-replace 'build
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let*
                 ((out (assoc-ref outputs "out"))
-                 (lib (string-append out "/lib64"))
+                 (lib (string-append out "/lib"))
                  (top (getcwd))
                  (sdl (assoc-ref inputs "sdl"))
                  (build_component
@@ -770,10 +1135,13 @@ for use with HTML5 video.")
                                  "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
                                  (string-append "-DCMAKE_INSTALL_PREFIX=" out)
                                  (string-append "-DCMAKE_INSTALL_RPATH=" lib)
+                                 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
+                                                "\"-Wl,-rpath=" lib "\"")
                                  (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
                                  (string-append "-DSDL_INCLUDE_DIR="
                                                 sdl "/include/SDL")
                                  (string-append "../" srcdir)
+                                 "-DENABLE_QT5=True"
                                  args)
                           (system* "make" "-j"
                                    (number->string (parallel-job-count)))
@@ -782,15 +1150,12 @@ for use with HTML5 video.")
                 (and (build_component "core" "avidemux_core")
                      (build_component "cli" "avidemux/cli")
                      (build_component "qt4" "avidemux/qt4")
-                     (build_component "gtk" "avidemux/gtk")
                      (build_component "plugins_common" "avidemux_plugins"
                                      '("-DPLUGIN_UI=COMMON"))
                      (build_component "plugins_cli" "avidemux_plugins"
                                      '("-DPLUGIN_UI=CLI"))
                      (build_component "plugins_qt4" "avidemux_plugins"
                                      '("-DPLUGIN_UI=QT4"))
-                     (build_component "plugins_gtk" "avidemux_plugins"
-                                     '("-DPLUGIN_UI=GTK"))
                      (build_component "plugins_settings" "avidemux_plugins"
                                      '("-DPLUGIN_UI=SETTINGS")))
                 ;; Remove .exe and .dll file.
@@ -806,102 +1171,55 @@ DVD compatible MPEG files, MP4 and ASF, using a variety of codecs.  Tasks
 can be automated using projects, job queue and powerful scripting
 capabilities.")
     ;; Software with various licenses is included, see License.txt.
-    (license gpl2+)))
+    (license license:gpl2+)))
 
-(define-public avidemux-2.5
-  (package (inherit avidemux)
-    (version "2.5.6")
+(define-public vapoursynth
+  (package
+    (name "vapoursynth")
+    (version "32")
     (source (origin
-             (method url-fetch)
-             (uri (string-append
-                   "mirror://sourceforge/avidemux/avidemux_"
-                   version ".tar.gz"))
-             (sha256
-              (base32
-               "12wvxz0n2g85f079d8mdkkp2zm279d34m9v7qgcqndh48cn7znnn"))))
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/vapoursynth/vapoursynth/archive/R"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32
+                "1j08whj946v2kkpgxsfhpca8xf0ax9iqzn73wvwjx319p9j0ymp9"))))
+    (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("cython" ,python-cython)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python)
+       ("yasm" ,yasm)))
     (inputs
-     `(("alsa-lib" ,alsa-lib)
-       ("gettext" ,gnu-gettext)
-       ("gtk+" ,gtk+-2)
-       ("jack" ,jack-1)
-       ("lame" ,lame)
-       ("libvorbis" ,libvorbis)
-       ("libvpx" ,libvpx)
-       ("libxml2" ,libxml2)
-       ("libxslt" ,libxslt)
-       ("libxv" ,libxv)
-       ("perl" ,perl)
-       ("pulseaudio" ,pulseaudio)
-       ("qt" ,qt-4)
-       ("sdl" ,sdl)
-       ("yasm" ,yasm)
-       ("zlib" ,zlib)))
+     `(("ffmpeg" ,ffmpeg)
+       ("libass" ,libass)
+       ("tesseract-ocr" ,tesseract-ocr)
+       ("zimg" ,zimg)))
     (arguments
-     `(#:tests? #f
-       #:phases
-       (alist-cons-before
-        'patch-source-shebangs 'unpack-ffmpeg
-        (lambda _
-          (with-directory-excursion "avidemux/ADM_libraries"
-            (system* "tar" "xf" "ffmpeg-0.9.tar.bz2")
-            (delete-file "ffmpeg-0.9.tar.bz2")))
-        (alist-cons-after
-         'patch-source-shebangs 'repack-ffmpeg
-         (lambda _
-           (with-directory-excursion "avidemux/ADM_libraries"
-             (substitute* "ffmpeg-0.9/configure"
-               (("#! /bin/sh") (string-append "#!" (which "bash"))))
-             (system* "tar" "cjf" "ffmpeg-0.9.tar.bz2" "ffmpeg-0.9")
-             (delete-file-recursively "ffmpeg-0.9")))
-         (alist-replace 'configure
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after
+          'unpack 'autogen
           (lambda _
-            (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
-            (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH")))
-          (alist-replace 'build
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              (let*
-                ((out (assoc-ref outputs "out"))
-                 (lib (string-append out "/lib"))
-                 (top (getcwd))
-                 (sdl (assoc-ref inputs "sdl"))
-                 (build_component
-                   (lambda* (component srcdir)
-                     (let ((builddir (string-append "build_" component)))
-                       (mkdir builddir)
-                       (with-directory-excursion builddir
-                        (zero? (and
-                          (system* "cmake"
-                                   "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
-                                   (string-append "-DCMAKE_INSTALL_PREFIX="
-                                                  out)
-                                   (string-append "-DCMAKE_INSTALL_RPATH="
-                                                  lib)
-                                   (string-append "-DAVIDEMUX_SOURCE_DIR="
-                                                  top)
-                                   (string-append "-DAVIDEMUX_CORECONFIG_DIR="
-                                                  top "/build_main/config")
-                                   (string-append "-DAVIDEMUX_INSTALL_PREFIX="
-                                                  out)
-                                   (string-append "-DSDL_INCLUDE_DIR="
-                                                  sdl "/include/SDL")
-                                   (string-append "../" srcdir))
-                          (system* "make" "-j"
-                                   (number->string (parallel-job-count)))
-                          (system* "make" "install"))))))))
-                (mkdir out)
-                (and (build_component "main" ".")
-                     (build_component "plugins" "plugins"))
-                (delete-file-recursively
-                  (string-append out "/share/ADM_addons"))))
-            (alist-delete 'install
-               %standard-phases)))))))))
+            (zero? (system* "sh" "autogen.sh")))))))
+    (home-page "http://www.vapoursynth.com/")
+    (synopsis "Video processing framework")
+    (description "VapourSynth is a C++ library and Python module for video
+manipulation.  It aims to be a modern rewrite of Avisynth, supporting
+multithreading, generalized colorspaces, per frame properties, and videos with
+format changes.")
+    ;; As seen from the source files.
+    (license license:lgpl2.1+)))
 
 (define-public xvid
   (package
     (name "xvid")
-    (version "1.3.3")
+    (version "1.3.4")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -909,18 +1227,18 @@ capabilities.")
                     version ".tar.bz2"))
               (sha256
                (base32
-                "0m5g75qvapr7xpywg6a83v5x19kw1nm9l2q48lg7jvvpba0bmqdh"))))
+                "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
     (build-system gnu-build-system)
     (native-inputs `(("yasm" ,yasm)))
     (arguments
      '(#:phases
-       (alist-cons-before
-        'configure 'pre-configure
-        (lambda _
-          (chdir "build/generic")
-          (substitute* "configure"
-            (("#! /bin/sh") (string-append "#!" (which "sh")))))
-        %standard-phases)
+       (modify-phases %standard-phases
+         (add-before
+          'configure 'pre-configure
+          (lambda _
+            (chdir "build/generic")
+            (substitute* "configure"
+              (("#! /bin/sh") (string-append "#!" (which "sh")))))))
        ;; No 'check' target.
        #:tests? #f))
     (home-page "https://www.xvid.com/")
@@ -929,4 +1247,231 @@ capabilities.")
 codec library.  It uses ASP features such as b-frames, global and quarter
 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
 and custom quantization matrices.")
-    (license gpl2+)))
+    (license license:gpl2+)))
+
+(define-public livestreamer
+  (package
+    (name "livestreamer")
+    (version "1.12.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/chrippa/livestreamer/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append "livestreamer-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; tests rely on external web servers
+    (propagated-inputs
+     `(("python-requests" ,python-requests)))
+    (synopsis "Internet video stream viewer")
+    (description "Livestreamer is a command-line utility that extracts streams
+from various services and pipes them into a video playing application.")
+    (home-page "http://livestreamer.io/")
+    (license license:bsd-2)))
+
+(define-public mlt
+  (package
+    (name "mlt")
+    (version "6.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/mltframework/mlt/"
+                                  "archive/v" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1zwzfgxrcbwkxnkiwv0a1rzxdnnaly90yyarl9wdw84nx11ffbnx"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no tests
+       #:make-flags '("CC=gcc")
+       #:configure-flags
+       (list "--enable-gpl3"
+             "--enable-gpl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after
+          'configure 'override-LDFLAGS
+          (lambda* (#:key outputs #:allow-other-keys)
+            (substitute* "config.mak"
+              (("LDFLAGS\\+=")
+               (string-append "LDFLAGS+=-Wl,-rpath="
+                              (assoc-ref outputs "out")
+                              "/lib ")))
+            #t)))))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("fftw" ,fftw)
+       ("libxml2" ,libxml2)
+       ("jack" ,jack-1)
+       ("ladspa" ,ladspa)
+       ("libsamplerate" ,libsamplerate)
+       ("pulseaudio" ,pulseaudio)
+       ("sdl" ,sdl)
+       ("sox" ,sox)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "https://www.mltframework.org/")
+    (synopsis "Author, manage, and run multitrack audio/video compositions")
+    (description
+     "MLT is a multimedia framework, designed and developed for television
+broadcasting.  It provides a toolkit for broadcasters, video editors, media
+players, transcoders, web streamers and many more types of applications.  The
+functionality of the system is provided via an assortment of ready to use
+tools, XML authoring components, and an extensible plug-in based API.")
+    (license license:lgpl2.1+)))
+
+(define-public v4l-utils
+  (package
+    (name "v4l-utils")
+    (version "1.10.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
+                                  "/v4l-utils-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0srkwh3r6f0bkb4kp0d7i0mlmp8babs3qc22cdy1sw4awmzd5skq"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "--with-udevdir="
+                            (assoc-ref %outputs "out")
+                            "/lib/udev"))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("glu" ,glu)
+       ("libjpeg" ,libjpeg)
+       ("libx11" ,libx11)
+       ("qt" ,qt)
+       ("eudev" ,eudev)))
+    (synopsis "Realtime video capture utilities for Linux")
+    (description "The v4l-utils provide a series of libraries and utilities to
+be used for realtime video capture via Linux-specific APIs.")
+    (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
+    ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
+    (license (list license:lgpl2.1+ license:gpl2))))
+
+(define-public obs
+  (package
+    (name "obs")
+    (version "0.14.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/jp9000/obs-studio"
+                                  "/archive/" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1cb8naa67kfnnngkzv1wpd4y241j29ggnk1w7jgnymp9j8dny1xl"))))
+    (build-system cmake-build-system)
+    (arguments '(#:tests? #f)) ; no tests
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("curl" ,curl)
+       ("eudev" ,eudev)
+       ("ffmpeg" ,ffmpeg)
+       ("freetype" ,freetype)
+       ("jack" ,jack-1)
+       ("jansson" ,jansson)
+       ("libx264" ,libx264)
+       ("libxcomposite" ,libxcomposite)
+       ("mesa" ,mesa)
+       ("pulseaudio" ,pulseaudio)
+       ("qt" ,qt)
+       ("v4l-utils" ,v4l-utils)
+       ("zlib" ,zlib)))
+    (synopsis "Live streaming software")
+    (description "Open Broadcaster Software provides a graphical interface for
+video recording and live streaming.  OBS supports capturing audio and video
+from many input sources such as webcams, X11 (for screencasting), PulseAudio,
+and JACK.")
+    (home-page "https://obsproject.com")
+    (license license:gpl2+)))
+
+(define-public libvdpau
+  (package
+    (name "libvdpau")
+    (version "1.1.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
+                            name "-" version ".tar.bz2"))
+        (sha256
+         (base32
+          "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("dri2proto" ,dri2proto)
+       ("libx11" ,libx11 "out")
+       ("libxext" ,libxext)))
+    (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
+    (synopsis "Video Decode and Presentation API")
+    (description "VDPAU is the Video Decode and Presentation API for UNIX.  It
+provides an interface to video decode acceleration and presentation hardware
+present in modern GPUs.")
+    (license (license:x11-style "file://COPYING"))))
+
+(define-public vdpauinfo
+  (package
+    (name "vdpauinfo")
+    (version "1.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
+                            name "-" version ".tar.gz"))
+        (sha256
+         (base32
+          "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("libx11" ,libx11)))
+    (propagated-inputs
+     `(("libvdpau" ,libvdpau)))
+    (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
+    (synopsis "Tool to query the capabilities of a VDPAU implementation")
+    (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
+implementation.")
+    (license (license:x11-style "file://COPYING"))))
+
+(define-public recordmydesktop
+  (package
+    (name "recordmydesktop")
+    (version "0.3.8.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/" name "/"
+                                  version "/recordmydesktop-" version ".tar.gz"))
+              (sha256
+               (base32
+                "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
+    (build-system gnu-build-system)
+    (inputs `(("popt" ,popt)
+              ("zlib" ,zlib)
+              ("libx11" ,libx11)
+              ("libice" ,libice)
+              ("libsm" ,libsm)
+              ("libxfixes" ,libxfixes)
+              ("libxdamage" ,libxdamage)
+              ("libxext" ,libxext)
+              ("libvorbis" ,libvorbis)
+              ("libtheora" ,libtheora)))
+    (home-page "http://recordmydesktop.sourceforge.net/")
+    (synopsis "Desktop session video recorder")
+    (description
+     "recordMyDesktop is a command-line tool that captures the activity in
+your graphical desktop and encodes it as a video.  This is a useful tool for
+making @dfn{screencasts}.")
+    (license license:gpl2+)))