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>
17 ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages video)
35 #:use-module (ice-9 match)
36 #:use-module (srfi srfi-1)
37 #:use-module (srfi srfi-26)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix utils)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix svn-download)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system glib-or-gtk)
47 #:use-module (guix build-system python)
48 #:use-module (guix build-system waf)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages audio)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages avahi)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages cdrom)
57 #:use-module (gnu packages cmake)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages dejagnu)
62 #:use-module (gnu packages elf)
63 #:use-module (gnu packages flex)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages freedesktop)
66 #:use-module (gnu packages fribidi)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages ghostscript)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages guile)
72 #:use-module (gnu packages gnome)
73 #:use-module (gnu packages gnupg)
74 #:use-module (gnu packages gstreamer)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages image)
77 #:use-module (gnu packages linux)
78 #:use-module (gnu packages lua)
79 #:use-module (gnu packages m4)
80 #:use-module (gnu packages man)
81 #:use-module (gnu packages mp3)
82 #:use-module (gnu packages ncurses)
83 #:use-module (gnu packages ocr)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages popt)
87 #:use-module (gnu packages pulseaudio)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages qt)
90 #:use-module (gnu packages sdl)
91 #:use-module (gnu packages ssh)
92 #:use-module (gnu packages texinfo)
93 #:use-module (gnu packages textutils)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages version-control)
96 #:use-module (gnu packages web)
97 #:use-module (gnu packages webkit)
98 #:use-module (gnu packages xdisorg)
99 #:use-module (gnu packages xiph)
100 #:use-module (gnu packages xml)
101 #:use-module (gnu packages xorg)
102 #:use-module (gnu packages assembly)
103 #:use-module (gnu packages zip))
111 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
112 version "/" name "-" version ".tar.gz"))
115 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
116 (build-system gnu-build-system)
118 `(("makeinfo" ,texinfo)))
120 `(("ncurses" ,ncurses)))
123 (modify-phases %standard-phases
125 (lambda* (#:key build inputs outputs #:allow-other-keys)
126 ;; This old `configure' script doesn't support
127 ;; variables passed as arguments.
128 (let ((out (assoc-ref outputs "out"))
129 (ncurses (assoc-ref inputs "ncurses")))
130 (setenv "CONFIG_SHELL" (which "bash"))
131 (zero? (system* "./configure"
132 (string-append "--prefix=" out)
133 (string-append "--build=" build)
134 ;; The ancient config.guess is unable to
135 ;; guess the host triplet on mips64el.
136 ,@(if (string=? "mips64el-linux"
138 '("--host=mips64el-unknown-linux-gnu")
140 ;; The same is also true with aarch64.
141 ,@(if (string=? "aarch64-linux"
143 '("--host=aarch64-unknown-linux-gnu")
145 (string-append "--with-ncurses="
147 (home-page "http://aa-project.sourceforge.net/aalib/")
148 (synopsis "ASCII-art library")
150 "AA-lib is a low level gfx library which does not require graphics device.
151 In fact, there is no graphical output possible. AA-lib replaces those
152 old-fashioned output methods with powerful ascii-art renderer.")
153 (license license:lgpl2.0+)))
155 (define-public liba52
162 ;; A mirror://sourceforge URI doesn't work, presumably
163 ;; because the SourceForge project is misconfigured.
164 "http://liba52.sourceforge.net/files/a52dec-" version
168 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
169 (patches (search-patches "liba52-enable-pic.patch"
170 "liba52-set-soname.patch"
171 "liba52-use-mtune-not-mcpu.patch"
172 "liba52-link-with-libm.patch"))))
173 (build-system gnu-build-system)
174 ;; XXX We need to run ./bootstrap because of the build system fixes above.
176 `(("autoconf" ,autoconf)
177 ("automake" ,automake)
178 ("libtool" ,libtool)))
179 (arguments `(#:configure-flags '("--enable-shared")
181 (modify-phases %standard-phases
182 ;; XXX We need to run ./bootstrap because of the build
183 ;; system fixes above.
186 (lambda _ (zero? (system* "sh" "bootstrap")))))))
187 (home-page "http://liba52.sourceforge.net/")
188 (synopsis "ATSC A/52 stream decoder")
189 (description "liba52 is a library for decoding ATSC A/52 streams. The
190 A/52 standard is used in a variety of applications, including digital
191 television and DVD. It is also known as AC-3.")
192 (license license:gpl2+)))
194 (define-public libmpeg2
200 ;; A mirror://sourceforge URI doesn't work, presumably
201 ;; because the SourceForge project is misconfigured.
202 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
203 name "-" version ".tar.gz"))
206 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
214 (build-system gnu-build-system)
215 (home-page "http://libmpeg2.sourceforge.net/")
216 (synopsis "MPEG1 and MPEG2 video decoder library")
218 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
219 (license license:gpl2+)))
221 (define-public libx264
224 (version "20170316-2245")
227 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
228 "x264-snapshot-" version ".tar.bz2"))
231 "1s1nnvl3axz38sv4g09skijl6k9mbbngbb1nsh26w4dr2w2gyzad"))))
232 (build-system gnu-build-system)
234 `(("pkg-config" ,pkg-config)
236 ;; TODO: Add gpac input
238 `(#:tests? #f ;no check target
239 #:configure-flags '("--enable-shared"
240 ;; Don't build the command-line program. If we
241 ;; want it later, we should do so in a different
242 ;; package to avoid a circular dependency (the x264
243 ;; program depends on ffmpeg and ffmpeg depends on
247 ;; On MIPS, we must pass "--disable-asm" or else
248 ;; configure fails after printing: "You specified a
249 ;; pre-MSA CPU in your CFLAGS. If you really want
250 ;; to run on such a CPU, configure with
252 ,@(if (string-prefix? "mips"
253 (or (%current-target-system)
257 (home-page "https://www.videolan.org/developers/x264.html")
258 (synopsis "H.264 video coding library")
259 (description "libx264 is an advanced encoding library for creating
260 H.264 (MPEG-4 AVC) video streams.")
261 (license (list license:gpl2+ ;most files
262 license:isc ;common/x86/x86inc.asm
263 license:lgpl2.1+ ;extras/getopt.c
264 license:bsd-3 ;extras/inttypes.h
265 (license:non-copyleft ;extras/cl*.h
267 "See extras/cl.h in the distribution.")))))
276 (uri (string-append "https://download.videolan.org/videolan/x265/"
277 "x265_" version ".tar.gz"))
280 "07z4ydxg0lk6j43h0wlh2xddb91cy4y4mny2ln71d4278b1hllj7"))
281 (modules '((guix build utils)))
283 '(delete-file-recursively "source/compat/getopt"))))
284 (build-system cmake-build-system)
286 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
287 ;; Currently the source code doesn't check for aarch64
288 ,@(if (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))
289 '(#:configure-flags '("-DENABLE_PIC=TRUE"))
292 (modify-phases %standard-phases
293 (add-before 'configure 'prepare-build
295 (delete-file-recursively "build")
298 (home-page "http://x265.org/")
299 (synopsis "Library for encoding h.265/HEVC video streams")
300 (description "x265 is a H.265 / HEVC video encoder application library,
301 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
302 (license license:gpl2+)))
304 (define-public libass
311 "https://github.com/libass/libass/releases/download/"
312 version "/libass-" version ".tar.xz"))
315 "0b9cj5xfsa7zwlk5m146fhv102v51iqs3rapq0n2xrz30k8p9a7q"))))
316 (build-system gnu-build-system)
318 `(("pkg-config" ,pkg-config)
321 `(("freetype" ,freetype)
323 ("fontconfig" ,fontconfig)
324 ("harfbuzz" ,harfbuzz)
326 (home-page "https://github.com/libass/libass")
327 (synopsis "Subtitle rendering library for the ASS/SSA format")
328 (description "libass is a subtitle rendering library for the
329 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
330 (license license:isc)))
332 (define-public libcaca
335 (version "0.99.beta19")
338 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
342 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
343 (build-system gnu-build-system)
344 (native-inputs `(("pkg-config" ,pkg-config)))
346 `(("freeglut" ,freeglut)
353 (home-page "http://caca.zoy.org/wiki/libcaca")
354 (synopsis "Colour ASCII-art library")
355 (description "libcaca is a graphics library that outputs text instead of
356 pixels, so that it can work on older video cards or text terminals. It
357 supports Unicode, 2048 colors, dithering of color images, and advanced text
359 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
361 (define-public libdca
368 "http://download.videolan.org/pub/videolan/libdca/"
369 version "/libdca-" version ".tar.bz2"))
372 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
373 (build-system gnu-build-system)
374 (home-page "http://www.videolan.org/developers/libdca.html")
375 (synopsis "DTS Coherent Acoustics decoder")
376 (description "libdca is a library for decoding DTS Coherent Acoustics
378 (license license:gpl2+)))
387 "mirror://sourceforge/" name "/" name "/"
388 version "/" name "-" version ".tar.gz"))
391 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
392 (build-system gnu-build-system)
393 (native-inputs `(("pkg-config" ,pkg-config)))
394 (inputs `(("libxv" ,libxv)))
395 (home-page "http://libdv.sourceforge.net/")
396 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
397 (description "The Quasar DV codec (libdv) is a software codec for DV
398 video, the encoding format used by most digital camcorders, typically those
399 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
400 developed according to the official standards for DV video: IEC 61834 and
402 (license license:lgpl2.1+)))
412 "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
415 (base32 "1ndrf136rlw03xag7j1xpmf9015d1h0dpnv6v587jnh6k2a17g12"))))
416 (build-system gnu-build-system)
418 `(("pkg-config" ,pkg-config)))
423 ("libxfixes" ,libxfixes)
427 (modify-phases %standard-phases
429 'build 'fix-dlopen-paths
430 (lambda* (#:key outputs #:allow-other-keys)
431 (let ((out (assoc-ref outputs "out")))
432 (substitute* "va/drm/va_drm_auth_x11.c"
433 (("\"libva-x11\\.so\\.%d\"")
434 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
435 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
436 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
438 (list (string-append "--with-drivers-path="
439 (assoc-ref %build-inputs "mesa") "/lib/dri"))
440 ;; However, we can't write to mesa's store directory, so override the
441 ;; following make variable to install the dummy driver to libva's
442 ;; $prefix/lib/dri directory.
444 (list (string-append "dummy_drv_video_ladir="
445 (assoc-ref %outputs "out") "/lib/dri"))))
446 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
447 (synopsis "Video acceleration library")
448 (description "The main motivation for VA-API (Video Acceleration API) is
449 to enable hardware accelerated video decode/encode at various
450 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
451 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
452 (license license:expat)))
454 (define-public ffmpeg
460 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
464 "0ymg1mkg1n0770gmjfqp79p5ijxq04smfrsrrxc8pjc0y0agyf3f"))))
465 (build-system gnu-build-system)
467 `(("fontconfig" ,fontconfig)
468 ("freetype" ,freetype)
474 ("libbluray" ,libbluray)
476 ("libcdio-paranoia" ,libcdio-paranoia)
477 ("libtheora" ,libtheora)
478 ("libvdpau" ,libvdpau)
479 ("libvorbis" ,libvorbis)
485 ("pulseaudio" ,pulseaudio)
496 ("pkg-config" ,pkg-config)
498 ("python" ,python-2) ; scripts use interpreter python2
502 `(#:test-target "fate"
504 ;; possible additional inputs:
505 ;; --enable-avisynth enable reading of AviSynth script
507 ;; --enable-frei0r enable frei0r video filtering
508 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
509 ;; --enable-libcelt enable CELT decoding via libcelt [no]
510 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
511 ;; and libraw1394 [no]
512 ;; --enable-libfaac enable AAC encoding via libfaac [no]
513 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
514 ;; --enable-libflite enable flite (voice synthesis) support via
516 ;; --enable-libgme enable Game Music Emu via libgme [no]
517 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
518 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
519 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
520 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
521 ;; --enable-libnut enable NUT (de)muxing via libnut,
522 ;; native (de)muxer exists [no]
523 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
524 ;; libopencore-amrnb [no]
525 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
526 ;; libopencore-amrwb [no]
527 ;; --enable-libopencv enable video filtering via libopencv [no]
528 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
530 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
531 ;; --enable-libschroedinger enable Dirac de/encoding via
532 ;; libschroedinger [no]
533 ;; --enable-libshine enable fixed-point MP3 encoding via
535 ;; --enable-libssh enable SFTP protocol via libssh [no]
536 ;; (libssh2 does not work)
537 ;; --enable-libstagefright-h264 enable H.264 decoding via
538 ;; libstagefright [no]
539 ;; --enable-libutvideo enable Ut Video encoding and decoding via
541 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
542 ;; --enable-libvidstab enable video stabilization using
544 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
545 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
546 ;; libvo-amrwbenc [no]
547 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
548 ;; --enable-libxavs enable AVS encoding via xavs [no]
549 ;; --enable-libzmq enable message passing via libzmq [no]
550 ;; --enable-libzvbi enable teletext support via libzvbi [no]
551 ;; --enable-opencl enable OpenCL code
552 '("--enable-avresample"
553 "--enable-gpl" ; enable optional gpl licensed parts
555 "--enable-fontconfig"
562 "--enable-libfreetype"
563 "--enable-libmp3lame"
569 "--enable-libtwolame"
579 "--enable-runtime-cpudetect"
581 ;; Runtime cpu detection is not implemented on
582 ;; MIPS, so we disable some features.
585 "--disable-mipsdspr2"
588 (modify-phases %standard-phases
591 ;; configure does not work followed by "SHELL=..." and
592 ;; "CONFIG_SHELL=..."; set environment variables instead
593 (lambda* (#:key outputs configure-flags #:allow-other-keys)
594 (let ((out (assoc-ref outputs "out")))
595 (substitute* "configure"
596 (("#! /bin/sh") (string-append "#!" (which "sh"))))
597 (setenv "SHELL" (which "bash"))
598 (setenv "CONFIG_SHELL" (which "bash"))
599 (zero? (apply system*
601 (string-append "--prefix=" out)
602 ;; Add $libdir to the RUNPATH of all the binaries.
603 (string-append "--extra-ldflags=-Wl,-rpath="
607 'check 'set-ld-library-path
609 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
611 (let* ((dso (find-files "." "\\.so$"))
612 (path (string-join (map dirname dso) ":")))
613 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
614 (setenv "LD_LIBRARY_PATH" path)
616 (home-page "https://www.ffmpeg.org/")
617 (synopsis "Audio and video framework")
618 (description "FFmpeg is a complete, cross-platform solution to record,
619 convert and stream audio and video. It includes the libavcodec
620 audio/video codec library.")
621 (license license:gpl2+)))
623 (define-public ffmpeg-2.8
629 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
633 "1rhz7rhmhhh8bjcj3dc82haisn3qjbzqlr7k6d6v7064jgn3maiq"))))
635 (substitute-keyword-arguments (package-arguments ffmpeg)
636 ((#:configure-flags flags)
638 (if (string=? flag "--disable-mipsdsp")
639 "--disable-mipsdspr1"
650 "https://download.videolan.org/pub/videolan/vlc/"
651 version "/vlc-" version ".tar.xz"))
654 "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn"))
655 (modules '((guix build utils)))
657 ;; There are two occurrences where __DATE__ and __TIME__ are
658 ;; used to capture the build time and show it to the user.
659 '(substitute* (find-files "." "help\\.c(pp)?$")
660 (("__DATE__") "\"2016\"")
661 (("__TIME__") "\"00:00\"")))))
662 (build-system gnu-build-system)
664 `(("git" ,git) ; needed for a test
665 ("pkg-config" ,pkg-config)))
666 ;; FIXME: Add optional inputs once available.
668 `(("alsa-lib" ,alsa-lib)
672 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
673 ("fontconfig" ,fontconfig)
674 ("freetype" ,freetype)
678 ("libgcrypt" ,libgcrypt)
683 ("libsamplerate" ,libsamplerate)
685 ("libvorbis" ,libvorbis)
686 ("libtheora" ,libtheora)
689 ("libxinerama" ,libxinerama)
696 ("pulseaudio" ,pulseaudio)
697 ("python" ,python-wrapper)
698 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
699 ;("qtbase" ,qtbase) with -std=gnu++11.
700 ;("qtx11extras" ,qtx11extras)
702 ("sdl-image" ,sdl-image)
705 ("xcb-util-keysyms" ,xcb-util-keysyms)))
708 `(;; Gross workaround for <https://trac.videolan.org/vlc/ticket/16907>.
709 ;; In our case, this led to a test failure:
710 ;; test_libvlc_equalizer: libvlc/equalizer.c:122: test_equalizer: Assertion `isnan(libvlc_audio_equalizer_get_amp_at_index (equalizer, u_bands))' failed.
711 "ac_cv_c_fast_math=no"
713 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
714 (assoc-ref %build-inputs "ffmpeg")
715 "/lib")) ;needed for the tests
718 (modify-phases %standard-phases
719 (add-before 'configure 'remove-visual-tests
720 ;; Some of the tests require using the display to test out VLC,
721 ;; which fails in our sandboxed build system
723 (substitute* "test/run_vlc.sh"
724 (("./vlc --ignore-config") "echo"))
726 (add-after 'install 'regenerate-plugin-cache
727 (lambda* (#:key outputs #:allow-other-keys)
728 ;; The 'install-exec-hook' rule in the top-level Makefile.am
729 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
730 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
731 ;; it references. Thus, we first reset the timestamps of all
732 ;; these files, and then regenerate the cache such that the
733 ;; mtimes it includes are always zero instead of being dependent
734 ;; on the build time.
735 (let* ((out (assoc-ref outputs "out"))
736 (pkglibdir (string-append out "/lib/vlc"))
737 (plugindir (string-append pkglibdir "/plugins"))
738 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
739 ;; TODO: Factorize 'reset-timestamps'.
740 (for-each (lambda (file)
741 (let ((s (lstat file)))
742 (unless (eq? (stat:type s) 'symlink)
743 (utime file 0 0 0 0))))
744 (find-files plugindir))
745 (zero? (system* cachegen plugindir))))))))
746 (home-page "https://www.videolan.org/")
747 (synopsis "Audio and video framework")
748 (description "VLC is a cross-platform multimedia player and framework
749 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
750 treaming protocols.")
751 (license license:gpl2+)))
753 (define-public mplayer
760 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
764 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
765 (build-system gnu-build-system)
766 ;; FIXME: Add additional inputs once available.
768 `(("pkg-config" ,pkg-config)))
770 `(("alsa-lib" ,alsa-lib)
771 ("cdparanoia" ,cdparanoia)
773 ("fontconfig" ,fontconfig)
774 ("freetype" ,freetype)
775 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
778 ("libdvdcss" ,libdvdcss)
779 ("libdvdnav" ,libdvdnav)
781 ("libmpeg2" ,libmpeg2)
782 ("libmpg123" ,mpg123) ; audio codec for MP3
784 ("libtheora" ,libtheora)
785 ("libvdpau" ,libvdpau)
786 ("libvorbis" ,libvorbis)
789 ("libxinerama" ,libxinerama)
791 ("libxxf86dga" ,libxxf86dga)
795 ("pulseaudio" ,pulseaudio)
796 ("python" ,python-wrapper)
802 `(#:tests? #f ; no test target
804 (modify-phases %standard-phases
806 ;; configure does not work followed by "SHELL=..." and
807 ;; "CONFIG_SHELL=..."; set environment variables instead
808 (lambda* (#:key inputs outputs #:allow-other-keys)
809 (let ((out (assoc-ref outputs "out"))
810 (libx11 (assoc-ref inputs "libx11")))
811 (substitute* "configure"
812 (("#! /bin/sh") (string-append "#!" (which "sh"))))
813 (setenv "SHELL" (which "bash"))
814 (setenv "CONFIG_SHELL" (which "bash"))
817 (string-append "--extra-cflags=-I"
818 libx11 "/include") ; to detect libx11
819 "--disable-ffmpeg_a" ; disables bundled ffmpeg
820 (string-append "--prefix=" out)
821 ;; Enable runtime cpu detection where supported,
822 ;; and choose a suitable target.
823 ,@(match (or (%current-target-system)
826 '("--enable-runtime-cpudetection"
827 "--target=x86_64-linux"))
829 '("--enable-runtime-cpudetection"
830 "--target=i686-linux"))
832 '("--target=mips3-linux"))
833 (_ (list (string-append
835 (or (%current-target-system)
836 (nix-system->gnu-triplet
837 (%current-system)))))))
838 "--disable-iwmmxt"))))))))
839 (home-page "https://www.mplayerhq.hu/design7/news.html")
840 (synopsis "Audio and video player")
841 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
842 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
843 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
844 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
845 (license license:gpl2)))
854 "https://github.com/mpv-player/mpv/archive/v" version
858 "059zblcj98fhrns1rwa66mf4km68czpam4nnk8q9qny31bx58654"))
859 (file-name (string-append name "-" version ".tar.gz"))))
860 (build-system waf-build-system)
862 `(("perl" ,perl) ; for zsh completion file
863 ("pkg-config" ,pkg-config)
864 ("python-docutils" ,python-docutils)))
865 ;; Missing features: libguess, Wayland, V4L2
867 `(("alsa-lib" ,alsa-lib)
874 ("libbluray" ,libbluray)
877 ("libcdio-paranoia" ,libcdio-paranoia)
878 ("libdvdread" ,libdvdread)
879 ("libdvdnav" ,libdvdnav)
882 ("libvdpau" ,libvdpau)
885 ("libxinerama" ,libxinerama)
886 ("libxrandr" ,libxrandr)
887 ("libxscrnsaver" ,libxscrnsaver)
889 ;; XXX: lua > 5.2 is not currently supported; see
890 ;; waftools/checks/custom.py
894 ("pulseaudio" ,pulseaudio)
897 ("youtube-dl" ,youtube-dl)
901 (modify-phases %standard-phases
903 'configure 'setup-waf
904 (lambda* (#:key inputs #:allow-other-keys)
905 (copy-file (assoc-ref inputs "waf") "waf")
906 (setenv "CC" "gcc"))))
907 #:configure-flags (list "--enable-libmpv-shared"
909 "--disable-build-date")
910 ;; No check function defined.
912 (home-page "https://mpv.io/")
913 (synopsis "Audio and video player")
914 (description "mpv is a general-purpose audio and video player. It is a
915 fork of mplayer2 and MPlayer. It shares some features with the former
916 projects while introducing many more.")
917 (license license:gpl2+)))
919 (define-public gnome-mpv
926 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
927 "/download/v" version "/gnome-mpv-" version
931 "1hn3mpsxbrwf2m0nz4vzji4i6i896y8kqjb9kijqpk04cnrs3fgz"))))
933 `(("intltool" ,intltool)
934 ("pkg-config" ,pkg-config)))
937 ("libepoxy" ,libepoxy)
939 (build-system glib-or-gtk-build-system)
940 (home-page "https://github.com/gnome-mpv/gnome-mpv")
941 (synopsis "GTK+ frontend for the mpv media player")
942 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
943 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
944 access to mpv's powerful playback capabilities.")
945 (license license:gpl3+)))
947 (define-public libvpx
953 (uri (string-append "http://storage.googleapis.com/"
954 "downloads.webmproject.org/releases/webm/"
955 name "-" version ".tar.bz2"))
958 "06d8hqjkfs6wl45qf4pwh1kpbvkx6cwywd5y8d4lgagvjwm0qb0w"))
959 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
960 (build-system gnu-build-system)
963 (modify-phases %standard-phases
965 (lambda* (#:key outputs #:allow-other-keys)
966 (setenv "CONFIG_SHELL" (which "bash"))
967 (let ((out (assoc-ref outputs "out")))
969 (string-append "-Wl,-rpath=" out "/lib"))
970 (zero? (system* "./configure"
973 ;; Limit size to avoid CVE-2015-1258
974 "--size-limit=16384x16384"
975 (string-append "--prefix=" out)))))))
976 #:tests? #f)) ; no check target
980 (synopsis "VP8/VP9 video codec")
981 (description "libvpx is a codec for the VP8/VP9 video compression format.")
982 (license license:bsd-3)
983 (home-page "http://www.webmproject.org/")))
985 (define-public youtube-dl
988 (version "2017.04.03")
991 (uri (string-append "https://yt-dl.org/downloads/"
992 version "/youtube-dl-"
996 "1zfhq20i7xz0djfps39k3yrpdl8ni2yqh43211ma5m40ms78j4yk"))))
997 (build-system python-build-system)
999 ;; The problem here is that the directory for the man page and completion
1000 ;; files is relative, and for some reason, setup.py uses the
1001 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
1002 ;; So, we need pass the prefix directly. In addition, make sure the Bash
1003 ;; completion file is called 'youtube-dl' rather than
1004 ;; 'youtube-dl.bash-completion'.
1005 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1006 #:phases (modify-phases %standard-phases
1007 (add-before 'install 'fix-the-data-directories
1008 (lambda* (#:key outputs #:allow-other-keys)
1009 (let ((prefix (assoc-ref outputs "out")))
1010 (mkdir "bash-completion")
1011 (rename-file "youtube-dl.bash-completion"
1012 "bash-completion/youtube-dl")
1013 (substitute* "setup.py"
1014 (("youtube-dl\\.bash-completion")
1015 "bash-completion/youtube-dl")
1017 (string-append "'" prefix "/etc/"))
1019 (string-append "'" prefix "/share/")))))))))
1020 (synopsis "Download videos from YouTube.com and other sites")
1022 "Youtube-dl is a small command-line program to download videos from
1023 YouTube.com and a few more sites.")
1024 (home-page "https://yt-dl.org")
1025 (license license:public-domain)))
1027 (define-public you-get
1034 "https://github.com/soimort/you-get/releases/download/v"
1035 version "/you-get-" version ".tar.gz"))
1038 "0brkz98lycx8mmxjwmn7jlhqfdbvl0hy070n7skwr1k75kh99q30"))))
1039 (build-system python-build-system)
1044 `(("ffmpeg" ,ffmpeg)))
1045 (synopsis "Download videos, audios, or images from Web sites")
1047 "You-Get is a command-line utility to download media contents (videos,
1048 audio, images) from the Web. It can use either mpv or vlc for playback.")
1049 (home-page "https://you-get.org/")
1050 (license license:expat)))
1052 (define-public libbluray
1058 (uri (string-append "https://download.videolan.org/videolan/"
1059 name "/" version "/"
1060 name "-" version ".tar.bz2"))
1063 "1k3lag4lxi2jjd3zh4wcb5l3hadzm54j5kagh92yzfy76p9svqzp"))))
1064 (build-system gnu-build-system)
1066 `(#:configure-flags '("--disable-bdjava")
1068 (modify-phases %standard-phases
1069 (add-before 'build 'fix-dlopen-paths
1070 (lambda* (#:key inputs #:allow-other-keys)
1071 (let ((libaacs (assoc-ref inputs "libaacs"))
1072 (libbdplus (assoc-ref inputs "libbdplus")))
1073 (substitute* "src/libbluray/disc/aacs.c"
1075 (string-append "\"" libaacs "/lib/libaacs\"")))
1076 (substitute* "src/libbluray/disc/bdplus.c"
1078 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1080 (native-inputs `(("pkg-config" ,pkg-config)))
1082 `(("fontconfig" ,fontconfig)
1083 ("freetype" ,freetype)
1084 ("libaacs" ,libaacs)
1085 ("libbdplus" ,libbdplus)
1086 ("libxml2" ,libxml2)))
1087 (home-page "https://www.videolan.org/developers/libbluray.html")
1088 (synopsis "Blu-Ray Disc playback library")
1090 "libbluray is a library designed for Blu-Ray Disc playback for media
1091 players, like VLC or MPlayer.")
1092 (license license:lgpl2.1+)))
1094 (define-public libdvdread
1100 (uri (string-append "http://download.videolan.org/videolan/"
1101 name "/" version "/"
1102 name "-" version ".tar.bz2"))
1105 "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
1106 (build-system gnu-build-system)
1107 (home-page "http://dvdnav.mplayerhq.hu/")
1108 (synopsis "Library for reading video DVDs")
1110 "Libdvdread provides a simple foundation for reading DVD video
1111 disks. It provides the functionality that is required to access many
1112 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1113 authentication and descrambling (if an external libdvdcss library is
1115 (license license:gpl2+)))
1117 (define-public libdvdnav
1123 (uri (string-append "http://download.videolan.org/videolan/"
1124 name "/" version "/"
1125 name "-" version ".tar.bz2"))
1128 "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
1129 (build-system gnu-build-system)
1131 `(("pkg-config" ,pkg-config)))
1133 `(("libdvdread" ,libdvdread)))
1134 (home-page "http://dvdnav.mplayerhq.hu/")
1135 (synopsis "Library for video DVD navigation features")
1137 "Libdvdnav is a library for developers of multimedia
1138 applications. It allows easy use of sophisticated DVD navigation features
1139 such as DVD menus, multiangle playback and even interactive DVD games. All
1140 this functionality is provided through a simple API which provides the DVD
1141 playback as a single logical stream of blocks, intermitted by special
1142 dvdnav events to report certain conditions. The main usage of libdvdnav is
1143 a loop regularly calling a function to get the next block, surrounded by
1144 additional calls to tell the library of user interaction. The whole
1145 DVD virtual machine and internal playback states are completely
1147 (license license:gpl2+)))
1149 (define-public libdvdnav-4
1157 "http://download.videolan.org/videolan/libdvdnav/libdvdnav-"
1161 "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
1163 `(("pkg-config" ,pkg-config)
1164 ("autoconf" ,autoconf)
1165 ("automake" ,automake)
1166 ("libtool" ,libtool)))
1172 (zero? (system* "autoreconf" "-vif")))
1173 %standard-phases)))))
1175 (define-public libdvdcss
1181 (uri (string-append "http://download.videolan.org/pub/"
1182 name "/" version "/"
1183 name "-" version ".tar.bz2"))
1186 "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
1187 (build-system gnu-build-system)
1188 (home-page "http://www.videolan.org/developers/libdvdcss.html")
1189 (synopsis "Library for accessing DVDs as block devices")
1191 "libdvdcss is a simple library designed for accessing DVDs like a block
1192 device without having to bother about the decryption.")
1193 (license license:gpl2+)))
1195 (define-public srt2vtt
1202 "http://dthompson.us/releases/srt2vtt/srt2vtt-"
1206 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1207 (build-system gnu-build-system)
1209 `(("guile" ,guile-2.0)))
1210 (synopsis "SubRip to WebVTT subtitle converter")
1211 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1212 for use with HTML5 video.")
1213 (home-page "http://dthompson.us/pages/software/srt2vtt")
1214 (license license:gpl3+)))
1216 (define-public avidemux
1223 "mirror://sourceforge/" name "/" name "/" version "/"
1224 name "_" version ".tar.gz"))
1227 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1228 (patches (search-patches "avidemux-install-to-lib.patch"))))
1229 (build-system cmake-build-system)
1231 `(("pkg-config" ,pkg-config)))
1232 ;; FIXME: Once packaged, add libraries not found during the build.
1234 `(("alsa-lib" ,alsa-lib)
1235 ("fontconfig" ,fontconfig)
1236 ("freetype" ,freetype)
1237 ("fribidi" ,fribidi)
1242 ("libvdpau" ,libvdpau)
1243 ("libvorbis" ,libvorbis)
1247 ("pulseaudio" ,pulseaudio)
1248 ("python" ,python-wrapper)
1249 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
1250 ;("qtbase" ,qtbase) with -std=gnu++11.
1251 ;("qttools" ,qttools)
1257 `(#:tests? #f ; no check target
1259 ;; Make sure files inside the included ffmpeg tarball are
1261 (modify-phases %standard-phases
1262 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1264 (with-directory-excursion "avidemux_core/ffmpeg_package"
1265 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1266 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1267 (add-after 'patch-source-shebangs 'repack-ffmpeg
1269 (with-directory-excursion "avidemux_core/ffmpeg_package"
1270 (substitute* "ffmpeg-2.7.6/configure"
1271 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1272 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1273 ;; avoid non-determinism in the archive
1274 "--sort=name" "--mtime=@0"
1275 "--owner=root:0" "--group=root:0")
1276 (delete-file-recursively "ffmpeg-2.7.6"))))
1279 ;; Copy-paste settings from the cmake build system.
1280 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1281 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1283 (lambda* (#:key inputs outputs #:allow-other-keys)
1285 ((out (assoc-ref outputs "out"))
1286 (lib (string-append out "/lib"))
1288 (sdl (assoc-ref inputs "sdl"))
1290 (lambda* (component srcdir #:optional (args '()))
1291 (let ((builddir (string-append "build_" component)))
1293 (with-directory-excursion builddir
1296 (apply system* "cmake"
1297 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1298 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1299 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1300 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1301 "\"-Wl,-rpath=" lib "\"")
1302 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1303 (string-append "-DSDL_INCLUDE_DIR="
1305 (string-append "../" srcdir)
1308 (system* "make" "-j"
1309 (number->string (parallel-job-count)))
1310 (system* "make" "install"))))))))
1312 (and (build_component "core" "avidemux_core")
1313 (build_component "cli" "avidemux/cli")
1314 (build_component "qt4" "avidemux/qt4")
1315 (build_component "plugins_common" "avidemux_plugins"
1316 '("-DPLUGIN_UI=COMMON"))
1317 (build_component "plugins_cli" "avidemux_plugins"
1318 '("-DPLUGIN_UI=CLI"))
1319 (build_component "plugins_qt4" "avidemux_plugins"
1320 '("-DPLUGIN_UI=QT4"))
1321 (build_component "plugins_settings" "avidemux_plugins"
1322 '("-DPLUGIN_UI=SETTINGS")))
1323 ;; Remove .exe and .dll file.
1324 (delete-file-recursively
1325 (string-append out "/share/ADM6_addons")))))
1326 (delete 'install))))
1327 (home-page "http://fixounet.free.fr/avidemux/")
1328 (synopsis "Video editor")
1329 (description "Avidemux is a video editor designed for simple cutting,
1330 filtering and encoding tasks. It supports many file types, including AVI,
1331 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1332 can be automated using projects, job queue and powerful scripting
1334 ;; Software with various licenses is included, see License.txt.
1335 (license license:gpl2+)))
1337 (define-public vapoursynth
1339 (name "vapoursynth")
1344 "https://github.com/vapoursynth/vapoursynth/archive/R"
1346 (file-name (string-append name "-" version ".tar.gz"))
1349 "1g3hc079jw4mz1cmkv2y28pdb556wqc8ql7iravgh1rg8j3f1zi5"))))
1350 (build-system gnu-build-system)
1352 `(("autoconf" ,autoconf)
1353 ("automake" ,automake)
1354 ("cython" ,python-cython)
1355 ("libtool" ,libtool)
1356 ("pkg-config" ,pkg-config)
1360 `(("ffmpeg" ,ffmpeg)
1362 ("tesseract-ocr" ,tesseract-ocr)
1366 (modify-phases %standard-phases
1370 (zero? (system* "sh" "autogen.sh")))))))
1371 (home-page "http://www.vapoursynth.com/")
1372 (synopsis "Video processing framework")
1373 (description "VapourSynth is a C++ library and Python module for video
1374 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1375 multithreading, generalized colorspaces, per frame properties, and videos with
1377 ;; src/core/cpufeatures only allows x86, ARM or PPC
1378 (supported-systems (delete "mips64el-linux" %supported-systems))
1379 ;; As seen from the source files.
1380 (license license:lgpl2.1+)))
1389 "http://downloads.xvid.org/downloads/xvidcore-"
1390 version ".tar.bz2"))
1393 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1394 (build-system gnu-build-system)
1395 (native-inputs `(("yasm" ,yasm)))
1398 (modify-phases %standard-phases
1400 'configure 'pre-configure
1402 (chdir "build/generic")
1403 (substitute* "configure"
1404 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1405 ;; No 'check' target.
1407 (home-page "https://www.xvid.com/")
1408 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1409 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1410 codec library. It uses ASP features such as b-frames, global and quarter
1411 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1412 and custom quantization matrices.")
1413 (license license:gpl2+)))
1415 (define-public livestreamer
1417 (name "livestreamer")
1422 "https://github.com/chrippa/livestreamer/archive/v"
1424 (file-name (string-append "livestreamer-" version ".tar.gz"))
1427 "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
1428 (build-system python-build-system)
1430 '(#:tests? #f)) ; tests rely on external web servers
1432 `(("python-requests" ,python-requests)))
1433 (synopsis "Internet video stream viewer")
1434 (description "Livestreamer is a command-line utility that extracts streams
1435 from various services and pipes them into a video playing application.")
1436 (home-page "http://livestreamer.io/")
1437 (license license:bsd-2)))
1445 (uri (string-append "https://github.com/mltframework/mlt/"
1446 "archive/v" version ".tar.gz"))
1447 (file-name (string-append name "-" version ".tar.gz"))
1450 "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))))
1451 (build-system gnu-build-system)
1453 `(#:tests? #f ; no tests
1454 #:make-flags '("CC=gcc")
1456 (list "--enable-gpl3"
1459 (modify-phases %standard-phases
1461 'configure 'override-LDFLAGS
1462 (lambda* (#:key outputs #:allow-other-keys)
1463 (substitute* "config.mak"
1465 (string-append "LDFLAGS+=-Wl,-rpath="
1466 (assoc-ref outputs "out")
1470 `(("alsa-lib" ,alsa-lib)
1472 ("libxml2" ,libxml2)
1475 ("libsamplerate" ,libsamplerate)
1476 ("pulseaudio" ,pulseaudio)
1480 `(("pkg-config" ,pkg-config)))
1481 (home-page "https://www.mltframework.org/")
1482 (synopsis "Author, manage, and run multitrack audio/video compositions")
1484 "MLT is a multimedia framework, designed and developed for television
1485 broadcasting. It provides a toolkit for broadcasters, video editors, media
1486 players, transcoders, web streamers and many more types of applications. The
1487 functionality of the system is provided via an assortment of ready to use
1488 tools, XML authoring components, and an extensible plug-in based API.")
1489 (license license:lgpl2.1+)))
1491 (define-public v4l-utils
1497 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1498 "/v4l-utils-" version ".tar.bz2"))
1501 "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1"))))
1502 (build-system gnu-build-system)
1505 (list (string-append "--with-udevdir="
1506 (assoc-ref %outputs "out")
1508 "CXXFLAGS=-std=gnu++11")))
1510 `(("pkg-config" ,pkg-config)))
1512 `(("alsa-lib" ,alsa-lib)
1514 ("libjpeg" ,libjpeg)
1518 (synopsis "Realtime video capture utilities for Linux")
1519 (description "The v4l-utils provide a series of libraries and utilities to
1520 be used for realtime video capture via Linux-specific APIs.")
1521 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1522 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1523 (license (list license:lgpl2.1+ license:gpl2))))
1531 (uri (string-append "https://github.com/jp9000/obs-studio"
1532 "/archive/" version ".tar.gz"))
1533 (file-name (string-append name "-" version ".tar.gz"))
1536 "043f8mfdh4ll0hpivpyg3iniirckwsgri0gzamyrba1yhf2c2ibr"))))
1537 (build-system cmake-build-system)
1539 `(#:tests? #f ; no tests
1540 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1544 (modify-phases %standard-phases
1545 (add-after 'unpack 'remove-architecture-specific-instructions
1546 ;; non-Intel platforms fail to build with the architecture
1547 ;; specific compiler flags included by default.
1549 (substitute* "libobs/CMakeLists.txt"
1550 (("if\\(NOT MSVC\\)") "if(MSVC)"))
1554 `(("pkg-config" ,pkg-config)))
1556 `(("alsa-lib" ,alsa-lib)
1560 ("fontconfig" ,fontconfig)
1561 ("freetype" ,freetype)
1563 ("jansson" ,jansson)
1564 ("libx264" ,libx264)
1565 ("libxcomposite" ,libxcomposite)
1567 ("pulseaudio" ,pulseaudio)
1569 ("qtx11extras" ,qtx11extras)
1571 ("v4l-utils" ,v4l-utils)
1573 (synopsis "Live streaming software")
1574 (description "Open Broadcaster Software provides a graphical interface for
1575 video recording and live streaming. OBS supports capturing audio and video
1576 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1578 (home-page "https://obsproject.com")
1579 (license license:gpl2+)))
1581 (define-public libvdpau
1588 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1589 name "-" version ".tar.bz2"))
1592 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1593 (build-system gnu-build-system)
1595 `(("pkg-config" ,pkg-config)))
1597 `(("dri2proto" ,dri2proto)
1598 ("libx11" ,libx11 "out")
1599 ("libxext" ,libxext)))
1600 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1601 (synopsis "Video Decode and Presentation API")
1602 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1603 provides an interface to video decode acceleration and presentation hardware
1604 present in modern GPUs.")
1605 (license (license:x11-style "file://COPYING"))))
1607 (define-public vdpauinfo
1614 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1615 name "-" version ".tar.gz"))
1618 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1619 (build-system gnu-build-system)
1621 `(("pkg-config" ,pkg-config)
1622 ("libx11" ,libx11)))
1624 `(("libvdpau" ,libvdpau)))
1625 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1626 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1627 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1629 (license (license:x11-style "file://COPYING"))))
1631 (define-public recordmydesktop
1633 (name "recordmydesktop")
1637 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1638 version "/recordmydesktop-" version ".tar.gz"))
1641 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
1642 (build-system gnu-build-system)
1643 (inputs `(("popt" ,popt)
1648 ("libxfixes" ,libxfixes)
1649 ("libxdamage" ,libxdamage)
1650 ("libxext" ,libxext)
1651 ("alsa-lib" ,alsa-lib)
1652 ("libvorbis" ,libvorbis)
1653 ("libtheora" ,libtheora)))
1654 (home-page "http://recordmydesktop.sourceforge.net/")
1655 (synopsis "Desktop session video recorder")
1657 "recordMyDesktop is a command-line tool that captures the activity in
1658 your graphical desktop and encodes it as a video. This is a useful tool for
1659 making @dfn{screencasts}.")
1660 (license license:gpl2+)))
1662 (define-public libsmpeg
1669 (url "svn://svn.icculus.org/smpeg/trunk/")
1670 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
1673 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
1674 (build-system gnu-build-system)
1676 `(#:phases (modify-phases %standard-phases
1677 (add-after 'unpack 'autogen.sh
1679 (zero? (system* "sh" "autogen.sh")))))))
1681 `(("autoconf" ,autoconf)
1682 ("automake" ,automake)))
1685 (home-page "http://icculus.org/smpeg/")
1686 (synopsis "SDL MPEG decoding library")
1688 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
1689 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
1690 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
1691 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
1692 and MPEG system streams.")
1693 (license (list license:expat
1698 (define-public libbdplus
1705 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libbdplus/"
1706 version "/" name "-" version ".tar.bz2"))
1708 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
1710 `(("libgcrypt" ,libgcrypt)))
1711 (build-system gnu-build-system)
1712 (home-page "http://www.videolan.org/developers/libbdplus.html")
1713 (synopsis "Library for decrypting certain Blu-Ray discs")
1714 (description "libbdplus is a library which implements the BD+ System
1716 (license license:lgpl2.1+)))
1718 (define-public libaacs
1725 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libaacs/"
1726 version "/" name "-" version ".tar.bz2"))
1728 (base32 "1s5v075hnbs57995r6lljm79wgrip3gnyf55a0y7bja75jh49hwm"))))
1730 `(("libgcrypt" ,libgcrypt)))
1734 (build-system gnu-build-system)
1735 (home-page "http://www.videolan.org/developers/libaacs.html")
1736 (synopsis "Library for decrypting certain Blu-Ray discs")
1737 (description "libaacs is a library which implements the Advanced Access
1738 Content System specification.")
1739 (license license:lgpl2.1+)))
1741 (define-public mps-youtube
1743 (name "mps-youtube")
1748 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
1749 "archive/v" version ".tar.gz"))
1750 (file-name (string-append name "-" version ".tar.gz"))
1753 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
1754 (build-system python-build-system)
1756 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
1757 ;; test suite results differ depending on the country and also introduce
1758 ;; non-determinism in the tests.
1759 ;; https://github.com/mps-youtube/mps-youtube/issues/556
1762 `(("python-pafy" ,python-pafy)
1763 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
1764 (home-page "https://github.com/mps-youtube/mps-youtube")
1765 (synopsis "Terminal based YouTube player and downloader")
1767 "@code{mps-youtube} is based on mps, a terminal based program to
1768 search, stream and download music. This implementation uses YouTube as
1769 a source of content and can play and download video as well as audio.
1770 It can use either mpv or mplayer for playback, and for conversion of
1771 formats ffmpeg or libav is used. Users should install one of the
1772 supported players in addition to this package.")
1773 (license license:gpl3+)))
1775 (define-public handbrake
1781 (uri (string-append "https://handbrake.fr/rotation.php?file="
1782 "HandBrake-" version ".tar.bz2"))
1783 (file-name (string-append "handbrake-" version ".tar.bz2"))
1786 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
1787 (patches (search-patches "handbrake-pkg-config-path.patch"))
1788 (modules '((guix build utils)))
1790 ;; Remove bundled libraries and source not necessary for
1791 ;; running under a GNU environment.
1793 (for-each delete-file-recursively '("contrib" "macosx" "win"))
1795 (build-system glib-or-gtk-build-system)
1797 `(("automake" ,automake) ;gui subpackage must be bootstrapped
1798 ("autoconf" ,autoconf)
1799 ("curl" ,curl) ;not actually used, but tested for
1800 ("intltool" ,intltool)
1801 ("libtool" ,libtool)
1802 ("pkg-config" ,pkg-config)
1803 ("python" ,python-2))) ;for configuration
1806 ("dbus-glib" ,dbus-glib)
1808 ("fontconfig" ,fontconfig)
1809 ("freetype" ,freetype)
1811 ("gstreamer" ,gstreamer)
1812 ("gst-plugins-base" ,gst-plugins-base)
1816 ("libbluray" ,libbluray)
1817 ("libdvdnav" ,libdvdnav)
1818 ("libdvdread" ,libdvdread)
1819 ("libgudev" ,libgudev)
1820 ("libmpeg2" ,libmpeg2)
1821 ("libnotify" ,libnotify)
1823 ("libsamplerate" ,libsamplerate)
1824 ("libtheora" ,libtheora)
1825 ("libvorbis" ,libvorbis)
1827 ("libxml2" ,libxml2)
1828 ("libx264" ,libx264)
1832 `(#:tests? #f ;tests require Ruby and claim to be unsupported
1834 (modify-phases %standard-phases
1835 (add-before 'patch-source-shebangs 'bootstrap-gtk
1836 ;; Run bootstrap ahead of time so that shebangs get patched.
1838 (setenv "CONFIG_SHELL" (which "sh"))
1839 (setenv "NOCONFIGURE" "1")
1840 ;; Patch the Makefile so that it doesn't bootstrap again.
1841 (substitute* "gtk/module.rules"
1842 ((".*autogen\\.sh.*") ""))
1843 (zero? (system* "sh" "./gtk/autogen.sh"))))
1844 (add-before 'configure 'disable-contrib
1846 (substitute* "make/include/main.defs"
1847 ;; Disable unconditional inclusion of some "contrib"
1848 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
1849 ;; and libbluray), which would lead to fetching and
1850 ;; building of these libraries. Use our own instead.
1851 (("MODULES \\+= contrib") "# MODULES += contrib"))
1853 (add-before 'configure 'fix-x265-linking
1855 (substitute* "test/module.defs"
1856 ;; Fix missing library during linking error
1857 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
1860 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1861 ;; 'configure' is not an autoconf-generated script, and
1862 ;; errors on unrecognized arguments,
1863 ;; e.g. --enable-fast-install
1864 (let ((out (assoc-ref outputs "out")))
1865 (zero? (apply system* "./configure"
1866 (string-append "--prefix=" out)
1867 (or configure-flags '()))))))
1868 (add-after 'configure 'chdir-build
1869 (lambda _ (chdir "./build") #t)))))
1870 (home-page "https://handbrake.fr")
1871 (synopsis "Video transcoder")
1873 "HandBrake is a tool for converting video from any format to a selection
1874 of modern, widely supported codecs.")
1875 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
1876 (license (list license:gpl2+ license:bsd-3))))
1878 (define-public openh264
1884 (uri (string-append "https://github.com/cisco/"
1885 name "/archive/v" version ".tar.gz"))
1886 (file-name (string-append name "-" version ".tar.gz"))
1889 "1ix2fhk62i4q4kbnkl0gfk4x53vxqavsn0pck1pashr566zhglv5"))))
1890 (build-system gnu-build-system)
1893 ("python" ,python)))
1895 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1896 #:test-target "test"
1897 #:phases (modify-phases %standard-phases
1898 ;; no configure script
1899 (delete 'configure))))
1900 (home-page "http://www.openh264.org/")
1901 (synopsis "H264 decoder library")
1903 "Openh264 is a library which can decode H264 video streams.")
1904 (license license:bsd-2)))
1906 (define-public libmp4v2
1913 ;; XXX: The new location of upstream is uncertain and will become relevant the
1914 ;; moment when the googlecode archive shuts down. It is past the date it
1915 ;; should've been turned off. I tried to communicate with upstream, but this
1916 ;; wasn't very responsive and not very helpful. The short summary is, it is
1917 ;; chaos when it comes to the amount of forks and only time will tell where
1918 ;; the new upstream location is.
1919 (uri (string-append "https://storage.googleapis.com/google-"
1920 "code-archive-downloads/v2/"
1921 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
1922 (file-name (string-append name "-" version ".tar.bz2"))
1925 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
1926 (build-system gnu-build-system)
1928 "static")) ; 3.7MiB .a file
1931 (modify-phases %standard-phases
1932 (add-after 'unpack 'remove-dates
1934 ;; Make the build reproducible.
1935 (substitute* "configure"
1936 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
1937 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
1939 (add-after 'install 'move-static-libraries
1940 (lambda* (#:key outputs #:allow-other-keys)
1941 ;; Move static libraries to the "static" output.
1942 (let* ((out (assoc-ref outputs "out"))
1943 (lib (string-append out "/lib"))
1944 (static (assoc-ref outputs "static"))
1945 (slib (string-append static "/lib")))
1947 (for-each (lambda (file)
1948 (install-file file slib)
1950 (find-files lib "\\.a$"))
1953 `(("help2man" ,help2man)
1954 ("dejagnu" ,dejagnu)))
1955 (home-page "https://code.google.com/archive/p/mp4v2/")
1956 (synopsis "API to create and modify mp4 files")
1958 "The MP4v2 library provides an API to create and modify mp4 files as defined by
1959 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
1960 file format that has been used as a multimedia file format in a variety of platforms and
1961 applications. It is a very powerful and extensible format that can accommodate
1962 practically any type of media.")
1963 (license license:mpl1.1)))