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, 2017 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, 2016 Alex Vong <alexvong1995@gmail.com>
10 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
11 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
12 ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com>
13 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
14 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
15 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
16 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages video)
34 #:use-module (ice-9 match)
35 #:use-module (srfi srfi-1)
36 #:use-module (srfi srfi-26)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix utils)
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix svn-download)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system glib-or-gtk)
46 #:use-module (guix build-system python)
47 #:use-module (guix build-system waf)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages audio)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages avahi)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bison)
55 #:use-module (gnu packages cdrom)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages curl)
59 #:use-module (gnu packages databases)
60 #:use-module (gnu packages dejagnu)
61 #:use-module (gnu packages elf)
62 #:use-module (gnu packages flex)
63 #:use-module (gnu packages fontutils)
64 #:use-module (gnu packages freedesktop)
65 #:use-module (gnu packages fribidi)
66 #:use-module (gnu packages gettext)
67 #:use-module (gnu packages ghostscript)
68 #:use-module (gnu packages gl)
69 #:use-module (gnu packages glib)
70 #:use-module (gnu packages guile)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gnupg)
73 #:use-module (gnu packages gstreamer)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages linux)
77 #:use-module (gnu packages lua)
78 #:use-module (gnu packages m4)
79 #:use-module (gnu packages man)
80 #:use-module (gnu packages mp3)
81 #:use-module (gnu packages ncurses)
82 #:use-module (gnu packages ocr)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages popt)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages sdl)
90 #:use-module (gnu packages ssh)
91 #:use-module (gnu packages texinfo)
92 #:use-module (gnu packages textutils)
93 #:use-module (gnu packages tls)
94 #:use-module (gnu packages version-control)
95 #:use-module (gnu packages web)
96 #:use-module (gnu packages webkit)
97 #:use-module (gnu packages xdisorg)
98 #:use-module (gnu packages xiph)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xorg)
101 #:use-module (gnu packages assembly)
102 #:use-module (gnu packages zip))
110 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
111 version "/" name "-" version ".tar.gz"))
114 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
115 (build-system gnu-build-system)
117 `(("makeinfo" ,texinfo)))
119 `(("ncurses" ,ncurses)))
122 (modify-phases %standard-phases
124 (lambda* (#:key build inputs outputs #:allow-other-keys)
125 ;; This old `configure' script doesn't support
126 ;; variables passed as arguments.
127 (let ((out (assoc-ref outputs "out"))
128 (ncurses (assoc-ref inputs "ncurses")))
129 (setenv "CONFIG_SHELL" (which "bash"))
130 (zero? (system* "./configure"
131 (string-append "--prefix=" out)
132 (string-append "--build=" build)
133 ;; The ancient config.guess is unable to
134 ;; guess the host triplet on mips64el.
135 ,@(if (string=? "mips64el-linux"
137 '("--host=mips64el-unknown-linux-gnu")
139 ;; The same is also true with aarch64.
140 ,@(if (string=? "aarch64-linux"
142 '("--host=aarch64-unknown-linux-gnu")
144 (string-append "--with-ncurses="
146 (home-page "http://aa-project.sourceforge.net/aalib/")
147 (synopsis "ASCII-art library")
149 "AA-lib is a low level gfx library which does not require graphics device.
150 In fact, there is no graphical output possible. AA-lib replaces those
151 old-fashioned output methods with powerful ascii-art renderer.")
152 (license license:lgpl2.0+)))
154 (define-public liba52
161 ;; A mirror://sourceforge URI doesn't work, presumably
162 ;; because the SourceForge project is misconfigured.
163 "http://liba52.sourceforge.net/files/a52dec-" version
167 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
168 (patches (search-patches "liba52-enable-pic.patch"
169 "liba52-set-soname.patch"
170 "liba52-use-mtune-not-mcpu.patch"
171 "liba52-link-with-libm.patch"))))
172 (build-system gnu-build-system)
173 ;; XXX We need to run ./bootstrap because of the build system fixes above.
175 `(("autoconf" ,autoconf)
176 ("automake" ,automake)
177 ("libtool" ,libtool)))
178 (arguments `(#:configure-flags '("--enable-shared")
180 (modify-phases %standard-phases
181 ;; XXX We need to run ./bootstrap because of the build
182 ;; system fixes above.
185 (lambda _ (zero? (system* "sh" "bootstrap")))))))
186 (home-page "http://liba52.sourceforge.net/")
187 (synopsis "ATSC A/52 stream decoder")
188 (description "liba52 is a library for decoding ATSC A/52 streams. The
189 A/52 standard is used in a variety of applications, including digital
190 television and DVD. It is also known as AC-3.")
191 (license license:gpl2+)))
193 (define-public libmpeg2
199 ;; A mirror://sourceforge URI doesn't work, presumably
200 ;; because the SourceForge project is misconfigured.
201 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
202 name "-" version ".tar.gz"))
205 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
213 (build-system gnu-build-system)
214 (home-page "http://libmpeg2.sourceforge.net/")
215 (synopsis "MPEG1 and MPEG2 video decoder library")
217 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
218 (license license:gpl2+)))
220 (define-public libx264
223 (version "20170316-2245")
226 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
227 "x264-snapshot-" version ".tar.bz2"))
230 "1s1nnvl3axz38sv4g09skijl6k9mbbngbb1nsh26w4dr2w2gyzad"))))
231 (build-system gnu-build-system)
233 `(("pkg-config" ,pkg-config)
235 ;; TODO: Add gpac input
237 `(#:tests? #f ;no check target
238 #:configure-flags '("--enable-shared"
239 ;; Don't build the command-line program. If we
240 ;; want it later, we should do so in a different
241 ;; package to avoid a circular dependency (the x264
242 ;; program depends on ffmpeg and ffmpeg depends on
246 ;; On MIPS, we must pass "--disable-asm" or else
247 ;; configure fails after printing: "You specified a
248 ;; pre-MSA CPU in your CFLAGS. If you really want
249 ;; to run on such a CPU, configure with
251 ,@(if (string-prefix? "mips"
252 (or (%current-target-system)
256 (home-page "https://www.videolan.org/developers/x264.html")
257 (synopsis "H.264 video coding library")
258 (description "libx264 is an advanced encoding library for creating
259 H.264 (MPEG-4 AVC) video streams.")
260 (license (list license:gpl2+ ;most files
261 license:isc ;common/x86/x86inc.asm
262 license:lgpl2.1+ ;extras/getopt.c
263 license:bsd-3 ;extras/inttypes.h
264 (license:non-copyleft ;extras/cl*.h
266 "See extras/cl.h in the distribution.")))))
275 (uri (string-append "https://download.videolan.org/videolan/x265/"
276 "x265_" version ".tar.gz"))
279 "07z4ydxg0lk6j43h0wlh2xddb91cy4y4mny2ln71d4278b1hllj7"))
280 (modules '((guix build utils)))
282 '(delete-file-recursively "source/compat/getopt"))))
283 (build-system cmake-build-system)
285 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
286 ;; Currently the source code doesn't check for aarch64
287 ,@(if (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))
288 '(#:configure-flags '("-DENABLE_PIC=TRUE"))
291 (modify-phases %standard-phases
292 (add-before 'configure 'prepare-build
294 (delete-file-recursively "build")
297 (home-page "http://x265.org/")
298 (synopsis "Library for encoding h.265/HEVC video streams")
299 (description "x265 is a H.265 / HEVC video encoder application library,
300 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
301 (license license:gpl2+)))
303 (define-public libass
310 "https://github.com/libass/libass/releases/download/"
311 version "/libass-" version ".tar.xz"))
314 "0b9cj5xfsa7zwlk5m146fhv102v51iqs3rapq0n2xrz30k8p9a7q"))))
315 (build-system gnu-build-system)
317 `(("pkg-config" ,pkg-config)
320 `(("freetype" ,freetype)
322 ("fontconfig" ,fontconfig)
323 ("harfbuzz" ,harfbuzz)
325 (home-page "https://github.com/libass/libass")
326 (synopsis "Subtitle rendering library for the ASS/SSA format")
327 (description "libass is a subtitle rendering library for the
328 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
329 (license license:isc)))
331 (define-public libcaca
334 (version "0.99.beta19")
337 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
341 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
342 (build-system gnu-build-system)
343 (native-inputs `(("pkg-config" ,pkg-config)))
345 `(("freeglut" ,freeglut)
352 (home-page "http://caca.zoy.org/wiki/libcaca")
353 (synopsis "Colour ASCII-art library")
354 (description "libcaca is a graphics library that outputs text instead of
355 pixels, so that it can work on older video cards or text terminals. It
356 supports Unicode, 2048 colors, dithering of color images, and advanced text
358 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
360 (define-public libdca
367 "http://download.videolan.org/pub/videolan/libdca/"
368 version "/libdca-" version ".tar.bz2"))
371 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
372 (build-system gnu-build-system)
373 (home-page "http://www.videolan.org/developers/libdca.html")
374 (synopsis "DTS Coherent Acoustics decoder")
375 (description "libdca is a library for decoding DTS Coherent Acoustics
377 (license license:gpl2+)))
386 "mirror://sourceforge/" name "/" name "/"
387 version "/" name "-" version ".tar.gz"))
390 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
391 (build-system gnu-build-system)
392 (native-inputs `(("pkg-config" ,pkg-config)))
393 (inputs `(("libxv" ,libxv)))
394 (home-page "http://libdv.sourceforge.net/")
395 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
396 (description "The Quasar DV codec (libdv) is a software codec for DV
397 video, the encoding format used by most digital camcorders, typically those
398 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
399 developed according to the official standards for DV video: IEC 61834 and
401 (license license:lgpl2.1+)))
411 "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
414 (base32 "0wswfznj93jpnxhc3jwdk5j3pmyki0rs6k9vk4vnzds0dddximf1"))))
415 (build-system gnu-build-system)
417 `(("pkg-config" ,pkg-config)))
422 ("libxfixes" ,libxfixes)
426 (modify-phases %standard-phases
428 'build 'fix-dlopen-paths
429 (lambda* (#:key outputs #:allow-other-keys)
430 (let ((out (assoc-ref outputs "out")))
431 (substitute* "va/drm/va_drm_auth_x11.c"
432 (("\"libva-x11\\.so\\.%d\"")
433 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
434 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
435 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
437 (list (string-append "--with-drivers-path="
438 (assoc-ref %build-inputs "mesa") "/lib/dri"))
439 ;; However, we can't write to mesa's store directory, so override the
440 ;; following make variable to install the dummy driver to libva's
441 ;; $prefix/lib/dri directory.
443 (list (string-append "dummy_drv_video_ladir="
444 (assoc-ref %outputs "out") "/lib/dri"))))
445 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
446 (synopsis "Video acceleration library")
447 (description "The main motivation for VA-API (Video Acceleration API) is
448 to enable hardware accelerated video decode/encode at various
449 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
450 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
451 (license license:expat)))
453 (define-public ffmpeg
459 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
463 "0ymg1mkg1n0770gmjfqp79p5ijxq04smfrsrrxc8pjc0y0agyf3f"))))
464 (build-system gnu-build-system)
466 `(("fontconfig" ,fontconfig)
467 ("freetype" ,freetype)
473 ("libbluray" ,libbluray)
475 ("libcdio-paranoia" ,libcdio-paranoia)
476 ("libtheora" ,libtheora)
477 ("libvdpau" ,libvdpau)
478 ("libvorbis" ,libvorbis)
484 ("pulseaudio" ,pulseaudio)
495 ("pkg-config" ,pkg-config)
497 ("python" ,python-2) ; scripts use interpreter python2
501 `(#:test-target "fate"
503 ;; possible additional inputs:
504 ;; --enable-avisynth enable reading of AviSynth script
506 ;; --enable-frei0r enable frei0r video filtering
507 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
508 ;; --enable-libcelt enable CELT decoding via libcelt [no]
509 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
510 ;; and libraw1394 [no]
511 ;; --enable-libfaac enable AAC encoding via libfaac [no]
512 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
513 ;; --enable-libflite enable flite (voice synthesis) support via
515 ;; --enable-libgme enable Game Music Emu via libgme [no]
516 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
517 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
518 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
519 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
520 ;; --enable-libnut enable NUT (de)muxing via libnut,
521 ;; native (de)muxer exists [no]
522 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
523 ;; libopencore-amrnb [no]
524 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
525 ;; libopencore-amrwb [no]
526 ;; --enable-libopencv enable video filtering via libopencv [no]
527 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
529 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
530 ;; --enable-libschroedinger enable Dirac de/encoding via
531 ;; libschroedinger [no]
532 ;; --enable-libshine enable fixed-point MP3 encoding via
534 ;; --enable-libssh enable SFTP protocol via libssh [no]
535 ;; (libssh2 does not work)
536 ;; --enable-libstagefright-h264 enable H.264 decoding via
537 ;; libstagefright [no]
538 ;; --enable-libutvideo enable Ut Video encoding and decoding via
540 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
541 ;; --enable-libvidstab enable video stabilization using
543 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
544 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
545 ;; libvo-amrwbenc [no]
546 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
547 ;; --enable-libxavs enable AVS encoding via xavs [no]
548 ;; --enable-libzmq enable message passing via libzmq [no]
549 ;; --enable-libzvbi enable teletext support via libzvbi [no]
550 ;; --enable-opencl enable OpenCL code
551 '("--enable-avresample"
552 "--enable-gpl" ; enable optional gpl licensed parts
554 "--enable-fontconfig"
561 "--enable-libfreetype"
562 "--enable-libmp3lame"
568 "--enable-libtwolame"
578 "--enable-runtime-cpudetect"
580 ;; Runtime cpu detection is not implemented on
581 ;; MIPS, so we disable some features.
584 "--disable-mipsdspr2"
587 (modify-phases %standard-phases
590 ;; configure does not work followed by "SHELL=..." and
591 ;; "CONFIG_SHELL=..."; set environment variables instead
592 (lambda* (#:key outputs configure-flags #:allow-other-keys)
593 (let ((out (assoc-ref outputs "out")))
594 (substitute* "configure"
595 (("#! /bin/sh") (string-append "#!" (which "sh"))))
596 (setenv "SHELL" (which "bash"))
597 (setenv "CONFIG_SHELL" (which "bash"))
598 (zero? (apply system*
600 (string-append "--prefix=" out)
601 ;; Add $libdir to the RUNPATH of all the binaries.
602 (string-append "--extra-ldflags=-Wl,-rpath="
606 'check 'set-ld-library-path
608 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
610 (let* ((dso (find-files "." "\\.so$"))
611 (path (string-join (map dirname dso) ":")))
612 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
613 (setenv "LD_LIBRARY_PATH" path)
615 (home-page "https://www.ffmpeg.org/")
616 (synopsis "Audio and video framework")
617 (description "FFmpeg is a complete, cross-platform solution to record,
618 convert and stream audio and video. It includes the libavcodec
619 audio/video codec library.")
620 (license license:gpl2+)))
622 (define-public ffmpeg-2.8
628 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
632 "1rhz7rhmhhh8bjcj3dc82haisn3qjbzqlr7k6d6v7064jgn3maiq"))))
634 (substitute-keyword-arguments (package-arguments ffmpeg)
635 ((#:configure-flags flags)
637 (if (string=? flag "--disable-mipsdsp")
638 "--disable-mipsdspr1"
649 "https://download.videolan.org/pub/videolan/vlc/"
650 version "/vlc-" version ".tar.xz"))
653 "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn"))
654 (modules '((guix build utils)))
656 ;; There are two occurrences where __DATE__ and __TIME__ are
657 ;; used to capture the build time and show it to the user.
658 '(substitute* (find-files "." "help\\.c(pp)?$")
659 (("__DATE__") "\"2016\"")
660 (("__TIME__") "\"00:00\"")))))
661 (build-system gnu-build-system)
663 `(("git" ,git) ; needed for a test
664 ("pkg-config" ,pkg-config)))
665 ;; FIXME: Add optional inputs once available.
667 `(("alsa-lib" ,alsa-lib)
671 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
672 ("fontconfig" ,fontconfig)
673 ("freetype" ,freetype)
677 ("libgcrypt" ,libgcrypt)
682 ("libsamplerate" ,libsamplerate)
684 ("libvorbis" ,libvorbis)
685 ("libtheora" ,libtheora)
688 ("libxinerama" ,libxinerama)
695 ("pulseaudio" ,pulseaudio)
696 ("python" ,python-wrapper)
697 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
698 ;("qtbase" ,qtbase) with -std=gnu++11.
699 ;("qtx11extras" ,qtx11extras)
701 ("sdl-image" ,sdl-image)
704 ("xcb-util-keysyms" ,xcb-util-keysyms)))
707 `(;; Gross workaround for <https://trac.videolan.org/vlc/ticket/16907>.
708 ;; In our case, this led to a test failure:
709 ;; test_libvlc_equalizer: libvlc/equalizer.c:122: test_equalizer: Assertion `isnan(libvlc_audio_equalizer_get_amp_at_index (equalizer, u_bands))' failed.
710 "ac_cv_c_fast_math=no"
712 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
713 (assoc-ref %build-inputs "ffmpeg")
714 "/lib")) ;needed for the tests
717 (modify-phases %standard-phases
718 (add-before 'configure 'remove-visual-tests
719 ;; Some of the tests require using the display to test out VLC,
720 ;; which fails in our sandboxed build system
722 (substitute* "test/run_vlc.sh"
723 (("./vlc --ignore-config") "echo"))
725 (add-after 'install 'regenerate-plugin-cache
726 (lambda* (#:key outputs #:allow-other-keys)
727 ;; The 'install-exec-hook' rule in the top-level Makefile.am
728 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
729 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
730 ;; it references. Thus, we first reset the timestamps of all
731 ;; these files, and then regenerate the cache such that the
732 ;; mtimes it includes are always zero instead of being dependent
733 ;; on the build time.
734 (let* ((out (assoc-ref outputs "out"))
735 (pkglibdir (string-append out "/lib/vlc"))
736 (plugindir (string-append pkglibdir "/plugins"))
737 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
738 ;; TODO: Factorize 'reset-timestamps'.
739 (for-each (lambda (file)
740 (let ((s (lstat file)))
741 (unless (eq? (stat:type s) 'symlink)
742 (utime file 0 0 0 0))))
743 (find-files plugindir))
744 (zero? (system* cachegen plugindir))))))))
745 (home-page "https://www.videolan.org/")
746 (synopsis "Audio and video framework")
747 (description "VLC is a cross-platform multimedia player and framework
748 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
749 treaming protocols.")
750 (license license:gpl2+)))
752 (define-public mplayer
759 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
763 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
764 (build-system gnu-build-system)
765 ;; FIXME: Add additional inputs once available.
767 `(("pkg-config" ,pkg-config)))
769 `(("alsa-lib" ,alsa-lib)
770 ("cdparanoia" ,cdparanoia)
772 ("fontconfig" ,fontconfig)
773 ("freetype" ,freetype)
774 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
777 ("libdvdcss" ,libdvdcss)
778 ("libdvdnav" ,libdvdnav)
780 ("libmpeg2" ,libmpeg2)
781 ("libmpg123" ,mpg123) ; audio codec for MP3
783 ("libtheora" ,libtheora)
784 ("libvdpau" ,libvdpau)
785 ("libvorbis" ,libvorbis)
788 ("libxinerama" ,libxinerama)
790 ("libxxf86dga" ,libxxf86dga)
794 ("pulseaudio" ,pulseaudio)
795 ("python" ,python-wrapper)
801 `(#:tests? #f ; no test target
803 (modify-phases %standard-phases
805 ;; configure does not work followed by "SHELL=..." and
806 ;; "CONFIG_SHELL=..."; set environment variables instead
807 (lambda* (#:key inputs outputs #:allow-other-keys)
808 (let ((out (assoc-ref outputs "out"))
809 (libx11 (assoc-ref inputs "libx11")))
810 (substitute* "configure"
811 (("#! /bin/sh") (string-append "#!" (which "sh"))))
812 (setenv "SHELL" (which "bash"))
813 (setenv "CONFIG_SHELL" (which "bash"))
816 (string-append "--extra-cflags=-I"
817 libx11 "/include") ; to detect libx11
818 "--disable-ffmpeg_a" ; disables bundled ffmpeg
819 (string-append "--prefix=" out)
820 ;; Enable runtime cpu detection where supported,
821 ;; and choose a suitable target.
822 ,@(match (or (%current-target-system)
825 '("--enable-runtime-cpudetection"
826 "--target=x86_64-linux"))
828 '("--enable-runtime-cpudetection"
829 "--target=i686-linux"))
831 '("--target=mips3-linux"))
832 (_ (list (string-append
834 (or (%current-target-system)
835 (nix-system->gnu-triplet
836 (%current-system)))))))
837 "--disable-iwmmxt"))))))))
838 (home-page "https://www.mplayerhq.hu/design7/news.html")
839 (synopsis "Audio and video player")
840 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
841 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
842 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
843 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
844 (license license:gpl2)))
853 "https://github.com/mpv-player/mpv/archive/v" version
857 "059zblcj98fhrns1rwa66mf4km68czpam4nnk8q9qny31bx58654"))
858 (file-name (string-append name "-" version ".tar.gz"))))
859 (build-system waf-build-system)
861 `(("perl" ,perl) ; for zsh completion file
862 ("pkg-config" ,pkg-config)
863 ("python-docutils" ,python-docutils)))
864 ;; Missing features: libguess, Wayland, V4L2
866 `(("alsa-lib" ,alsa-lib)
873 ("libbluray" ,libbluray)
876 ("libcdio-paranoia" ,libcdio-paranoia)
877 ("libdvdread" ,libdvdread)
878 ("libdvdnav" ,libdvdnav)
881 ("libvdpau" ,libvdpau)
884 ("libxinerama" ,libxinerama)
885 ("libxrandr" ,libxrandr)
886 ("libxscrnsaver" ,libxscrnsaver)
888 ;; XXX: lua > 5.2 is not currently supported; see
889 ;; waftools/checks/custom.py
893 ("pulseaudio" ,pulseaudio)
896 ("youtube-dl" ,youtube-dl)
900 (modify-phases %standard-phases
902 'configure 'setup-waf
903 (lambda* (#:key inputs #:allow-other-keys)
904 (copy-file (assoc-ref inputs "waf") "waf")
905 (setenv "CC" "gcc"))))
906 #:configure-flags (list "--enable-libmpv-shared"
908 "--disable-build-date")
909 ;; No check function defined.
911 (home-page "https://mpv.io/")
912 (synopsis "Audio and video player")
913 (description "mpv is a general-purpose audio and video player. It is a
914 fork of mplayer2 and MPlayer. It shares some features with the former
915 projects while introducing many more.")
916 (license license:gpl2+)))
918 (define-public gnome-mpv
925 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
926 "/download/v" version "/gnome-mpv-" version
930 "1hn3mpsxbrwf2m0nz4vzji4i6i896y8kqjb9kijqpk04cnrs3fgz"))))
932 `(("intltool" ,intltool)
933 ("pkg-config" ,pkg-config)))
936 ("libepoxy" ,libepoxy)
938 (build-system glib-or-gtk-build-system)
939 (home-page "https://github.com/gnome-mpv/gnome-mpv")
940 (synopsis "GTK+ frontend for the mpv media player")
941 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
942 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
943 access to mpv's powerful playback capabilities.")
944 (license license:gpl3+)))
946 (define-public libvpx
952 (uri (string-append "http://storage.googleapis.com/"
953 "downloads.webmproject.org/releases/webm/"
954 name "-" version ".tar.bz2"))
957 "06d8hqjkfs6wl45qf4pwh1kpbvkx6cwywd5y8d4lgagvjwm0qb0w"))
958 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
959 (build-system gnu-build-system)
962 (modify-phases %standard-phases
964 (lambda* (#:key outputs #:allow-other-keys)
965 (setenv "CONFIG_SHELL" (which "bash"))
966 (let ((out (assoc-ref outputs "out")))
968 (string-append "-Wl,-rpath=" out "/lib"))
969 (zero? (system* "./configure"
972 ;; Limit size to avoid CVE-2015-1258
973 "--size-limit=16384x16384"
974 (string-append "--prefix=" out)))))))
975 #:tests? #f)) ; no check target
979 (synopsis "VP8/VP9 video codec")
980 (description "libvpx is a codec for the VP8/VP9 video compression format.")
981 (license license:bsd-3)
982 (home-page "http://www.webmproject.org/")))
984 (define-public youtube-dl
987 (version "2017.03.26")
990 (uri (string-append "https://yt-dl.org/downloads/"
991 version "/youtube-dl-"
995 "00ysv18p4rqg7sswbpjpmmvaih6nm135bpllqdlj4ns8kjqmh59j"))))
996 (build-system python-build-system)
998 ;; The problem here is that the directory for the man page and completion
999 ;; files is relative, and for some reason, setup.py uses the
1000 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
1001 ;; So, we need pass the prefix directly. In addition, make sure the Bash
1002 ;; completion file is called 'youtube-dl' rather than
1003 ;; 'youtube-dl.bash-completion'.
1004 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1005 #:phases (modify-phases %standard-phases
1006 (add-before 'install 'fix-the-data-directories
1007 (lambda* (#:key outputs #:allow-other-keys)
1008 (let ((prefix (assoc-ref outputs "out")))
1009 (mkdir "bash-completion")
1010 (rename-file "youtube-dl.bash-completion"
1011 "bash-completion/youtube-dl")
1012 (substitute* "setup.py"
1013 (("youtube-dl\\.bash-completion")
1014 "bash-completion/youtube-dl")
1016 (string-append "'" prefix "/etc/"))
1018 (string-append "'" prefix "/share/")))))))))
1019 (synopsis "Download videos from YouTube.com and other sites")
1021 "Youtube-dl is a small command-line program to download videos from
1022 YouTube.com and a few more sites.")
1023 (home-page "https://yt-dl.org")
1024 (license license:public-domain)))
1026 (define-public libbluray
1032 (uri (string-append "https://download.videolan.org/videolan/"
1033 name "/" version "/"
1034 name "-" version ".tar.bz2"))
1037 "1k3lag4lxi2jjd3zh4wcb5l3hadzm54j5kagh92yzfy76p9svqzp"))))
1038 (build-system gnu-build-system)
1040 `(#:configure-flags '("--disable-bdjava")
1042 (modify-phases %standard-phases
1043 (add-before 'build 'fix-dlopen-paths
1044 (lambda* (#:key inputs #:allow-other-keys)
1045 (let ((libaacs (assoc-ref inputs "libaacs"))
1046 (libbdplus (assoc-ref inputs "libbdplus")))
1047 (substitute* "src/libbluray/disc/aacs.c"
1049 (string-append "\"" libaacs "/lib/libaacs\"")))
1050 (substitute* "src/libbluray/disc/bdplus.c"
1052 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1054 (native-inputs `(("pkg-config" ,pkg-config)))
1056 `(("fontconfig" ,fontconfig)
1057 ("freetype" ,freetype)
1058 ("libaacs" ,libaacs)
1059 ("libbdplus" ,libbdplus)
1060 ("libxml2" ,libxml2)))
1061 (home-page "https://www.videolan.org/developers/libbluray.html")
1062 (synopsis "Blu-Ray Disc playback library")
1064 "libbluray is a library designed for Blu-Ray Disc playback for media
1065 players, like VLC or MPlayer.")
1066 (license license:lgpl2.1+)))
1068 (define-public libdvdread
1074 (uri (string-append "http://download.videolan.org/videolan/"
1075 name "/" version "/"
1076 name "-" version ".tar.bz2"))
1079 "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
1080 (build-system gnu-build-system)
1081 (home-page "http://dvdnav.mplayerhq.hu/")
1082 (synopsis "Library for reading video DVDs")
1084 "Libdvdread provides a simple foundation for reading DVD video
1085 disks. It provides the functionality that is required to access many
1086 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1087 authentication and descrambling (if an external libdvdcss library is
1089 (license license:gpl2+)))
1091 (define-public libdvdnav
1097 (uri (string-append "http://download.videolan.org/videolan/"
1098 name "/" version "/"
1099 name "-" version ".tar.bz2"))
1102 "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
1103 (build-system gnu-build-system)
1105 `(("pkg-config" ,pkg-config)))
1107 `(("libdvdread" ,libdvdread)))
1108 (home-page "http://dvdnav.mplayerhq.hu/")
1109 (synopsis "Library for video DVD navigation features")
1111 "Libdvdnav is a library for developers of multimedia
1112 applications. It allows easy use of sophisticated DVD navigation features
1113 such as DVD menus, multiangle playback and even interactive DVD games. All
1114 this functionality is provided through a simple API which provides the DVD
1115 playback as a single logical stream of blocks, intermitted by special
1116 dvdnav events to report certain conditions. The main usage of libdvdnav is
1117 a loop regularly calling a function to get the next block, surrounded by
1118 additional calls to tell the library of user interaction. The whole
1119 DVD virtual machine and internal playback states are completely
1121 (license license:gpl2+)))
1123 (define-public libdvdnav-4
1131 "http://download.videolan.org/videolan/libdvdnav/libdvdnav-"
1135 "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
1137 `(("pkg-config" ,pkg-config)
1138 ("autoconf" ,autoconf)
1139 ("automake" ,automake)
1140 ("libtool" ,libtool)))
1146 (zero? (system* "autoreconf" "-vif")))
1147 %standard-phases)))))
1149 (define-public libdvdcss
1155 (uri (string-append "http://download.videolan.org/pub/"
1156 name "/" version "/"
1157 name "-" version ".tar.bz2"))
1160 "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
1161 (build-system gnu-build-system)
1162 (home-page "http://www.videolan.org/developers/libdvdcss.html")
1163 (synopsis "Library for accessing DVDs as block devices")
1165 "libdvdcss is a simple library designed for accessing DVDs like a block
1166 device without having to bother about the decryption.")
1167 (license license:gpl2+)))
1169 (define-public srt2vtt
1176 "http://dthompson.us/releases/srt2vtt/srt2vtt-"
1180 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1181 (build-system gnu-build-system)
1183 `(("guile" ,guile-2.0)))
1184 (synopsis "SubRip to WebVTT subtitle converter")
1185 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1186 for use with HTML5 video.")
1187 (home-page "http://dthompson.us/pages/software/srt2vtt")
1188 (license license:gpl3+)))
1190 (define-public avidemux
1197 "mirror://sourceforge/" name "/" name "/" version "/"
1198 name "_" version ".tar.gz"))
1201 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1202 (patches (search-patches "avidemux-install-to-lib.patch"))))
1203 (build-system cmake-build-system)
1205 `(("pkg-config" ,pkg-config)))
1206 ;; FIXME: Once packaged, add libraries not found during the build.
1208 `(("alsa-lib" ,alsa-lib)
1209 ("fontconfig" ,fontconfig)
1210 ("freetype" ,freetype)
1211 ("fribidi" ,fribidi)
1216 ("libvdpau" ,libvdpau)
1217 ("libvorbis" ,libvorbis)
1221 ("pulseaudio" ,pulseaudio)
1222 ("python" ,python-wrapper)
1223 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
1224 ;("qtbase" ,qtbase) with -std=gnu++11.
1225 ;("qttools" ,qttools)
1231 `(#:tests? #f ; no check target
1233 ;; Make sure files inside the included ffmpeg tarball are
1235 (modify-phases %standard-phases
1236 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1238 (with-directory-excursion "avidemux_core/ffmpeg_package"
1239 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1240 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1241 (add-after 'patch-source-shebangs 'repack-ffmpeg
1243 (with-directory-excursion "avidemux_core/ffmpeg_package"
1244 (substitute* "ffmpeg-2.7.6/configure"
1245 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1246 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1247 ;; avoid non-determinism in the archive
1248 "--sort=name" "--mtime=@0"
1249 "--owner=root:0" "--group=root:0")
1250 (delete-file-recursively "ffmpeg-2.7.6"))))
1253 ;; Copy-paste settings from the cmake build system.
1254 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1255 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1257 (lambda* (#:key inputs outputs #:allow-other-keys)
1259 ((out (assoc-ref outputs "out"))
1260 (lib (string-append out "/lib"))
1262 (sdl (assoc-ref inputs "sdl"))
1264 (lambda* (component srcdir #:optional (args '()))
1265 (let ((builddir (string-append "build_" component)))
1267 (with-directory-excursion builddir
1270 (apply system* "cmake"
1271 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1272 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1273 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1274 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1275 "\"-Wl,-rpath=" lib "\"")
1276 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1277 (string-append "-DSDL_INCLUDE_DIR="
1279 (string-append "../" srcdir)
1282 (system* "make" "-j"
1283 (number->string (parallel-job-count)))
1284 (system* "make" "install"))))))))
1286 (and (build_component "core" "avidemux_core")
1287 (build_component "cli" "avidemux/cli")
1288 (build_component "qt4" "avidemux/qt4")
1289 (build_component "plugins_common" "avidemux_plugins"
1290 '("-DPLUGIN_UI=COMMON"))
1291 (build_component "plugins_cli" "avidemux_plugins"
1292 '("-DPLUGIN_UI=CLI"))
1293 (build_component "plugins_qt4" "avidemux_plugins"
1294 '("-DPLUGIN_UI=QT4"))
1295 (build_component "plugins_settings" "avidemux_plugins"
1296 '("-DPLUGIN_UI=SETTINGS")))
1297 ;; Remove .exe and .dll file.
1298 (delete-file-recursively
1299 (string-append out "/share/ADM6_addons")))))
1300 (delete 'install))))
1301 (home-page "http://fixounet.free.fr/avidemux/")
1302 (synopsis "Video editor")
1303 (description "Avidemux is a video editor designed for simple cutting,
1304 filtering and encoding tasks. It supports many file types, including AVI,
1305 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1306 can be automated using projects, job queue and powerful scripting
1308 ;; Software with various licenses is included, see License.txt.
1309 (license license:gpl2+)))
1311 (define-public vapoursynth
1313 (name "vapoursynth")
1318 "https://github.com/vapoursynth/vapoursynth/archive/R"
1320 (file-name (string-append name "-" version ".tar.gz"))
1323 "1g3hc079jw4mz1cmkv2y28pdb556wqc8ql7iravgh1rg8j3f1zi5"))))
1324 (build-system gnu-build-system)
1326 `(("autoconf" ,autoconf)
1327 ("automake" ,automake)
1328 ("cython" ,python-cython)
1329 ("libtool" ,libtool)
1330 ("pkg-config" ,pkg-config)
1334 `(("ffmpeg" ,ffmpeg)
1336 ("tesseract-ocr" ,tesseract-ocr)
1340 (modify-phases %standard-phases
1344 (zero? (system* "sh" "autogen.sh")))))))
1345 (home-page "http://www.vapoursynth.com/")
1346 (synopsis "Video processing framework")
1347 (description "VapourSynth is a C++ library and Python module for video
1348 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1349 multithreading, generalized colorspaces, per frame properties, and videos with
1351 ;; src/core/cpufeatures only allows x86, ARM or PPC
1352 (supported-systems (delete "mips64el-linux" %supported-systems))
1353 ;; As seen from the source files.
1354 (license license:lgpl2.1+)))
1363 "http://downloads.xvid.org/downloads/xvidcore-"
1364 version ".tar.bz2"))
1367 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1368 (build-system gnu-build-system)
1369 (native-inputs `(("yasm" ,yasm)))
1372 (modify-phases %standard-phases
1374 'configure 'pre-configure
1376 (chdir "build/generic")
1377 (substitute* "configure"
1378 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1379 ;; No 'check' target.
1381 (home-page "https://www.xvid.com/")
1382 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1383 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1384 codec library. It uses ASP features such as b-frames, global and quarter
1385 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1386 and custom quantization matrices.")
1387 (license license:gpl2+)))
1389 (define-public livestreamer
1391 (name "livestreamer")
1396 "https://github.com/chrippa/livestreamer/archive/v"
1398 (file-name (string-append "livestreamer-" version ".tar.gz"))
1401 "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
1402 (build-system python-build-system)
1404 '(#:tests? #f)) ; tests rely on external web servers
1406 `(("python-requests" ,python-requests)))
1407 (synopsis "Internet video stream viewer")
1408 (description "Livestreamer is a command-line utility that extracts streams
1409 from various services and pipes them into a video playing application.")
1410 (home-page "http://livestreamer.io/")
1411 (license license:bsd-2)))
1419 (uri (string-append "https://github.com/mltframework/mlt/"
1420 "archive/v" version ".tar.gz"))
1421 (file-name (string-append name "-" version ".tar.gz"))
1424 "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))))
1425 (build-system gnu-build-system)
1427 `(#:tests? #f ; no tests
1428 #:make-flags '("CC=gcc")
1430 (list "--enable-gpl3"
1433 (modify-phases %standard-phases
1435 'configure 'override-LDFLAGS
1436 (lambda* (#:key outputs #:allow-other-keys)
1437 (substitute* "config.mak"
1439 (string-append "LDFLAGS+=-Wl,-rpath="
1440 (assoc-ref outputs "out")
1444 `(("alsa-lib" ,alsa-lib)
1446 ("libxml2" ,libxml2)
1449 ("libsamplerate" ,libsamplerate)
1450 ("pulseaudio" ,pulseaudio)
1454 `(("pkg-config" ,pkg-config)))
1455 (home-page "https://www.mltframework.org/")
1456 (synopsis "Author, manage, and run multitrack audio/video compositions")
1458 "MLT is a multimedia framework, designed and developed for television
1459 broadcasting. It provides a toolkit for broadcasters, video editors, media
1460 players, transcoders, web streamers and many more types of applications. The
1461 functionality of the system is provided via an assortment of ready to use
1462 tools, XML authoring components, and an extensible plug-in based API.")
1463 (license license:lgpl2.1+)))
1465 (define-public v4l-utils
1471 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1472 "/v4l-utils-" version ".tar.bz2"))
1475 "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1"))))
1476 (build-system gnu-build-system)
1479 (list (string-append "--with-udevdir="
1480 (assoc-ref %outputs "out")
1482 "CXXFLAGS=-std=gnu++11")))
1484 `(("pkg-config" ,pkg-config)))
1486 `(("alsa-lib" ,alsa-lib)
1488 ("libjpeg" ,libjpeg)
1492 (synopsis "Realtime video capture utilities for Linux")
1493 (description "The v4l-utils provide a series of libraries and utilities to
1494 be used for realtime video capture via Linux-specific APIs.")
1495 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1496 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1497 (license (list license:lgpl2.1+ license:gpl2))))
1505 (uri (string-append "https://github.com/jp9000/obs-studio"
1506 "/archive/" version ".tar.gz"))
1507 (file-name (string-append name "-" version ".tar.gz"))
1510 "043f8mfdh4ll0hpivpyg3iniirckwsgri0gzamyrba1yhf2c2ibr"))))
1511 (build-system cmake-build-system)
1513 `(#:tests? #f ; no tests
1514 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1518 (modify-phases %standard-phases
1519 (add-after 'unpack 'remove-architecture-specific-instructions
1520 ;; non-Intel platforms fail to build with the architecture
1521 ;; specific compiler flags included by default.
1523 (substitute* "libobs/CMakeLists.txt"
1524 (("if\\(NOT MSVC\\)") "if(MSVC)"))
1528 `(("pkg-config" ,pkg-config)))
1530 `(("alsa-lib" ,alsa-lib)
1534 ("fontconfig" ,fontconfig)
1535 ("freetype" ,freetype)
1537 ("jansson" ,jansson)
1538 ("libx264" ,libx264)
1539 ("libxcomposite" ,libxcomposite)
1541 ("pulseaudio" ,pulseaudio)
1543 ("qtx11extras" ,qtx11extras)
1545 ("v4l-utils" ,v4l-utils)
1547 (synopsis "Live streaming software")
1548 (description "Open Broadcaster Software provides a graphical interface for
1549 video recording and live streaming. OBS supports capturing audio and video
1550 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1552 (home-page "https://obsproject.com")
1553 (license license:gpl2+)))
1555 (define-public libvdpau
1562 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1563 name "-" version ".tar.bz2"))
1566 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1567 (build-system gnu-build-system)
1569 `(("pkg-config" ,pkg-config)))
1571 `(("dri2proto" ,dri2proto)
1572 ("libx11" ,libx11 "out")
1573 ("libxext" ,libxext)))
1574 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1575 (synopsis "Video Decode and Presentation API")
1576 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1577 provides an interface to video decode acceleration and presentation hardware
1578 present in modern GPUs.")
1579 (license (license:x11-style "file://COPYING"))))
1581 (define-public vdpauinfo
1588 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1589 name "-" version ".tar.gz"))
1592 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1593 (build-system gnu-build-system)
1595 `(("pkg-config" ,pkg-config)
1596 ("libx11" ,libx11)))
1598 `(("libvdpau" ,libvdpau)))
1599 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1600 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1601 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1603 (license (license:x11-style "file://COPYING"))))
1605 (define-public recordmydesktop
1607 (name "recordmydesktop")
1611 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1612 version "/recordmydesktop-" version ".tar.gz"))
1615 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
1616 (build-system gnu-build-system)
1617 (inputs `(("popt" ,popt)
1622 ("libxfixes" ,libxfixes)
1623 ("libxdamage" ,libxdamage)
1624 ("libxext" ,libxext)
1625 ("alsa-lib" ,alsa-lib)
1626 ("libvorbis" ,libvorbis)
1627 ("libtheora" ,libtheora)))
1628 (home-page "http://recordmydesktop.sourceforge.net/")
1629 (synopsis "Desktop session video recorder")
1631 "recordMyDesktop is a command-line tool that captures the activity in
1632 your graphical desktop and encodes it as a video. This is a useful tool for
1633 making @dfn{screencasts}.")
1634 (license license:gpl2+)))
1636 (define-public libsmpeg
1643 (url "svn://svn.icculus.org/smpeg/trunk/")
1644 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
1647 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
1648 (build-system gnu-build-system)
1650 `(#:phases (modify-phases %standard-phases
1651 (add-after 'unpack 'autogen.sh
1653 (zero? (system* "sh" "autogen.sh")))))))
1655 `(("autoconf" ,autoconf)
1656 ("automake" ,automake)))
1659 (home-page "http://icculus.org/smpeg/")
1660 (synopsis "SDL MPEG decoding library")
1662 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
1663 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
1664 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
1665 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
1666 and MPEG system streams.")
1667 (license (list license:expat
1672 (define-public libbdplus
1679 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libbdplus/"
1680 version "/" name "-" version ".tar.bz2"))
1682 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
1684 `(("libgcrypt" ,libgcrypt)))
1685 (build-system gnu-build-system)
1686 (home-page "http://www.videolan.org/developers/libbdplus.html")
1687 (synopsis "Library for decrypting certain Blu-Ray discs")
1688 (description "libbdplus is a library which implements the BD+ System
1690 (license license:lgpl2.1+)))
1692 (define-public libaacs
1699 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libaacs/"
1700 version "/" name "-" version ".tar.bz2"))
1702 (base32 "1s5v075hnbs57995r6lljm79wgrip3gnyf55a0y7bja75jh49hwm"))))
1704 `(("libgcrypt" ,libgcrypt)))
1708 (build-system gnu-build-system)
1709 (home-page "http://www.videolan.org/developers/libaacs.html")
1710 (synopsis "Library for decrypting certain Blu-Ray discs")
1711 (description "libaacs is a library which implements the Advanced Access
1712 Content System specification.")
1713 (license license:lgpl2.1+)))
1715 (define-public mps-youtube
1717 (name "mps-youtube")
1722 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
1723 "archive/v" version ".tar.gz"))
1724 (file-name (string-append name "-" version ".tar.gz"))
1727 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
1728 (build-system python-build-system)
1730 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
1731 ;; test suite results differ depending on the country and also introduce
1732 ;; non-determinism in the tests.
1733 ;; https://github.com/mps-youtube/mps-youtube/issues/556
1736 `(("python-pafy" ,python-pafy)
1737 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
1738 (home-page "https://github.com/mps-youtube/mps-youtube")
1739 (synopsis "Terminal based YouTube player and downloader")
1741 "@code{mps-youtube} is based on mps, a terminal based program to
1742 search, stream and download music. This implementation uses YouTube as
1743 a source of content and can play and download video as well as audio.
1744 It can use either mpv or mplayer for playback, and for conversion of
1745 formats ffmpeg or libav is used. Users should install one of the
1746 supported players in addition to this package.")
1747 (license license:gpl3+)))
1749 (define-public handbrake
1755 (uri (string-append "https://handbrake.fr/rotation.php?file="
1756 "HandBrake-" version ".tar.bz2"))
1757 (file-name (string-append "handbrake-" version ".tar.bz2"))
1760 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
1761 (patches (search-patches "handbrake-pkg-config-path.patch"))
1762 (modules '((guix build utils)))
1764 ;; Remove bundled libraries and source not necessary for
1765 ;; running under a GNU environment.
1767 (for-each delete-file-recursively '("contrib" "macosx" "win"))
1769 (build-system glib-or-gtk-build-system)
1771 `(("automake" ,automake) ;gui subpackage must be bootstrapped
1772 ("autoconf" ,autoconf)
1773 ("curl" ,curl) ;not actually used, but tested for
1774 ("intltool" ,intltool)
1775 ("libtool" ,libtool)
1776 ("pkg-config" ,pkg-config)
1777 ("python" ,python-2))) ;for configuration
1780 ("dbus-glib" ,dbus-glib)
1782 ("fontconfig" ,fontconfig)
1783 ("freetype" ,freetype)
1785 ("gstreamer" ,gstreamer)
1786 ("gst-plugins-base" ,gst-plugins-base)
1790 ("libbluray" ,libbluray)
1791 ("libdvdnav" ,libdvdnav)
1792 ("libdvdread" ,libdvdread)
1793 ("libgudev" ,libgudev)
1794 ("libmpeg2" ,libmpeg2)
1795 ("libnotify" ,libnotify)
1797 ("libsamplerate" ,libsamplerate)
1798 ("libtheora" ,libtheora)
1799 ("libvorbis" ,libvorbis)
1801 ("libxml2" ,libxml2)
1802 ("libx264" ,libx264)
1806 `(#:tests? #f ;tests require Ruby and claim to be unsupported
1808 (modify-phases %standard-phases
1809 (add-before 'patch-source-shebangs 'bootstrap-gtk
1810 ;; Run bootstrap ahead of time so that shebangs get patched.
1812 (setenv "CONFIG_SHELL" (which "sh"))
1813 (setenv "NOCONFIGURE" "1")
1814 ;; Patch the Makefile so that it doesn't bootstrap again.
1815 (substitute* "gtk/module.rules"
1816 ((".*autogen\\.sh.*") ""))
1817 (zero? (system* "sh" "./gtk/autogen.sh"))))
1818 (add-before 'configure 'disable-contrib
1820 (substitute* "make/include/main.defs"
1821 ;; Disable unconditional inclusion of some "contrib"
1822 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
1823 ;; and libbluray), which would lead to fetching and
1824 ;; building of these libraries. Use our own instead.
1825 (("MODULES \\+= contrib") "# MODULES += contrib"))
1827 (add-before 'configure 'fix-x265-linking
1829 (substitute* "test/module.defs"
1830 ;; Fix missing library during linking error
1831 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
1834 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1835 ;; 'configure' is not an autoconf-generated script, and
1836 ;; errors on unrecognized arguments,
1837 ;; e.g. --enable-fast-install
1838 (let ((out (assoc-ref outputs "out")))
1839 (zero? (apply system* "./configure"
1840 (string-append "--prefix=" out)
1841 (or configure-flags '()))))))
1842 (add-after 'configure 'chdir-build
1843 (lambda _ (chdir "./build") #t)))))
1844 (home-page "https://handbrake.fr")
1845 (synopsis "Video transcoder")
1847 "HandBrake is a tool for converting video from any format to a selection
1848 of modern, widely supported codecs.")
1849 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
1850 (license (list license:gpl2+ license:bsd-3))))
1852 (define-public openh264
1858 (uri (string-append "https://github.com/cisco/"
1859 name "/archive/v" version ".tar.gz"))
1860 (file-name (string-append name "-" version ".tar.gz"))
1863 "1ix2fhk62i4q4kbnkl0gfk4x53vxqavsn0pck1pashr566zhglv5"))))
1864 (build-system gnu-build-system)
1867 ("python" ,python)))
1869 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1870 #:test-target "test"
1871 #:phases (modify-phases %standard-phases
1872 ;; no configure script
1873 (delete 'configure))))
1874 (home-page "http://www.openh264.org/")
1875 (synopsis "H264 decoder library")
1877 "Openh264 is a library which can decode H264 video streams.")
1878 (license license:bsd-2)))
1880 (define-public libmp4v2
1887 ;; XXX: The new location of upstream is uncertain and will become relevant the
1888 ;; moment when the googlecode archive shuts down. It is past the date it
1889 ;; should've been turned off. I tried to communicate with upstream, but this
1890 ;; wasn't very responsive and not very helpful. The short summary is, it is
1891 ;; chaos when it comes to the amount of forks and only time will tell where
1892 ;; the new upstream location is.
1893 (uri (string-append "https://storage.googleapis.com/google-"
1894 "code-archive-downloads/v2/"
1895 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
1896 (file-name (string-append name "-" version ".tar.bz2"))
1899 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
1900 (build-system gnu-build-system)
1902 "static")) ; 3.7MiB .a file
1905 (modify-phases %standard-phases
1906 (add-after 'unpack 'remove-dates
1908 ;; Make the build reproducible.
1909 (substitute* "configure"
1910 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
1911 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
1913 (add-after 'install 'move-static-libraries
1914 (lambda* (#:key outputs #:allow-other-keys)
1915 ;; Move static libraries to the "static" output.
1916 (let* ((out (assoc-ref outputs "out"))
1917 (lib (string-append out "/lib"))
1918 (static (assoc-ref outputs "static"))
1919 (slib (string-append static "/lib")))
1921 (for-each (lambda (file)
1922 (install-file file slib)
1924 (find-files lib "\\.a$"))
1927 `(("help2man" ,help2man)
1928 ("dejagnu" ,dejagnu)))
1929 (home-page "https://code.google.com/archive/p/mp4v2/")
1930 (synopsis "API to create and modify mp4 files")
1932 "The MP4v2 library provides an API to create and modify mp4 files as defined by
1933 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
1934 file format that has been used as a multimedia file format in a variety of platforms and
1935 applications. It is a very powerful and extensible format that can accommodate
1936 practically any type of media.")
1937 (license license:mpl1.1)))