1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2016 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Alex Vong <alexvong1995@gmail.com>
10 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages video)
28 #:use-module (ice-9 match)
29 #:use-module (srfi srfi-1)
30 #:use-module (srfi srfi-26)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system glib-or-gtk)
39 #:use-module (guix build-system python)
40 #:use-module (guix build-system waf)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages audio)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages avahi)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages cdrom)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages databases)
51 #:use-module (gnu packages elf)
52 #:use-module (gnu packages fontutils)
53 #:use-module (gnu packages fribidi)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages guile)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages mp3)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages ocr)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages popt)
70 #:use-module (gnu packages pulseaudio)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages qt)
73 #:use-module (gnu packages sdl)
74 #:use-module (gnu packages ssh)
75 #:use-module (gnu packages texinfo)
76 #:use-module (gnu packages textutils)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages version-control)
79 #:use-module (gnu packages web)
80 #:use-module (gnu packages xdisorg)
81 #:use-module (gnu packages xiph)
82 #:use-module (gnu packages xml)
83 #:use-module (gnu packages xorg)
84 #:use-module (gnu packages assembly)
85 #:use-module (gnu packages zip))
93 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
94 version "/" name "-" version ".tar.gz"))
97 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
98 (build-system gnu-build-system)
100 `(("makeinfo" ,texinfo)))
102 `(("ncurses" ,ncurses)))
105 (modify-phases %standard-phases
107 (lambda* (#:key build inputs outputs #:allow-other-keys)
108 ;; This old `configure' script doesn't support
109 ;; variables passed as arguments.
110 (let ((out (assoc-ref outputs "out"))
111 (ncurses (assoc-ref inputs "ncurses")))
112 (setenv "CONFIG_SHELL" (which "bash"))
113 (zero? (system* "./configure"
114 (string-append "--prefix=" out)
115 (string-append "--build=" build)
116 (string-append "--with-ncurses="
118 (home-page "http://aa-project.sourceforge.net/aalib/")
119 (synopsis "ASCII-art library")
121 "AA-lib is a low level gfx library which does not require graphics device.
122 In fact, there is no graphical output possible. AA-lib replaces those
123 old-fashioned output methods with powerful ascii-art renderer.")
124 (license license:lgpl2.0+)))
126 (define-public liba52
133 ;; A mirror://sourceforge URI doesn't work, presumably
134 ;; because the SourceForge project is misconfigured.
135 "http://liba52.sourceforge.net/files/a52dec-" version
139 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
140 (patches (search-patches "liba52-enable-pic.patch"
141 "liba52-set-soname.patch"
142 "liba52-use-mtune-not-mcpu.patch"
143 "liba52-link-with-libm.patch"))))
144 (build-system gnu-build-system)
145 ;; XXX We need to run ./bootstrap because of the build system fixes above.
147 `(("autoconf" ,autoconf)
148 ("automake" ,automake)
149 ("libtool" ,libtool)))
150 (arguments `(#:configure-flags '("--enable-shared")
152 (modify-phases %standard-phases
153 ;; XXX We need to run ./bootstrap because of the build
154 ;; system fixes above.
157 (lambda _ (zero? (system* "sh" "bootstrap")))))))
158 (home-page "http://liba52.sourceforge.net/")
159 (synopsis "ATSC A/52 stream decoder")
160 (description "liba52 is a library for decoding ATSC A/52 streams. The
161 A/52 standard is used in a variety of applications, including digital
162 television and DVD. It is also known as AC-3.")
163 (license license:gpl2+)))
165 (define-public libmpeg2
171 ;; A mirror://sourceforge URI doesn't work, presumably
172 ;; because the SourceForge project is misconfigured.
173 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
174 name "-" version ".tar.gz"))
177 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
185 (build-system gnu-build-system)
186 (home-page "http://libmpeg2.sourceforge.net/")
187 (synopsis "MPEG1 and MPEG2 video decoder library")
189 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
190 (license license:gpl2+)))
192 (define-public libx264
195 (version "20160220-2245")
198 (uri (string-append "http://download.videolan.org/pub/x264/snapshots/"
199 "x264-snapshot-" version ".tar.bz2"))
202 "12zyzbiihfhamf7yi4qqaj6k0nisnrydvfr36kxadvmsm7dg4sj3"))))
203 (build-system gnu-build-system)
205 `(("pkg-config" ,pkg-config)
207 ;; TODO: Add gpac input
209 `(#:tests? #f ;no check target
210 #:configure-flags '("--enable-shared"
211 ;; Don't build the command-line program. If we
212 ;; want it later, we should do so in a different
213 ;; package to avoid a circular dependency (the x264
214 ;; program depends on ffmpeg and ffmpeg depends on
217 (home-page "http://www.videolan.org/developers/x264.html")
218 (synopsis "H.264 video coding library")
219 (description "libx264 is an advanced encoding library for creating
220 H.264 (MPEG-4 AVC) video streams.")
221 (license (list license:gpl2+ ;most files
222 license:isc ;common/x86/x86inc.asm
223 license:lgpl2.1+ ;extras/getopt.c
224 license:bsd-3 ;extras/inttypes.h
225 (license:non-copyleft ;extras/cl*.h
227 "See extras/cl.h in the distribution.")))))
229 (define-public libass
236 "https://github.com/libass/libass/releases/download/"
237 version "/libass-" version ".tar.xz"))
240 "1kpsw4zw95v4cjvild9wpk73dzavn1khsm3bm32kcz6amnkd166n"))))
241 (build-system gnu-build-system)
243 `(("pkg-config" ,pkg-config)
246 `(("freetype" ,freetype)
248 ("fontconfig" ,fontconfig)
249 ("harfbuzz" ,harfbuzz)
251 (home-page "https://github.com/libass/libass")
252 (synopsis "Subtitle rendering library for the ASS/SSA format")
253 (description "libass is a subtitle rendering library for the
254 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
255 (license license:isc)))
257 (define-public libcaca
260 (version "0.99.beta19")
263 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
267 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
268 (build-system gnu-build-system)
269 (native-inputs `(("pkg-config" ,pkg-config)))
271 `(("freeglut" ,freeglut)
277 (home-page "http://caca.zoy.org/wiki/libcaca")
278 (synopsis "Colour ASCII-art library")
279 (description "libcaca is a graphics library that outputs text instead of
280 pixels, so that it can work on older video cards or text terminals. It
281 supports Unicode, 2048 colors, dithering of color images, and advanced text
283 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
285 (define-public libdca
292 "http://download.videolan.org/pub/videolan/libdca/"
293 version "/libdca-" version ".tar.bz2"))
296 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
297 (build-system gnu-build-system)
298 (home-page "http://www.videolan.org/developers/libdca.html")
299 (synopsis "DTS Coherent Acoustics decoder")
300 (description "libdca is a library for decoding DTS Coherent Acoustics
302 (license license:gpl2+)))
311 "mirror://sourceforge/" name "/" name "/"
312 version "/" name "-" version ".tar.gz"))
315 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
316 (build-system gnu-build-system)
317 (native-inputs `(("pkg-config" ,pkg-config)))
318 (inputs `(("libxv" ,libxv)))
319 (home-page "http://libdv.sourceforge.net/")
320 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
321 (description "The Quasar DV codec (libdv) is a software codec for DV
322 video, the encoding format used by most digital camcorders, typically those
323 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
324 developed according to the official standards for DV video: IEC 61834 and
326 (license license:lgpl2.1+)))
336 "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
339 (base32 "0py9igf4kicj7ji22bjawkpd6my013qpg0s4ir2np9l1rk5vr2d6"))))
340 (build-system gnu-build-system)
342 `(("pkg-config" ,pkg-config)))
347 ("libxfixes" ,libxfixes)
351 (modify-phases %standard-phases
353 'build 'fix-dlopen-paths
354 (lambda* (#:key outputs #:allow-other-keys)
355 (let ((out (assoc-ref outputs "out")))
356 (substitute* "va/drm/va_drm_auth_x11.c"
357 (("\"libva-x11\\.so\\.%d\"")
358 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
359 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
360 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
362 (list (string-append "--with-drivers-path="
363 (assoc-ref %build-inputs "mesa") "/lib/dri"))
364 ;; However, we can't write to mesa's store directory, so override the
365 ;; following make variable to install the dummy driver to libva's
366 ;; $prefix/lib/dri directory.
368 (list (string-append "dummy_drv_video_ladir="
369 (assoc-ref %outputs "out") "/lib/dri"))))
370 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
371 (synopsis "Video acceleration library")
372 (description "The main motivation for VA-API (Video Acceleration API) is
373 to enable hardware accelerated video decode/encode at various
374 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
375 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
376 (license license:expat)))
378 (define-public ffmpeg
384 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
388 "1nris3flwqd4v4b65yrrv9aqhsab7cb9lfp4wpxz6bi0m3r13g3i"))))
389 (build-system gnu-build-system)
391 `(("fontconfig" ,fontconfig)
392 ("freetype" ,freetype)
398 ("libbluray" ,libbluray)
400 ("libcdio-paranoia" ,libcdio-paranoia)
401 ("libtheora" ,libtheora)
402 ("libvdpau" ,libvdpau)
403 ("libvorbis" ,libvorbis)
409 ("pulseaudio" ,pulseaudio)
418 ("pkg-config" ,pkg-config)
420 ("python" ,python-2) ; scripts use interpreter python2
424 `(#:test-target "fate"
426 ;; possible additional inputs:
427 ;; --enable-avisynth enable reading of AviSynth script
429 ;; --enable-frei0r enable frei0r video filtering
430 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
431 ;; --enable-libcelt enable CELT decoding via libcelt [no]
432 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
433 ;; and libraw1394 [no]
434 ;; --enable-libfaac enable AAC encoding via libfaac [no]
435 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
436 ;; --enable-libflite enable flite (voice synthesis) support via
438 ;; --enable-libgme enable Game Music Emu via libgme [no]
439 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
440 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
441 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
442 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
443 ;; --enable-libnut enable NUT (de)muxing via libnut,
444 ;; native (de)muxer exists [no]
445 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
446 ;; libopencore-amrnb [no]
447 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
448 ;; libopencore-amrwb [no]
449 ;; --enable-libopencv enable video filtering via libopencv [no]
450 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
452 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
453 ;; --enable-libschroedinger enable Dirac de/encoding via
454 ;; libschroedinger [no]
455 ;; --enable-libshine enable fixed-point MP3 encoding via
457 ;; --enable-libssh enable SFTP protocol via libssh [no]
458 ;; (libssh2 does not work)
459 ;; --enable-libstagefright-h264 enable H.264 decoding via
460 ;; libstagefright [no]
461 ;; --enable-libutvideo enable Ut Video encoding and decoding via
463 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
464 ;; --enable-libvidstab enable video stabilization using
466 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
467 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
468 ;; libvo-amrwbenc [no]
469 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
470 ;; --enable-libxavs enable AVS encoding via xavs [no]
471 ;; --enable-libzmq enable message passing via libzmq [no]
472 ;; --enable-libzvbi enable teletext support via libzvbi [no]
473 ;; --enable-opencl enable OpenCL code
474 '("--enable-avresample"
475 "--enable-gpl" ; enable optional gpl licensed parts
477 "--enable-fontconfig"
484 "--enable-libfreetype"
485 "--enable-libmp3lame"
491 "--enable-libtwolame"
500 "--enable-runtime-cpudetect"
502 ;; Runtime cpu detection is not implemented on
503 ;; MIPS, so we disable some features.
506 "--disable-mipsdspr2"
509 (modify-phases %standard-phases
512 ;; configure does not work followed by "SHELL=..." and
513 ;; "CONFIG_SHELL=..."; set environment variables instead
514 (lambda* (#:key outputs configure-flags #:allow-other-keys)
515 (let ((out (assoc-ref outputs "out")))
516 (substitute* "configure"
517 (("#! /bin/sh") (string-append "#!" (which "bash"))))
518 (setenv "SHELL" (which "bash"))
519 (setenv "CONFIG_SHELL" (which "bash"))
520 (zero? (apply system*
522 (string-append "--prefix=" out)
523 ;; Add $libdir to the RUNPATH of all the binaries.
524 (string-append "--extra-ldflags=-Wl,-rpath="
528 'check 'set-ld-library-path
530 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
532 (let* ((dso (find-files "." "\\.so$"))
533 (path (string-join (map dirname dso) ":")))
534 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
535 (setenv "LD_LIBRARY_PATH" path)
537 (home-page "https://www.ffmpeg.org/")
538 (synopsis "Audio and video framework")
539 (description "FFmpeg is a complete, cross-platform solution to record,
540 convert and stream audio and video. It includes the libavcodec
541 audio/video codec library.")
542 (license license:gpl2+)))
544 (define-public ffmpeg-2.8
550 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
554 "0z0mcj2q3ysp9qdn1ks03g5sn2zxyr06vxs4al0m4b5b3in8mglp"))))
556 (substitute-keyword-arguments (package-arguments ffmpeg)
557 ((#:configure-flags flags)
559 (if (string=? flag "--disable-mipsdsp")
560 "--disable-mipsdspr1"
571 "https://download.videolan.org/pub/videolan/vlc/"
572 version "/vlc-" version ".tar.xz"))
575 "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn"))
576 (modules '((guix build utils)))
578 ;; There are two occurrences where __DATE__ and __TIME__ are
579 ;; used to capture the build time and show it to the user.
580 '(substitute* (find-files "." "help\\.c(pp)?$")
581 (("__DATE__") "\"2016\"")
582 (("__TIME__") "\"00:00\"")))))
583 (build-system gnu-build-system)
585 `(("git" ,git) ; needed for a test
586 ("pkg-config" ,pkg-config)))
587 ;; FIXME: Add optional inputs once available.
589 `(("alsa-lib" ,alsa-lib)
593 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
594 ("fontconfig" ,fontconfig)
595 ("freetype" ,freetype)
598 ("libgcrypt" ,libgcrypt)
603 ("libsamplerate" ,libsamplerate)
605 ("libvorbis" ,libvorbis)
606 ("libtheora" ,libtheora)
608 ("libxinerama" ,libxinerama)
615 ("pulseaudio" ,pulseaudio)
616 ("python" ,python-wrapper)
618 ;("qtx11extras" ,qtx11extras)
620 ("sdl-image" ,sdl-image)
622 ("xcb-util-keysyms" ,xcb-util-keysyms)))
625 `("--disable-a52" ; FIXME: reenable once available
626 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
627 (assoc-ref %build-inputs "ffmpeg")
628 "/lib")) ;needed for the tests
631 (modify-phases %standard-phases
632 (add-before 'configure 'remove-visual-tests
633 ;; Some of the tests require using the display to test out VLC,
634 ;; which fails in our sandboxed build system
636 (substitute* "test/run_vlc.sh"
637 (("./vlc --ignore-config") "echo"))
639 (add-after 'install 'regenerate-plugin-cache
640 (lambda* (#:key outputs #:allow-other-keys)
641 ;; The 'install-exec-hook' rule in the top-level Makefile.am
642 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
643 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
644 ;; it references. Thus, we first reset the timestamps of all
645 ;; these files, and then regenerate the cache such that the
646 ;; mtimes it includes are always zero instead of being dependent
647 ;; on the build time.
648 (let* ((out (assoc-ref outputs "out"))
649 (pkglibdir (string-append out "/lib/vlc"))
650 (plugindir (string-append pkglibdir "/plugins"))
651 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
652 ;; TODO: Factorize 'reset-timestamps'.
653 (for-each (lambda (file)
654 (let ((s (lstat file)))
655 (unless (eq? (stat:type s) 'symlink)
656 (utime file 0 0 0 0))))
657 (find-files plugindir))
658 (zero? (system* cachegen plugindir))))))))
659 (home-page "https://www.videolan.org/")
660 (synopsis "Audio and video framework")
661 (description "VLC is a cross-platform multimedia player and framework
662 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
663 treaming protocols.")
664 (license license:gpl2+)))
666 (define-public mplayer
673 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
677 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
678 (build-system gnu-build-system)
679 ;; FIXME: Add additional inputs once available.
681 `(("pkg-config" ,pkg-config)))
683 `(("alsa-lib" ,alsa-lib)
684 ("cdparanoia" ,cdparanoia)
686 ("fontconfig" ,fontconfig)
687 ("freetype" ,freetype)
688 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
691 ("libdvdcss" ,libdvdcss)
692 ("libdvdnav" ,libdvdnav)
694 ("libmpeg2" ,libmpeg2)
695 ("libmpg123" ,mpg123) ; audio codec for MP3
697 ("libtheora" ,libtheora)
698 ("libvdpau" ,libvdpau)
699 ("libvorbis" ,libvorbis)
702 ("libxinerama" ,libxinerama)
704 ("libxxf86dga" ,libxxf86dga)
708 ("pulseaudio" ,pulseaudio)
709 ("python" ,python-wrapper)
715 `(#:tests? #f ; no test target
717 (modify-phases %standard-phases
719 ;; configure does not work followed by "SHELL=..." and
720 ;; "CONFIG_SHELL=..."; set environment variables instead
721 (lambda* (#:key inputs outputs #:allow-other-keys)
722 (let ((out (assoc-ref outputs "out"))
723 (libx11 (assoc-ref inputs "libx11")))
724 (substitute* "configure"
725 (("#! /bin/sh") (string-append "#!" (which "bash"))))
726 (setenv "SHELL" (which "bash"))
727 (setenv "CONFIG_SHELL" (which "bash"))
730 (string-append "--extra-cflags=-I"
731 libx11 "/include") ; to detect libx11
732 "--disable-ffmpeg_a" ; disables bundled ffmpeg
733 (string-append "--prefix=" out)
734 ;; Enable runtime cpu detection where supported,
735 ;; and choose a suitable target.
736 ,@(match (or (%current-target-system)
739 '("--enable-runtime-cpudetection"
740 "--target=x86_64-linux"))
742 '("--enable-runtime-cpudetection"
743 "--target=i686-linux"))
745 '("--target=mips3-linux"))
746 (_ (list (string-append
748 (or (%current-target-system)
749 (nix-system->gnu-triplet
750 (%current-system)))))))
751 "--disable-iwmmxt"))))))))
752 (home-page "https://www.mplayerhq.hu/design7/news.html")
753 (synopsis "Audio and video player")
754 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
755 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
756 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
757 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
758 (license license:gpl2)))
767 "https://github.com/mpv-player/mpv/archive/v" version
771 "0az0zqb2rakak51zsvfqzj9a8jiqpvc61jxap8hjdkkb9y6n6mmn"))
772 (file-name (string-append name "-" version ".tar.gz"))))
773 (build-system waf-build-system)
776 ("pkg-config" ,pkg-config)
777 ("python-docutils" ,python-docutils)))
778 ;; Missing features: libguess, Wayland, V4L2
780 `(("alsa-lib" ,alsa-lib)
787 ("libbluray" ,libbluray)
790 ("libcdio-paranoia" ,libcdio-paranoia)
791 ("libdvdread" ,libdvdread)
792 ("libdvdnav" ,libdvdnav)
795 ("libvdpau" ,libvdpau)
798 ("libxinerama" ,libxinerama)
799 ("libxrandr" ,libxrandr)
800 ("libxscrnsaver" ,libxscrnsaver)
805 ("pulseaudio" ,pulseaudio)
807 ("vapoursynth" ,vapoursynth)
809 ("youtube-dl" ,youtube-dl)
813 (modify-phases %standard-phases
815 'configure 'setup-waf
816 (lambda* (#:key inputs #:allow-other-keys)
817 (copy-file (assoc-ref inputs "waf") "waf")
818 (setenv "CC" "gcc"))))
819 #:configure-flags (list "--enable-libmpv-shared" "--enable-zsh-comp")
820 ;; No check function defined.
822 (home-page "https://mpv.io/")
823 (synopsis "Audio and video player")
824 (description "mpv is a general-purpose audio and video player. It is a
825 fork of mplayer2 and MPlayer. It shares some features with the former
826 projects while introducing many more.")
827 (license license:gpl2+)))
829 (define-public gnome-mpv
836 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
837 "/download/v" version "/gnome-mpv-" version
841 "06pgxl6f3kkgxv8nlmyl7gy3pg55sqf8vgr8m6426mlpm4p3qdn0"))))
843 `(("intltool" ,intltool)
844 ("pkg-config" ,pkg-config)))
847 ("libepoxy" ,libepoxy)
849 (build-system glib-or-gtk-build-system)
850 (home-page "https://github.com/gnome-mpv/gnome-mpv")
851 (synopsis "GTK+ frontend for the mpv media player")
852 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
853 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
854 access to mpv's powerful playback capabilities.")
855 (license license:gpl3+)))
857 (define-public libvpx
863 (uri (string-append "http://storage.googleapis.com/"
864 "downloads.webmproject.org/releases/webm/"
865 name "-" version ".tar.bz2"))
868 "15v7qw0ydyxn08ksb6lxn1l51pxgpwgshdwd3275yrr5hs86fv9h"))
869 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
870 (build-system gnu-build-system)
873 (modify-phases %standard-phases
875 (lambda* (#:key outputs #:allow-other-keys)
876 (setenv "CONFIG_SHELL" (which "bash"))
877 (let ((out (assoc-ref outputs "out")))
879 (string-append "-Wl,-rpath=" out "/lib"))
880 (zero? (system* "./configure"
883 ;; Limit size to avoid CVE-2015-1258
884 "--size-limit=16384x16384"
885 (string-append "--prefix=" out)))))))
886 #:tests? #f)) ; no check target
890 (synopsis "VP8/VP9 video codec")
891 (description "libvpx is a codec for the VP8/VP9 video compression format.")
892 (license license:bsd-3)
893 (home-page "http://www.webmproject.org/")))
895 (define-public youtube-dl
898 (version "2016.07.22")
901 (uri (string-append "https://youtube-dl.org/downloads/"
902 version "/youtube-dl-"
906 "02wcxpcbpvsbvyxcnhhf94ma0x5dcg4fygnxxca2h31dp47dkak9"))))
907 (build-system python-build-system)
908 (home-page "https://youtube-dl.org")
910 ;; The problem here is that the directory for the man page and completion
911 ;; files is relative, and for some reason, setup.py uses the
912 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
913 ;; So, we need pass the prefix directly. In addition, make sure the Bash
914 ;; completion file is called 'youtube-dl' rather than
915 ;; 'youtube-dl.bash-completion'.
916 `(#:phases (modify-phases %standard-phases
917 (add-before 'install 'fix-the-data-directories
918 (lambda* (#:key outputs #:allow-other-keys)
919 (let ((prefix (assoc-ref outputs "out")))
920 (mkdir "bash-completion")
921 (rename-file "youtube-dl.bash-completion"
922 "bash-completion/youtube-dl")
923 (substitute* "setup.py"
924 (("youtube-dl\\.bash-completion")
925 "bash-completion/youtube-dl")
927 (string-append "'" prefix "/etc/"))
929 (string-append "'" prefix "/share/")))))))))
930 (synopsis "Download videos from YouTube.com and other sites")
932 "Youtube-dl is a small command-line program to download videos from
933 YouTube.com and a few more sites.")
934 (license license:public-domain)))
936 (define-public libbluray
942 (uri (string-append "https://download.videolan.org/videolan/"
944 name "-" version ".tar.bz2"))
947 "1q1whviqv5sr9nr372h31zwid1rvbfbx3z4lzr8lnj25xha6cdm6"))))
948 (build-system gnu-build-system)
949 (arguments `(#:configure-flags '("--disable-bdjava")))
950 (native-inputs `(("pkg-config" ,pkg-config)))
952 `(("fontconfig" ,fontconfig)
953 ("freetype" ,freetype)
954 ("libxml2" ,libxml2)))
955 (home-page "https://www.videolan.org/developers/libbluray.html")
956 (synopsis "Blu-Ray Disc playback library")
958 "libbluray is a library designed for Blu-Ray Disc playback for media
959 players, like VLC or MPlayer.")
960 (license license:lgpl2.1+)))
962 (define-public libdvdread
968 (uri (string-append "http://download.videolan.org/videolan/"
970 name "-" version ".tar.bz2"))
973 "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
974 (build-system gnu-build-system)
975 (home-page "http://dvdnav.mplayerhq.hu/")
976 (synopsis "Library for reading video DVDs")
978 "Libdvdread provides a simple foundation for reading DVD video
979 disks. It provides the functionality that is required to access many
980 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
981 authentication and descrambling (if an external libdvdcss library is
983 (license license:gpl2+)))
985 (define-public libdvdnav
991 (uri (string-append "http://download.videolan.org/videolan/"
993 name "-" version ".tar.bz2"))
996 "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
997 (build-system gnu-build-system)
999 `(("pkg-config" ,pkg-config)))
1001 `(("libdvdread" ,libdvdread)))
1002 (home-page "http://dvdnav.mplayerhq.hu/")
1003 (synopsis "Library for video DVD navigation features")
1005 "Libdvdnav is a library for developers of multimedia
1006 applications. It allows easy use of sophisticated DVD navigation features
1007 such as DVD menus, multiangle playback and even interactive DVD games. All
1008 this functionality is provided through a simple API which provides the DVD
1009 playback as a single logical stream of blocks, intermitted by special
1010 dvdnav events to report certain conditions. The main usage of libdvdnav is
1011 a loop regularly calling a function to get the next block, surrounded by
1012 additional calls to tell the library of user interaction. The whole
1013 DVD virtual machine and internal playback states are completely
1015 (license license:gpl2+)))
1017 (define-public libdvdnav-4
1025 "http://download.videolan.org/videolan/libdvdnav/libdvdnav-"
1029 "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
1031 `(("pkg-config" ,pkg-config)
1032 ("autoconf" ,autoconf)
1033 ("automake" ,automake)
1034 ("libtool" ,libtool)))
1040 (zero? (system* "autoreconf" "-vif")))
1041 %standard-phases)))))
1043 (define-public libdvdcss
1049 (uri (string-append "http://download.videolan.org/pub/"
1050 name "/" version "/"
1051 name "-" version ".tar.bz2"))
1054 "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
1055 (build-system gnu-build-system)
1056 (home-page "http://www.videolan.org/developers/libdvdcss.html")
1057 (synopsis "Library for accessing DVDs as block devices")
1059 "libdvdcss is a simple library designed for accessing DVDs like a block
1060 device without having to bother about the decryption.")
1061 (license license:gpl2+)))
1063 (define-public srt2vtt
1070 "http://dthompson.us/releases/srt2vtt/srt2vtt-"
1074 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1075 (build-system gnu-build-system)
1077 `(("guile" ,guile-2.0)))
1078 (synopsis "SubRip to WebVTT subtitle converter")
1079 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1080 for use with HTML5 video.")
1081 (home-page "http://dthompson.us/pages/software/srt2vtt")
1082 (license license:gpl3+)))
1084 (define-public avidemux
1091 "mirror://sourceforge/" name "/" name "/" version "/"
1092 name "_" version ".tar.gz"))
1095 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1096 (patches (search-patches "avidemux-install-to-lib.patch"))))
1097 (build-system cmake-build-system)
1099 `(("pkg-config" ,pkg-config)))
1100 ;; FIXME: Once packaged, add libraries not found during the build.
1102 `(("alsa-lib" ,alsa-lib)
1103 ("fontconfig" ,fontconfig)
1104 ("freetype" ,freetype)
1105 ("fribidi" ,fribidi)
1110 ("libvdpau" ,libvdpau)
1111 ("libvorbis" ,libvorbis)
1115 ("pulseaudio" ,pulseaudio)
1116 ("python" ,python-wrapper)
1118 ("qttools" ,qttools)
1124 `(#:tests? #f ; no check target
1126 ;; Make sure files inside the included ffmpeg tarball are
1128 (modify-phases %standard-phases
1129 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1131 (with-directory-excursion "avidemux_core/ffmpeg_package"
1132 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1133 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1134 (add-after 'patch-source-shebangs 'repack-ffmpeg
1136 (with-directory-excursion "avidemux_core/ffmpeg_package"
1137 (substitute* "ffmpeg-2.7.6/configure"
1138 (("#! /bin/sh") (string-append "#!" (which "bash"))))
1139 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1140 ;; avoid non-determinism in the archive
1141 "--sort=name" "--mtime=@0"
1142 "--owner=root:0" "--group=root:0")
1143 (delete-file-recursively "ffmpeg-2.7.6"))))
1146 ;; Copy-paste settings from the cmake build system.
1147 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1148 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1150 (lambda* (#:key inputs outputs #:allow-other-keys)
1152 ((out (assoc-ref outputs "out"))
1153 (lib (string-append out "/lib"))
1155 (sdl (assoc-ref inputs "sdl"))
1157 (lambda* (component srcdir #:optional (args '()))
1158 (let ((builddir (string-append "build_" component)))
1160 (with-directory-excursion builddir
1163 (apply system* "cmake"
1164 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1165 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1166 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1167 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1168 "\"-Wl,-rpath=" lib "\"")
1169 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1170 (string-append "-DSDL_INCLUDE_DIR="
1172 (string-append "../" srcdir)
1175 (system* "make" "-j"
1176 (number->string (parallel-job-count)))
1177 (system* "make" "install"))))))))
1179 (and (build_component "core" "avidemux_core")
1180 (build_component "cli" "avidemux/cli")
1181 (build_component "qt4" "avidemux/qt4")
1182 (build_component "plugins_common" "avidemux_plugins"
1183 '("-DPLUGIN_UI=COMMON"))
1184 (build_component "plugins_cli" "avidemux_plugins"
1185 '("-DPLUGIN_UI=CLI"))
1186 (build_component "plugins_qt4" "avidemux_plugins"
1187 '("-DPLUGIN_UI=QT4"))
1188 (build_component "plugins_settings" "avidemux_plugins"
1189 '("-DPLUGIN_UI=SETTINGS")))
1190 ;; Remove .exe and .dll file.
1191 (delete-file-recursively
1192 (string-append out "/share/ADM6_addons")))))
1193 (delete 'install))))
1194 (home-page "http://fixounet.free.fr/avidemux/")
1195 (synopsis "Video editor")
1196 (description "Avidemux is a video editor designed for simple cutting,
1197 filtering and encoding tasks. It supports many file types, including AVI,
1198 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1199 can be automated using projects, job queue and powerful scripting
1201 ;; Software with various licenses is included, see License.txt.
1202 (license license:gpl2+)))
1204 (define-public vapoursynth
1206 (name "vapoursynth")
1211 "https://github.com/vapoursynth/vapoursynth/archive/R"
1213 (file-name (string-append name "-" version))
1216 "1j08whj946v2kkpgxsfhpca8xf0ax9iqzn73wvwjx319p9j0ymp9"))))
1217 (build-system gnu-build-system)
1219 `(("autoconf" ,autoconf)
1220 ("automake" ,automake)
1221 ("cython" ,python-cython)
1222 ("libtool" ,libtool)
1223 ("pkg-config" ,pkg-config)
1227 `(("ffmpeg" ,ffmpeg)
1229 ("tesseract-ocr" ,tesseract-ocr)
1233 (modify-phases %standard-phases
1237 (zero? (system* "sh" "autogen.sh")))))))
1238 (home-page "http://www.vapoursynth.com/")
1239 (synopsis "Video processing framework")
1240 (description "VapourSynth is a C++ library and Python module for video
1241 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1242 multithreading, generalized colorspaces, per frame properties, and videos with
1244 ;; As seen from the source files.
1245 (license license:lgpl2.1+)))
1254 "http://downloads.xvid.org/downloads/xvidcore-"
1255 version ".tar.bz2"))
1258 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1259 (build-system gnu-build-system)
1260 (native-inputs `(("yasm" ,yasm)))
1263 (modify-phases %standard-phases
1265 'configure 'pre-configure
1267 (chdir "build/generic")
1268 (substitute* "configure"
1269 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1270 ;; No 'check' target.
1272 (home-page "https://www.xvid.com/")
1273 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1274 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1275 codec library. It uses ASP features such as b-frames, global and quarter
1276 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1277 and custom quantization matrices.")
1278 (license license:gpl2+)))
1280 (define-public livestreamer
1282 (name "livestreamer")
1287 "https://github.com/chrippa/livestreamer/archive/v"
1289 (file-name (string-append "livestreamer-" version ".tar.gz"))
1292 "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
1293 (build-system python-build-system)
1295 '(#:tests? #f)) ; tests rely on external web servers
1297 `(("python-requests" ,python-requests)))
1298 (synopsis "Internet video stream viewer")
1299 (description "Livestreamer is a command-line utility that extracts streams
1300 from various services and pipes them into a video playing application.")
1301 (home-page "http://livestreamer.io/")
1302 (license license:bsd-2)))
1310 (uri (string-append "https://github.com/mltframework/mlt/"
1311 "archive/v" version ".tar.gz"))
1312 (file-name (string-append name "-" version ".tar.gz"))
1315 "1zwzfgxrcbwkxnkiwv0a1rzxdnnaly90yyarl9wdw84nx11ffbnx"))))
1316 (build-system gnu-build-system)
1318 `(#:tests? #f ; no tests
1319 #:make-flags '("CC=gcc")
1321 (list "--enable-gpl3"
1324 (modify-phases %standard-phases
1326 'configure 'override-LDFLAGS
1327 (lambda* (#:key outputs #:allow-other-keys)
1328 (substitute* "config.mak"
1330 (string-append "LDFLAGS+=-Wl,-rpath="
1331 (assoc-ref outputs "out")
1335 `(("alsa-lib" ,alsa-lib)
1337 ("libxml2" ,libxml2)
1340 ("libsamplerate" ,libsamplerate)
1341 ("pulseaudio" ,pulseaudio)
1345 `(("pkg-config" ,pkg-config)))
1346 (home-page "https://www.mltframework.org/")
1347 (synopsis "Author, manage, and run multitrack audio/video compositions")
1349 "MLT is a multimedia framework, designed and developed for television
1350 broadcasting. It provides a toolkit for broadcasters, video editors, media
1351 players, transcoders, web streamers and many more types of applications. The
1352 functionality of the system is provided via an assortment of ready to use
1353 tools, XML authoring components, and an extensible plug-in based API.")
1354 (license license:lgpl2.1+)))
1356 (define-public v4l-utils
1362 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1363 "/v4l-utils-" version ".tar.bz2"))
1366 "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1"))))
1367 (build-system gnu-build-system)
1370 (list (string-append "--with-udevdir="
1371 (assoc-ref %outputs "out")
1374 `(("pkg-config" ,pkg-config)))
1376 `(("alsa-lib" ,alsa-lib)
1378 ("libjpeg" ,libjpeg)
1382 (synopsis "Realtime video capture utilities for Linux")
1383 (description "The v4l-utils provide a series of libraries and utilities to
1384 be used for realtime video capture via Linux-specific APIs.")
1385 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1386 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1387 (license (list license:lgpl2.1+ license:gpl2))))
1395 (uri (string-append "https://github.com/jp9000/obs-studio"
1396 "/archive/" version ".tar.gz"))
1397 (file-name (string-append name "-" version ".tar.gz"))
1400 "18fycg7xlj2i89wdb9c5js0bnl964s1lpmnvmfyj11zi9k061wsg"))))
1401 (build-system cmake-build-system)
1403 `(#:tests? #f ; no tests
1404 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1408 (modify-phases %standard-phases
1409 (add-after 'unpack 'remove-architecture-specific-instructions
1410 ;; non-Intel platforms fail to build with the architecture
1411 ;; specific compiler flags included by default.
1413 (substitute* "libobs/CMakeLists.txt"
1414 (("if\\(NOT MSVC\\)") "if(MSVC)"))
1418 `(("pkg-config" ,pkg-config)))
1423 ("freetype" ,freetype)
1425 ("jansson" ,jansson)
1426 ("libx264" ,libx264)
1427 ("libxcomposite" ,libxcomposite)
1429 ("pulseaudio" ,pulseaudio)
1431 ("qtx11extras" ,qtx11extras)
1432 ("v4l-utils" ,v4l-utils)
1434 (synopsis "Live streaming software")
1435 (description "Open Broadcaster Software provides a graphical interface for
1436 video recording and live streaming. OBS supports capturing audio and video
1437 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1439 (home-page "https://obsproject.com")
1440 (license license:gpl2+)))
1442 (define-public libvdpau
1449 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1450 name "-" version ".tar.bz2"))
1453 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1454 (build-system gnu-build-system)
1456 `(("pkg-config" ,pkg-config)))
1458 `(("dri2proto" ,dri2proto)
1459 ("libx11" ,libx11 "out")
1460 ("libxext" ,libxext)))
1461 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1462 (synopsis "Video Decode and Presentation API")
1463 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1464 provides an interface to video decode acceleration and presentation hardware
1465 present in modern GPUs.")
1466 (license (license:x11-style "file://COPYING"))))
1468 (define-public vdpauinfo
1475 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1476 name "-" version ".tar.gz"))
1479 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1480 (build-system gnu-build-system)
1482 `(("pkg-config" ,pkg-config)
1483 ("libx11" ,libx11)))
1485 `(("libvdpau" ,libvdpau)))
1486 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1487 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1488 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1490 (license (license:x11-style "file://COPYING"))))
1492 (define-public recordmydesktop
1494 (name "recordmydesktop")
1498 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1499 version "/recordmydesktop-" version ".tar.gz"))
1502 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
1503 (build-system gnu-build-system)
1504 (inputs `(("popt" ,popt)
1509 ("libxfixes" ,libxfixes)
1510 ("libxdamage" ,libxdamage)
1511 ("libxext" ,libxext)
1512 ("libvorbis" ,libvorbis)
1513 ("libtheora" ,libtheora)))
1514 (home-page "http://recordmydesktop.sourceforge.net/")
1515 (synopsis "Desktop session video recorder")
1517 "recordMyDesktop is a command-line tool that captures the activity in
1518 your graphical desktop and encodes it as a video. This is a useful tool for
1519 making @dfn{screencasts}.")
1520 (license license:gpl2+)))