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>
18 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
19 ;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
20 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
21 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages video)
39 #:use-module (ice-9 match)
40 #:use-module (srfi srfi-1)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix utils)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix svn-download)
47 #:use-module (guix build-system cmake)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system glib-or-gtk)
50 #:use-module (guix build-system python)
51 #:use-module (guix build-system waf)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages algebra)
54 #:use-module (gnu packages audio)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages avahi)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages bison)
59 #:use-module (gnu packages cdrom)
60 #:use-module (gnu packages cmake)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages cpp)
63 #:use-module (gnu packages curl)
64 #:use-module (gnu packages databases)
65 #:use-module (gnu packages dejagnu)
66 #:use-module (gnu packages elf)
67 #:use-module (gnu packages flex)
68 #:use-module (gnu packages fontutils)
69 #:use-module (gnu packages freedesktop)
70 #:use-module (gnu packages fribidi)
71 #:use-module (gnu packages gettext)
72 #:use-module (gnu packages ghostscript)
73 #:use-module (gnu packages gl)
74 #:use-module (gnu packages glib)
75 #:use-module (gnu packages guile)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages gnupg)
78 #:use-module (gnu packages gstreamer)
79 #:use-module (gnu packages gtk)
80 #:use-module (gnu packages image)
81 #:use-module (gnu packages imagemagick)
82 #:use-module (gnu packages linux)
83 #:use-module (gnu packages lua)
84 #:use-module (gnu packages m4)
85 #:use-module (gnu packages man)
86 #:use-module (gnu packages mp3)
87 #:use-module (gnu packages ncurses)
88 #:use-module (gnu packages ocr)
89 #:use-module (gnu packages perl)
90 #:use-module (gnu packages pkg-config)
91 #:use-module (gnu packages popt)
92 #:use-module (gnu packages pulseaudio)
93 #:use-module (gnu packages python)
94 #:use-module (gnu packages qt)
95 #:use-module (gnu packages sdl)
96 #:use-module (gnu packages ssh)
97 #:use-module (gnu packages texinfo)
98 #:use-module (gnu packages textutils)
99 #:use-module (gnu packages tls)
100 #:use-module (gnu packages version-control)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages webkit)
103 #:use-module (gnu packages wxwidgets)
104 #:use-module (gnu packages xdisorg)
105 #:use-module (gnu packages xiph)
106 #:use-module (gnu packages xml)
107 #:use-module (gnu packages xorg)
108 #:use-module (gnu packages assembly)
109 #:use-module (gnu packages zip))
117 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
118 version "/" name "-" version ".tar.gz"))
121 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
122 (build-system gnu-build-system)
124 `(("makeinfo" ,texinfo)))
126 `(("ncurses" ,ncurses)))
129 (modify-phases %standard-phases
131 (lambda* (#:key build inputs outputs #:allow-other-keys)
132 ;; This old `configure' script doesn't support
133 ;; variables passed as arguments.
134 (let ((out (assoc-ref outputs "out"))
135 (ncurses (assoc-ref inputs "ncurses")))
136 (setenv "CONFIG_SHELL" (which "bash"))
137 (zero? (system* "./configure"
138 (string-append "--prefix=" out)
139 (string-append "--build=" build)
140 ;; The ancient config.guess is unable to
141 ;; guess the host triplet on mips64el.
142 ,@(if (string=? "mips64el-linux"
144 '("--host=mips64el-unknown-linux-gnu")
146 ;; The same is also true with aarch64.
147 ,@(if (string=? "aarch64-linux"
149 '("--host=aarch64-unknown-linux-gnu")
151 (string-append "--with-ncurses="
153 (home-page "http://aa-project.sourceforge.net/aalib/")
154 (synopsis "ASCII-art library")
156 "AA-lib is a low level gfx library which does not require graphics device.
157 In fact, there is no graphical output possible. AA-lib replaces those
158 old-fashioned output methods with powerful ascii-art renderer.")
159 (license license:lgpl2.0+)))
161 (define-public liba52
168 ;; A mirror://sourceforge URI doesn't work, presumably
169 ;; because the SourceForge project is misconfigured.
170 "http://liba52.sourceforge.net/files/a52dec-" version
174 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
175 (patches (search-patches "liba52-enable-pic.patch"
176 "liba52-set-soname.patch"
177 "liba52-use-mtune-not-mcpu.patch"
178 "liba52-link-with-libm.patch"))))
179 (build-system gnu-build-system)
180 ;; XXX We need to run ./bootstrap because of the build system fixes above.
182 `(("autoconf" ,autoconf)
183 ("automake" ,automake)
184 ("libtool" ,libtool)))
185 (arguments `(#:configure-flags '("--enable-shared")
187 (modify-phases %standard-phases
188 ;; XXX We need to run ./bootstrap because of the build
189 ;; system fixes above.
192 (lambda _ (zero? (system* "sh" "bootstrap")))))))
193 (home-page "http://liba52.sourceforge.net/")
194 (synopsis "ATSC A/52 stream decoder")
195 (description "liba52 is a library for decoding ATSC A/52 streams. The
196 A/52 standard is used in a variety of applications, including digital
197 television and DVD. It is also known as AC-3.")
198 (license license:gpl2+)))
200 (define-public libmpeg2
206 ;; A mirror://sourceforge URI doesn't work, presumably
207 ;; because the SourceForge project is misconfigured.
208 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
209 name "-" version ".tar.gz"))
212 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
220 (build-system gnu-build-system)
221 (home-page "http://libmpeg2.sourceforge.net/")
222 (synopsis "MPEG1 and MPEG2 video decoder library")
224 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
225 (license license:gpl2+)))
227 (define-public libx264
230 (version "20170316-2245")
233 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
234 "x264-snapshot-" version ".tar.bz2"))
237 "1s1nnvl3axz38sv4g09skijl6k9mbbngbb1nsh26w4dr2w2gyzad"))))
238 (build-system gnu-build-system)
240 `(("pkg-config" ,pkg-config)
242 ;; TODO: Add gpac input
244 `(#:tests? #f ;no check target
245 #:configure-flags '("--enable-shared"
246 ;; Don't build the command-line program. If we
247 ;; want it later, we should do so in a different
248 ;; package to avoid a circular dependency (the x264
249 ;; program depends on ffmpeg and ffmpeg depends on
253 ;; On MIPS, we must pass "--disable-asm" or else
254 ;; configure fails after printing: "You specified a
255 ;; pre-MSA CPU in your CFLAGS. If you really want
256 ;; to run on such a CPU, configure with
258 ,@(if (string-prefix? "mips"
259 (or (%current-target-system)
263 (home-page "https://www.videolan.org/developers/x264.html")
264 (synopsis "H.264 video coding library")
265 (description "libx264 is an advanced encoding library for creating
266 H.264 (MPEG-4 AVC) video streams.")
267 (license (list license:gpl2+ ;most files
268 license:isc ;common/x86/x86inc.asm
269 license:lgpl2.1+ ;extras/getopt.c
270 license:bsd-3 ;extras/inttypes.h
271 (license:non-copyleft ;extras/cl*.h
273 "See extras/cl.h in the distribution.")))))
282 (uri (string-append "https://download.videolan.org/videolan/x265/"
283 "x265_" version ".tar.gz"))
286 "0afp0xlk0fb4q6j4sh3hyvjnjccdp61sn21zg3fyqvwgswcafalw"))
287 (modules '((guix build utils)))
289 '(delete-file-recursively "source/compat/getopt"))))
290 (build-system cmake-build-system)
292 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
293 ;; Currently the source code doesn't check for aarch64
294 ,@(if (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))
295 '(#:configure-flags '("-DENABLE_PIC=TRUE"))
298 (modify-phases %standard-phases
299 (add-before 'configure 'prepare-build
301 (delete-file-recursively "build")
304 (home-page "http://x265.org/")
305 (synopsis "Library for encoding h.265/HEVC video streams")
306 (description "x265 is a H.265 / HEVC video encoder application library,
307 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
308 (license license:gpl2+)))
310 (define-public libass
317 "https://github.com/libass/libass/releases/download/"
318 version "/libass-" version ".tar.xz"))
321 "0b9cj5xfsa7zwlk5m146fhv102v51iqs3rapq0n2xrz30k8p9a7q"))))
322 (build-system gnu-build-system)
324 `(("pkg-config" ,pkg-config)
327 `(("freetype" ,freetype)
329 ("fontconfig" ,fontconfig)
330 ("harfbuzz" ,harfbuzz)
332 (home-page "https://github.com/libass/libass")
333 (synopsis "Subtitle rendering library for the ASS/SSA format")
334 (description "libass is a subtitle rendering library for the
335 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
336 (license license:isc)))
338 (define-public libcaca
341 (version "0.99.beta19")
344 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
348 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
349 (build-system gnu-build-system)
350 (native-inputs `(("pkg-config" ,pkg-config)))
352 `(("freeglut" ,freeglut)
359 (home-page "http://caca.zoy.org/wiki/libcaca")
360 (synopsis "Colour ASCII-art library")
361 (description "libcaca is a graphics library that outputs text instead of
362 pixels, so that it can work on older video cards or text terminals. It
363 supports Unicode, 2048 colors, dithering of color images, and advanced text
365 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
367 (define-public libdca
374 "https://download.videolan.org/pub/videolan/libdca/"
375 version "/libdca-" version ".tar.bz2"))
378 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
379 (build-system gnu-build-system)
380 (home-page "https://www.videolan.org/developers/libdca.html")
381 (synopsis "DTS Coherent Acoustics decoder")
382 (description "libdca is a library for decoding DTS Coherent Acoustics
384 (license license:gpl2+)))
393 "mirror://sourceforge/" name "/" name "/"
394 version "/" name "-" version ".tar.gz"))
397 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
398 (build-system gnu-build-system)
399 (native-inputs `(("pkg-config" ,pkg-config)))
400 (inputs `(("libxv" ,libxv)))
401 (home-page "http://libdv.sourceforge.net/")
402 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
403 (description "The Quasar DV codec (libdv) is a software codec for DV
404 video, the encoding format used by most digital camcorders, typically those
405 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
406 developed according to the official standards for DV video: IEC 61834 and
408 (license license:lgpl2.1+)))
418 "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
421 (base32 "0wswfznj93jpnxhc3jwdk5j3pmyki0rs6k9vk4vnzds0dddximf1"))))
422 (build-system gnu-build-system)
424 `(("pkg-config" ,pkg-config)))
429 ("libxfixes" ,libxfixes)
433 (modify-phases %standard-phases
435 'build 'fix-dlopen-paths
436 (lambda* (#:key outputs #:allow-other-keys)
437 (let ((out (assoc-ref outputs "out")))
438 (substitute* "va/drm/va_drm_auth_x11.c"
439 (("\"libva-x11\\.so\\.%d\"")
440 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
441 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
442 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
444 (list (string-append "--with-drivers-path="
445 (assoc-ref %build-inputs "mesa") "/lib/dri"))
446 ;; However, we can't write to mesa's store directory, so override the
447 ;; following make variable to install the dummy driver to libva's
448 ;; $prefix/lib/dri directory.
450 (list (string-append "dummy_drv_video_ladir="
451 (assoc-ref %outputs "out") "/lib/dri"))))
452 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
453 (synopsis "Video acceleration library")
454 (description "The main motivation for VA-API (Video Acceleration API) is
455 to enable hardware accelerated video decode/encode at various
456 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
457 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
458 (license license:expat)))
460 (define-public ffmpeg
466 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
470 "0bwgm6z6k3khb91qh9xv15inykkfchpkm0lcdckkxhkacpyaf0mp"))))
471 (build-system gnu-build-system)
473 `(("fontconfig" ,fontconfig)
474 ("freetype" ,freetype)
480 ("libbluray" ,libbluray)
482 ("libcdio-paranoia" ,libcdio-paranoia)
483 ("libtheora" ,libtheora)
484 ("libvdpau" ,libvdpau)
485 ("libvorbis" ,libvorbis)
491 ("pulseaudio" ,pulseaudio)
502 ("pkg-config" ,pkg-config)
504 ("python" ,python-2) ; scripts use interpreter python2
508 `(#:test-target "fate"
510 ;; possible additional inputs:
511 ;; --enable-avisynth enable reading of AviSynth script
513 ;; --enable-frei0r enable frei0r video filtering
514 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
515 ;; --enable-libcelt enable CELT decoding via libcelt [no]
516 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
517 ;; and libraw1394 [no]
518 ;; --enable-libfaac enable AAC encoding via libfaac [no]
519 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
520 ;; --enable-libflite enable flite (voice synthesis) support via
522 ;; --enable-libgme enable Game Music Emu via libgme [no]
523 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
524 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
525 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
526 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
527 ;; --enable-libnut enable NUT (de)muxing via libnut,
528 ;; native (de)muxer exists [no]
529 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
530 ;; libopencore-amrnb [no]
531 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
532 ;; libopencore-amrwb [no]
533 ;; --enable-libopencv enable video filtering via libopencv [no]
534 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
536 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
537 ;; --enable-libschroedinger enable Dirac de/encoding via
538 ;; libschroedinger [no]
539 ;; --enable-libshine enable fixed-point MP3 encoding via
541 ;; --enable-libssh enable SFTP protocol via libssh [no]
542 ;; (libssh2 does not work)
543 ;; --enable-libstagefright-h264 enable H.264 decoding via
544 ;; libstagefright [no]
545 ;; --enable-libutvideo enable Ut Video encoding and decoding via
547 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
548 ;; --enable-libvidstab enable video stabilization using
550 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
551 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
552 ;; libvo-amrwbenc [no]
553 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
554 ;; --enable-libxavs enable AVS encoding via xavs [no]
555 ;; --enable-libzmq enable message passing via libzmq [no]
556 ;; --enable-libzvbi enable teletext support via libzvbi [no]
557 ;; --enable-opencl enable OpenCL code
558 '("--enable-avresample"
559 "--enable-gpl" ; enable optional gpl licensed parts
561 "--enable-fontconfig"
568 "--enable-libfreetype"
569 "--enable-libmp3lame"
575 "--enable-libtwolame"
584 "--enable-runtime-cpudetect"
586 ;; Runtime cpu detection is not implemented on
587 ;; MIPS, so we disable some features.
590 "--disable-mipsdspr2"
593 (modify-phases %standard-phases
596 ;; configure does not work followed by "SHELL=..." and
597 ;; "CONFIG_SHELL=..."; set environment variables instead
598 (lambda* (#:key outputs configure-flags #:allow-other-keys)
599 (let ((out (assoc-ref outputs "out")))
600 (substitute* "configure"
601 (("#! /bin/sh") (string-append "#!" (which "sh"))))
602 (setenv "SHELL" (which "bash"))
603 (setenv "CONFIG_SHELL" (which "bash"))
604 (zero? (apply system*
606 (string-append "--prefix=" out)
607 ;; Add $libdir to the RUNPATH of all the binaries.
608 (string-append "--extra-ldflags=-Wl,-rpath="
612 'check 'set-ld-library-path
614 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
616 (let* ((dso (find-files "." "\\.so$"))
617 (path (string-join (map dirname dso) ":")))
618 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
619 (setenv "LD_LIBRARY_PATH" path)
621 (home-page "https://www.ffmpeg.org/")
622 (synopsis "Audio and video framework")
623 (description "FFmpeg is a complete, cross-platform solution to record,
624 convert and stream audio and video. It includes the libavcodec
625 audio/video codec library.")
626 (license license:gpl2+)))
628 (define-public ffmpeg-2.8
634 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
638 "1rhz7rhmhhh8bjcj3dc82haisn3qjbzqlr7k6d6v7064jgn3maiq"))))
640 (substitute-keyword-arguments (package-arguments ffmpeg)
641 ((#:configure-flags flags)
643 (if (string=? flag "--disable-mipsdsp")
644 "--disable-mipsdspr1"
655 "https://download.videolan.org/pub/videolan/vlc/"
656 version "/vlc-" version ".tar.xz"))
659 "1a22b913p2227ljz89c4fgjlyln5gcz8z58w32r0wh4srnnd60y4"))))
660 (build-system gnu-build-system)
662 `(("git" ,git) ; needed for a test
663 ("pkg-config" ,pkg-config)))
664 ;; FIXME: Add optional inputs once available.
666 `(("alsa-lib" ,alsa-lib)
670 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
671 ("fontconfig" ,fontconfig)
672 ("freetype" ,freetype)
676 ("libgcrypt" ,libgcrypt)
681 ("libsamplerate" ,libsamplerate)
683 ("libvorbis" ,libvorbis)
684 ("libtheora" ,libtheora)
687 ("libxinerama" ,libxinerama)
694 ("pulseaudio" ,pulseaudio)
695 ("python" ,python-wrapper)
696 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
697 ;("qtbase" ,qtbase) with -std=gnu++11.
698 ;("qtx11extras" ,qtx11extras)
700 ("sdl-image" ,sdl-image)
703 ("xcb-util-keysyms" ,xcb-util-keysyms)))
706 `(;; Gross workaround for <https://trac.videolan.org/vlc/ticket/16907>.
707 ;; In our case, this led to a test failure:
708 ;; test_libvlc_equalizer: libvlc/equalizer.c:122: test_equalizer: Assertion `isnan(libvlc_audio_equalizer_get_amp_at_index (equalizer, u_bands))' failed.
709 "ac_cv_c_fast_math=no"
711 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
712 (assoc-ref %build-inputs "ffmpeg")
713 "/lib")) ;needed for the tests
716 (modify-phases %standard-phases
717 (add-before 'configure 'remove-visual-tests
718 ;; Some of the tests require using the display to test out VLC,
719 ;; which fails in our sandboxed build system
721 (substitute* "test/run_vlc.sh"
722 (("./vlc --ignore-config") "echo"))
724 (add-after 'install 'regenerate-plugin-cache
725 (lambda* (#:key outputs #:allow-other-keys)
726 ;; The 'install-exec-hook' rule in the top-level Makefile.am
727 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
728 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
729 ;; it references. Thus, we first reset the timestamps of all
730 ;; these files, and then regenerate the cache such that the
731 ;; mtimes it includes are always zero instead of being dependent
732 ;; on the build time.
733 (let* ((out (assoc-ref outputs "out"))
734 (pkglibdir (string-append out "/lib/vlc"))
735 (plugindir (string-append pkglibdir "/plugins"))
736 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
737 ;; TODO: Factorize 'reset-timestamps'.
738 (for-each (lambda (file)
739 (let ((s (lstat file)))
740 (unless (eq? (stat:type s) 'symlink)
741 (utime file 0 0 0 0))))
742 (find-files plugindir))
743 (zero? (system* cachegen plugindir))))))))
744 (home-page "https://www.videolan.org/")
745 (synopsis "Audio and video framework")
746 (description "VLC is a cross-platform multimedia player and framework
747 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
748 treaming protocols.")
749 (license license:gpl2+)))
751 (define-public mplayer
758 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
762 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
763 (build-system gnu-build-system)
764 ;; FIXME: Add additional inputs once available.
766 `(("pkg-config" ,pkg-config)))
768 `(("alsa-lib" ,alsa-lib)
769 ("cdparanoia" ,cdparanoia)
771 ("fontconfig" ,fontconfig)
772 ("freetype" ,freetype)
773 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
776 ("libdvdcss" ,libdvdcss)
777 ("libdvdnav" ,libdvdnav)
779 ("libmpeg2" ,libmpeg2)
780 ("libmpg123" ,mpg123) ; audio codec for MP3
782 ("libtheora" ,libtheora)
783 ("libvdpau" ,libvdpau)
784 ("libvorbis" ,libvorbis)
787 ("libxinerama" ,libxinerama)
789 ("libxxf86dga" ,libxxf86dga)
793 ("pulseaudio" ,pulseaudio)
794 ("python" ,python-wrapper)
800 `(#:tests? #f ; no test target
802 (modify-phases %standard-phases
804 ;; configure does not work followed by "SHELL=..." and
805 ;; "CONFIG_SHELL=..."; set environment variables instead
806 (lambda* (#:key inputs outputs #:allow-other-keys)
807 (let ((out (assoc-ref outputs "out"))
808 (libx11 (assoc-ref inputs "libx11")))
809 (substitute* "configure"
810 (("#! /bin/sh") (string-append "#!" (which "sh"))))
811 (setenv "SHELL" (which "bash"))
812 (setenv "CONFIG_SHELL" (which "bash"))
815 (string-append "--extra-cflags=-I"
816 libx11 "/include") ; to detect libx11
817 "--disable-ffmpeg_a" ; disables bundled ffmpeg
818 (string-append "--prefix=" out)
819 ;; Enable runtime cpu detection where supported,
820 ;; and choose a suitable target.
821 ,@(match (or (%current-target-system)
824 '("--enable-runtime-cpudetection"
825 "--target=x86_64-linux"))
827 '("--enable-runtime-cpudetection"
828 "--target=i686-linux"))
830 '("--target=mips3-linux"))
831 (_ (list (string-append
833 (or (%current-target-system)
834 (nix-system->gnu-triplet
835 (%current-system)))))))
836 "--disable-iwmmxt"))))))))
837 (home-page "https://www.mplayerhq.hu/design7/news.html")
838 (synopsis "Audio and video player")
839 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
840 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
841 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
842 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
843 (license license:gpl2)))
852 "https://github.com/mpv-player/mpv/archive/v" version
856 "1khb7c4fdj1aak46lwyb3lq14w5jpxzws0zp6bdc87ljsvx3yhh7"))
857 (file-name (string-append name "-" version ".tar.gz"))))
858 (build-system waf-build-system)
860 `(("perl" ,perl) ; for zsh completion file
861 ("pkg-config" ,pkg-config)
862 ("python-docutils" ,python-docutils)))
863 ;; Missing features: libguess, Wayland, V4L2
865 `(("alsa-lib" ,alsa-lib)
872 ("libbluray" ,libbluray)
875 ("libcdio-paranoia" ,libcdio-paranoia)
876 ("libdvdread" ,libdvdread)
877 ("libdvdnav" ,libdvdnav)
880 ("libvdpau" ,libvdpau)
883 ("libxinerama" ,libxinerama)
884 ("libxrandr" ,libxrandr)
885 ("libxscrnsaver" ,libxscrnsaver)
887 ;; XXX: lua > 5.2 is not currently supported; see
888 ;; waftools/checks/custom.py
892 ("pulseaudio" ,pulseaudio)
895 ("youtube-dl" ,youtube-dl)
899 (modify-phases %standard-phases
901 'configure 'setup-waf
902 (lambda* (#:key inputs #:allow-other-keys)
903 (copy-file (assoc-ref inputs "waf") "waf")
904 (setenv "CC" "gcc"))))
905 #:configure-flags (list "--enable-libmpv-shared"
910 "--disable-build-date")
911 ;; No check function defined.
913 (home-page "https://mpv.io/")
914 (synopsis "Audio and video player")
915 (description "mpv is a general-purpose audio and video player. It is a
916 fork of mplayer2 and MPlayer. It shares some features with the former
917 projects while introducing many more.")
918 (license license:gpl2+)))
920 (define-public gnome-mpv
927 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
928 "/download/v" version "/gnome-mpv-" version
932 "1hn3mpsxbrwf2m0nz4vzji4i6i896y8kqjb9kijqpk04cnrs3fgz"))))
934 `(("intltool" ,intltool)
935 ("pkg-config" ,pkg-config)))
938 ("libepoxy" ,libepoxy)
940 (build-system glib-or-gtk-build-system)
941 (home-page "https://github.com/gnome-mpv/gnome-mpv")
942 (synopsis "GTK+ frontend for the mpv media player")
943 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
944 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
945 access to mpv's powerful playback capabilities.")
946 (license license:gpl3+)))
948 (define-public libvpx
954 (uri (string-append "http://storage.googleapis.com/"
955 "downloads.webmproject.org/releases/webm/"
956 name "-" version ".tar.bz2"))
959 "06d8hqjkfs6wl45qf4pwh1kpbvkx6cwywd5y8d4lgagvjwm0qb0w"))
960 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
961 (build-system gnu-build-system)
964 (modify-phases %standard-phases
966 (lambda* (#:key outputs #:allow-other-keys)
967 (setenv "CONFIG_SHELL" (which "bash"))
968 (let ((out (assoc-ref outputs "out")))
970 (string-append "-Wl,-rpath=" out "/lib"))
971 (zero? (system* "./configure"
974 ;; Limit size to avoid CVE-2015-1258
975 "--size-limit=16384x16384"
976 (string-append "--prefix=" out)))))))
977 #:tests? #f)) ; no check target
981 (synopsis "VP8/VP9 video codec")
982 (description "libvpx is a codec for the VP8/VP9 video compression format.")
983 (license license:bsd-3)
984 (home-page "http://www.webmproject.org/")))
986 (define-public youtube-dl
989 (version "2017.05.07")
992 (uri (string-append "https://yt-dl.org/downloads/"
993 version "/youtube-dl-"
997 "1q3b9xkbk1lmy1wxm1jcnmaj70sdksqbc8zsqxz6b6z4nmv8qc25"))))
998 (build-system python-build-system)
1000 ;; The problem here is that the directory for the man page and completion
1001 ;; files is relative, and for some reason, setup.py uses the
1002 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
1003 ;; So, we need pass the prefix directly. In addition, make sure the Bash
1004 ;; completion file is called 'youtube-dl' rather than
1005 ;; 'youtube-dl.bash-completion'.
1006 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1007 #:phases (modify-phases %standard-phases
1008 (add-before 'install 'fix-the-data-directories
1009 (lambda* (#:key outputs #:allow-other-keys)
1010 (let ((prefix (assoc-ref outputs "out")))
1011 (mkdir "bash-completion")
1012 (rename-file "youtube-dl.bash-completion"
1013 "bash-completion/youtube-dl")
1014 (substitute* "setup.py"
1015 (("youtube-dl\\.bash-completion")
1016 "bash-completion/youtube-dl")
1018 (string-append "'" prefix "/etc/"))
1020 (string-append "'" prefix "/share/")))))))))
1021 (synopsis "Download videos from YouTube.com and other sites")
1023 "Youtube-dl is a small command-line program to download videos from
1024 YouTube.com and a few more sites.")
1025 (home-page "https://yt-dl.org")
1026 (license license:public-domain)))
1028 (define-public youtube-dl-gui
1030 (name "youtube-dl-gui")
1035 (uri (pypi-uri "Youtube-DLG" version))
1038 "0napxwzgls5ik1bxbp99vly32l23xpc4ng5kr24hfhf21ypjyadb"))))
1039 (build-system python-build-system)
1041 ;; In Guix, wxpython has not yet been packaged for Python 3.
1042 `(#:python ,python-2
1043 ;; This package has no tests.
1046 (modify-phases %standard-phases
1047 (add-before 'build 'patch-source
1048 (lambda* (#:key inputs #:allow-other-keys)
1049 ;; The youtube-dl-gui program lets you configure options. Some of
1050 ;; them are problematic, so we change their defaults.
1051 (substitute* "youtube_dl_gui/optionsmanager.py"
1052 ;; When this is true, the builder process will try (and fail) to
1053 ;; write logs to the builder user's home directory.
1054 (("'enable_log': True") "'enable_log': False")
1055 ;; This determines which youtube-dl program youtube-dl-gui will
1056 ;; run. If we don't set this, then youtube-dl-gui might download
1057 ;; an arbitrary copy from the Internet into the user's home
1058 ;; directory and run it, so let's make sure youtube-dl-gui uses
1059 ;; the youtube-dl from the inputs by default.
1060 (("'youtubedl_path': self.config_path")
1061 (string-append "'youtubedl_path': '"
1062 (assoc-ref inputs "youtube-dl")
1064 ;; When this is True, when youtube-dl-gui is finished downloading
1065 ;; a file, it will try (and possibly fail) to open the directory
1066 ;; containing the downloaded file. This can fail because it
1067 ;; assumes that xdg-open is in PATH. Unfortunately, simply
1068 ;; adding xdg-utils to the propagated inputs is not enough to
1069 ;; make this work, so for now we set the default to False.
1070 (("'open_dl_dir': True") "'open_dl_dir': False"))
1071 ;; The youtube-dl program from the inputs is actually a wrapper
1072 ;; script written in bash, so attempting to invoke it as a python
1073 ;; script will fail.
1074 (substitute* "youtube_dl_gui/downloaders.py"
1075 (("cmd = \\['python', self\\.youtubedl_path\\]")
1076 "cmd = [self.youtubedl_path]"))
1077 ;; Use relative paths for installing data files so youtube-dl-gui
1078 ;; installs the files relative to its prefix in the store, rather
1079 ;; than relative to /. Also, instead of installing data files into
1080 ;; $prefix/usr/share, install them into $prefix/share for
1081 ;; consistency (see: (standards) Directory Variables).
1082 (substitute* "setup.py"
1083 (("= '/usr/share") "= 'share"))
1084 ;; Update get_locale_file() so it finds the installed localization
1086 (substitute* "youtube_dl_gui/utils.py"
1087 (("os\\.path\\.join\\('/usr', 'share'")
1088 (string-append "os.path.join('"
1089 (assoc-ref %outputs "out")
1090 "', 'share'"))))))))
1092 `(("python2-wxpython" ,python2-wxpython)
1093 ("youtube-dl" ,youtube-dl)))
1094 (home-page "https://github.com/MrS0m30n3/youtube-dl-gui")
1096 "GUI (Graphical User Interface) for @command{youtube-dl}")
1098 "Youtube-dlG is a GUI (Graphical User Interface) for
1099 @command{youtube-dl}. You can use it to download videos from YouTube and any
1100 other site that youtube-dl supports.")
1101 (license license:unlicense)))
1103 (define-public you-get
1110 "https://github.com/soimort/you-get/releases/download/v"
1111 version "/you-get-" version ".tar.gz"))
1114 "043122hfh56fbbszp1kwd1f65asgyn60j1ijday93hf2dkhvbrnh"))))
1115 (build-system python-build-system)
1120 `(("ffmpeg" ,ffmpeg)))
1121 (synopsis "Download videos, audios, or images from Web sites")
1123 "You-Get is a command-line utility to download media contents (videos,
1124 audio, images) from the Web. It can use either mpv or vlc for playback.")
1125 (home-page "https://you-get.org/")
1126 (license license:expat)))
1128 (define-public libbluray
1134 (uri (string-append "https://download.videolan.org/videolan/"
1135 name "/" version "/"
1136 name "-" version ".tar.bz2"))
1139 "1k3lag4lxi2jjd3zh4wcb5l3hadzm54j5kagh92yzfy76p9svqzp"))))
1140 (build-system gnu-build-system)
1142 `(#:configure-flags '("--disable-bdjava")
1144 (modify-phases %standard-phases
1145 (add-before 'build 'fix-dlopen-paths
1146 (lambda* (#:key inputs #:allow-other-keys)
1147 (let ((libaacs (assoc-ref inputs "libaacs"))
1148 (libbdplus (assoc-ref inputs "libbdplus")))
1149 (substitute* "src/libbluray/disc/aacs.c"
1151 (string-append "\"" libaacs "/lib/libaacs\"")))
1152 (substitute* "src/libbluray/disc/bdplus.c"
1154 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1156 (native-inputs `(("pkg-config" ,pkg-config)))
1158 `(("fontconfig" ,fontconfig)
1159 ("freetype" ,freetype)
1160 ("libaacs" ,libaacs)
1161 ("libbdplus" ,libbdplus)
1162 ("libxml2" ,libxml2)))
1163 (home-page "https://www.videolan.org/developers/libbluray.html")
1164 (synopsis "Blu-Ray Disc playback library")
1166 "libbluray is a library designed for Blu-Ray Disc playback for media
1167 players, like VLC or MPlayer.")
1168 (license license:lgpl2.1+)))
1170 (define-public libdvdread
1176 (uri (string-append "https://download.videolan.org/videolan/"
1177 name "/" version "/"
1178 name "-" version ".tar.bz2"))
1181 "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
1182 (build-system gnu-build-system)
1183 (home-page "http://dvdnav.mplayerhq.hu/")
1184 (synopsis "Library for reading video DVDs")
1186 "Libdvdread provides a simple foundation for reading DVD video
1187 disks. It provides the functionality that is required to access many
1188 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1189 authentication and descrambling (if an external libdvdcss library is
1191 (license license:gpl2+)))
1193 (define-public dvdauthor
1200 (uri (string-append "mirror://sourceforge/dvdauthor/dvdauthor-"
1204 "1drfc47hikfzc9d7hjk34rw10iqw01d2vwmn91pv73ppx4nsj81h"))))
1205 (build-system gnu-build-system)
1207 `(("libdvdread" ,libdvdread)
1209 ("imagemagick" ,imagemagick)
1210 ("libxml2" ,libxml2)
1211 ("freetype" ,freetype)))
1213 `(("pkg-config" ,pkg-config)))
1214 (synopsis "Generates a DVD-Video movie from a MPEG-2 stream")
1215 (description "@command{dvdauthor} will generate a DVD-Video movie from a
1216 MPEG-2 stream containing VOB packets.")
1217 (home-page "http://dvdauthor.sourceforge.net")
1218 (license license:gpl3+)))
1220 (define-public libdvdnav
1226 (uri (string-append "https://download.videolan.org/videolan/"
1227 name "/" version "/"
1228 name "-" version ".tar.bz2"))
1231 "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
1232 (build-system gnu-build-system)
1234 `(("pkg-config" ,pkg-config)))
1236 `(("libdvdread" ,libdvdread)))
1237 (home-page "http://dvdnav.mplayerhq.hu/")
1238 (synopsis "Library for video DVD navigation features")
1240 "Libdvdnav is a library for developers of multimedia
1241 applications. It allows easy use of sophisticated DVD navigation features
1242 such as DVD menus, multiangle playback and even interactive DVD games. All
1243 this functionality is provided through a simple API which provides the DVD
1244 playback as a single logical stream of blocks, intermitted by special
1245 dvdnav events to report certain conditions. The main usage of libdvdnav is
1246 a loop regularly calling a function to get the next block, surrounded by
1247 additional calls to tell the library of user interaction. The whole
1248 DVD virtual machine and internal playback states are completely
1250 (license license:gpl2+)))
1252 (define-public libdvdnav-4
1260 "https://download.videolan.org/videolan/libdvdnav/libdvdnav-"
1264 "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
1266 `(("pkg-config" ,pkg-config)
1267 ("autoconf" ,autoconf)
1268 ("automake" ,automake)
1269 ("libtool" ,libtool)))
1275 (zero? (system* "autoreconf" "-vif")))
1276 %standard-phases)))))
1278 (define-public libdvdcss
1284 (uri (string-append "https://download.videolan.org/pub/"
1285 name "/" version "/"
1286 name "-" version ".tar.bz2"))
1289 "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
1290 (build-system gnu-build-system)
1291 (home-page "https://www.videolan.org/developers/libdvdcss.html")
1292 (synopsis "Library for accessing DVDs as block devices")
1294 "libdvdcss is a simple library designed for accessing DVDs like a block
1295 device without having to bother about the decryption.")
1296 (license license:gpl2+)))
1298 (define-public srt2vtt
1305 "http://dthompson.us/releases/srt2vtt/srt2vtt-"
1309 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1310 (build-system gnu-build-system)
1312 `(("guile" ,guile-2.0)))
1313 (synopsis "SubRip to WebVTT subtitle converter")
1314 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1315 for use with HTML5 video.")
1316 (home-page "http://dthompson.us/pages/software/srt2vtt")
1317 (license license:gpl3+)))
1319 (define-public avidemux
1326 "mirror://sourceforge/" name "/" name "/" version "/"
1327 name "_" version ".tar.gz"))
1330 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1331 (patches (search-patches "avidemux-install-to-lib.patch"))))
1332 (build-system cmake-build-system)
1334 `(("pkg-config" ,pkg-config)))
1335 ;; FIXME: Once packaged, add libraries not found during the build.
1337 `(("alsa-lib" ,alsa-lib)
1338 ("fontconfig" ,fontconfig)
1339 ("freetype" ,freetype)
1340 ("fribidi" ,fribidi)
1345 ("libvdpau" ,libvdpau)
1346 ("libvorbis" ,libvorbis)
1350 ("pulseaudio" ,pulseaudio)
1351 ("python" ,python-wrapper)
1352 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
1353 ;("qtbase" ,qtbase) with -std=gnu++11.
1354 ;("qttools" ,qttools)
1360 `(#:tests? #f ; no check target
1362 ;; Make sure files inside the included ffmpeg tarball are
1364 (modify-phases %standard-phases
1365 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1367 (with-directory-excursion "avidemux_core/ffmpeg_package"
1368 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1369 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1370 (add-after 'patch-source-shebangs 'repack-ffmpeg
1372 (with-directory-excursion "avidemux_core/ffmpeg_package"
1373 (substitute* "ffmpeg-2.7.6/configure"
1374 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1375 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1376 ;; avoid non-determinism in the archive
1377 "--sort=name" "--mtime=@0"
1378 "--owner=root:0" "--group=root:0")
1379 (delete-file-recursively "ffmpeg-2.7.6"))))
1382 ;; Copy-paste settings from the cmake build system.
1383 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1384 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1386 (lambda* (#:key inputs outputs #:allow-other-keys)
1388 ((out (assoc-ref outputs "out"))
1389 (lib (string-append out "/lib"))
1391 (sdl (assoc-ref inputs "sdl"))
1393 (lambda* (component srcdir #:optional (args '()))
1394 (let ((builddir (string-append "build_" component)))
1396 (with-directory-excursion builddir
1399 (apply system* "cmake"
1400 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1401 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1402 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1403 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1404 "\"-Wl,-rpath=" lib "\"")
1405 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1406 (string-append "-DSDL_INCLUDE_DIR="
1408 (string-append "../" srcdir)
1411 (system* "make" "-j"
1412 (number->string (parallel-job-count)))
1413 (system* "make" "install"))))))))
1415 (and (build_component "core" "avidemux_core")
1416 (build_component "cli" "avidemux/cli")
1417 (build_component "qt4" "avidemux/qt4")
1418 (build_component "plugins_common" "avidemux_plugins"
1419 '("-DPLUGIN_UI=COMMON"))
1420 (build_component "plugins_cli" "avidemux_plugins"
1421 '("-DPLUGIN_UI=CLI"))
1422 (build_component "plugins_qt4" "avidemux_plugins"
1423 '("-DPLUGIN_UI=QT4"))
1424 (build_component "plugins_settings" "avidemux_plugins"
1425 '("-DPLUGIN_UI=SETTINGS")))
1426 ;; Remove .exe and .dll file.
1427 (delete-file-recursively
1428 (string-append out "/share/ADM6_addons")))))
1429 (delete 'install))))
1430 (home-page "http://fixounet.free.fr/avidemux/")
1431 (synopsis "Video editor")
1432 (description "Avidemux is a video editor designed for simple cutting,
1433 filtering and encoding tasks. It supports many file types, including AVI,
1434 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1435 can be automated using projects, job queue and powerful scripting
1437 ;; Software with various licenses is included, see License.txt.
1438 (license license:gpl2+)))
1440 (define-public vapoursynth
1442 (name "vapoursynth")
1447 "https://github.com/vapoursynth/vapoursynth/archive/R"
1449 (file-name (string-append name "-" version ".tar.gz"))
1452 "1g3hc079jw4mz1cmkv2y28pdb556wqc8ql7iravgh1rg8j3f1zi5"))))
1453 (build-system gnu-build-system)
1455 `(("autoconf" ,autoconf)
1456 ("automake" ,automake)
1457 ("cython" ,python-cython)
1458 ("libtool" ,libtool)
1459 ("pkg-config" ,pkg-config)
1463 `(("ffmpeg" ,ffmpeg)
1465 ("tesseract-ocr" ,tesseract-ocr)
1469 (modify-phases %standard-phases
1473 (zero? (system* "sh" "autogen.sh")))))))
1474 (home-page "http://www.vapoursynth.com/")
1475 (synopsis "Video processing framework")
1476 (description "VapourSynth is a C++ library and Python module for video
1477 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1478 multithreading, generalized colorspaces, per frame properties, and videos with
1480 ;; src/core/cpufeatures only allows x86, ARM or PPC
1481 (supported-systems (delete "mips64el-linux" %supported-systems))
1482 ;; As seen from the source files.
1483 (license license:lgpl2.1+)))
1492 "http://downloads.xvid.org/downloads/xvidcore-"
1493 version ".tar.bz2"))
1496 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1497 (build-system gnu-build-system)
1498 (native-inputs `(("yasm" ,yasm)))
1501 (modify-phases %standard-phases
1503 'configure 'pre-configure
1505 (chdir "build/generic")
1506 (substitute* "configure"
1507 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1508 ;; No 'check' target.
1510 (home-page "https://www.xvid.com/")
1511 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1512 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1513 codec library. It uses ASP features such as b-frames, global and quarter
1514 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1515 and custom quantization matrices.")
1516 (license license:gpl2+)))
1518 (define-public livestreamer
1520 (name "livestreamer")
1525 "https://github.com/chrippa/livestreamer/archive/v"
1527 (file-name (string-append "livestreamer-" version ".tar.gz"))
1530 "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
1531 (build-system python-build-system)
1533 '(#:tests? #f)) ; tests rely on external web servers
1535 `(("python-requests" ,python-requests)))
1536 (synopsis "Internet video stream viewer")
1537 (description "Livestreamer is a command-line utility that extracts streams
1538 from various services and pipes them into a video playing application.")
1539 (home-page "http://livestreamer.io/")
1540 (license license:bsd-2)))
1548 (uri (string-append "https://github.com/mltframework/mlt/"
1549 "archive/v" version ".tar.gz"))
1550 (file-name (string-append name "-" version ".tar.gz"))
1553 "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))))
1554 (build-system gnu-build-system)
1556 `(#:tests? #f ; no tests
1557 #:make-flags '("CC=gcc")
1559 (list "--enable-gpl3"
1562 (modify-phases %standard-phases
1564 'configure 'override-LDFLAGS
1565 (lambda* (#:key outputs #:allow-other-keys)
1566 (substitute* "config.mak"
1568 (string-append "LDFLAGS+=-Wl,-rpath="
1569 (assoc-ref outputs "out")
1573 `(("alsa-lib" ,alsa-lib)
1575 ("libxml2" ,libxml2)
1578 ("libsamplerate" ,libsamplerate)
1579 ("pulseaudio" ,pulseaudio)
1583 `(("pkg-config" ,pkg-config)))
1584 (home-page "https://www.mltframework.org/")
1585 (synopsis "Author, manage, and run multitrack audio/video compositions")
1587 "MLT is a multimedia framework, designed and developed for television
1588 broadcasting. It provides a toolkit for broadcasters, video editors, media
1589 players, transcoders, web streamers and many more types of applications. The
1590 functionality of the system is provided via an assortment of ready to use
1591 tools, XML authoring components, and an extensible plug-in based API.")
1592 (license license:lgpl2.1+)))
1594 (define-public v4l-utils
1600 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1601 "/v4l-utils-" version ".tar.bz2"))
1604 "03g2b4rivrilimcp57mwrlsa3qvrxmk4sza08mygwmqbvcnic606"))))
1605 (build-system gnu-build-system)
1608 (list (string-append "--with-udevdir="
1609 (assoc-ref %outputs "out")
1611 "CXXFLAGS=-std=gnu++11")))
1614 ("pkg-config" ,pkg-config)))
1616 `(("alsa-lib" ,alsa-lib)
1618 ("libjpeg" ,libjpeg)
1622 (synopsis "Realtime video capture utilities for Linux")
1623 (description "The v4l-utils provide a series of libraries and utilities to
1624 be used for realtime video capture via Linux-specific APIs.")
1625 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1626 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1627 (license (list license:lgpl2.1+ license:gpl2))))
1635 (uri (string-append "https://github.com/jp9000/obs-studio"
1636 "/archive/" version ".tar.gz"))
1637 (file-name (string-append name "-" version ".tar.gz"))
1640 "02pbiyvf5x0zh448h5rpmyn33qnsqk694xxlyns83mdi74savyqw"))))
1641 (build-system cmake-build-system)
1643 `(#:tests? #f)) ; no tests
1645 `(("pkg-config" ,pkg-config)))
1647 `(("alsa-lib" ,alsa-lib)
1651 ("fontconfig" ,fontconfig)
1652 ("freetype" ,freetype)
1654 ("jansson" ,jansson)
1655 ("libx264" ,libx264)
1656 ("libxcomposite" ,libxcomposite)
1658 ("pulseaudio" ,pulseaudio)
1660 ("qtx11extras" ,qtx11extras)
1662 ("v4l-utils" ,v4l-utils)
1664 (synopsis "Live streaming software")
1665 (description "Open Broadcaster Software provides a graphical interface for
1666 video recording and live streaming. OBS supports capturing audio and video
1667 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1669 (home-page "https://obsproject.com")
1670 (supported-systems '("x86_64-linux" "i686-linux"))
1671 (license license:gpl2+)))
1673 (define-public libvdpau
1680 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1681 name "-" version ".tar.bz2"))
1684 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1685 (build-system gnu-build-system)
1687 `(("pkg-config" ,pkg-config)))
1689 `(("dri2proto" ,dri2proto)
1690 ("libx11" ,libx11 "out")
1691 ("libxext" ,libxext)))
1692 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1693 (synopsis "Video Decode and Presentation API")
1694 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1695 provides an interface to video decode acceleration and presentation hardware
1696 present in modern GPUs.")
1697 (license (license:x11-style "file://COPYING"))))
1699 (define-public vdpauinfo
1706 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1707 name "-" version ".tar.gz"))
1710 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1711 (build-system gnu-build-system)
1713 `(("pkg-config" ,pkg-config)
1714 ("libx11" ,libx11)))
1716 `(("libvdpau" ,libvdpau)))
1717 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1718 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1719 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1721 (license (license:x11-style "file://COPYING"))))
1723 (define-public recordmydesktop
1725 (name "recordmydesktop")
1729 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1730 version "/recordmydesktop-" version ".tar.gz"))
1733 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
1734 (build-system gnu-build-system)
1735 (inputs `(("popt" ,popt)
1740 ("libxfixes" ,libxfixes)
1741 ("libxdamage" ,libxdamage)
1742 ("libxext" ,libxext)
1743 ("alsa-lib" ,alsa-lib)
1744 ("libvorbis" ,libvorbis)
1745 ("libtheora" ,libtheora)))
1746 (home-page "http://recordmydesktop.sourceforge.net/")
1747 (synopsis "Desktop session video recorder")
1749 "recordMyDesktop is a command-line tool that captures the activity in
1750 your graphical desktop and encodes it as a video. This is a useful tool for
1751 making @dfn{screencasts}.")
1752 (license license:gpl2+)))
1754 (define-public libsmpeg
1761 (url "svn://svn.icculus.org/smpeg/trunk/")
1762 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
1763 (file-name (string-append name "-" version "-checkout"))
1766 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
1767 (build-system gnu-build-system)
1769 `(#:phases (modify-phases %standard-phases
1770 (add-after 'unpack 'autogen.sh
1772 (zero? (system* "sh" "autogen.sh")))))))
1774 `(("autoconf" ,autoconf)
1775 ("automake" ,automake)))
1778 (home-page "http://icculus.org/smpeg/")
1779 (synopsis "SDL MPEG decoding library")
1781 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
1782 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
1783 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
1784 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
1785 and MPEG system streams.")
1786 (license (list license:expat
1791 (define-public libbdplus
1798 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libbdplus/"
1799 version "/" name "-" version ".tar.bz2"))
1801 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
1803 `(("libgcrypt" ,libgcrypt)))
1804 (build-system gnu-build-system)
1805 (home-page "https://www.videolan.org/developers/libbdplus.html")
1806 (synopsis "Library for decrypting certain Blu-Ray discs")
1807 (description "libbdplus is a library which implements the BD+ System
1809 (license license:lgpl2.1+)))
1811 (define-public libaacs
1818 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libaacs/"
1819 version "/" name "-" version ".tar.bz2"))
1821 (base32 "1kms92i0c7i1yl659kqjf19lm8172pnpik5lsxp19xphr74vvq27"))))
1823 `(("libgcrypt" ,libgcrypt)))
1827 (build-system gnu-build-system)
1828 (home-page "https://www.videolan.org/developers/libaacs.html")
1829 (synopsis "Library for decrypting certain Blu-Ray discs")
1830 (description "libaacs is a library which implements the Advanced Access
1831 Content System specification.")
1832 (license license:lgpl2.1+)))
1834 (define-public mps-youtube
1836 (name "mps-youtube")
1841 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
1842 "archive/v" version ".tar.gz"))
1843 (file-name (string-append name "-" version ".tar.gz"))
1846 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
1847 (build-system python-build-system)
1849 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
1850 ;; test suite results differ depending on the country and also introduce
1851 ;; non-determinism in the tests.
1852 ;; https://github.com/mps-youtube/mps-youtube/issues/556
1855 `(("python-pafy" ,python-pafy)
1856 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
1857 (home-page "https://github.com/mps-youtube/mps-youtube")
1858 (synopsis "Terminal based YouTube player and downloader")
1860 "@code{mps-youtube} is based on mps, a terminal based program to
1861 search, stream and download music. This implementation uses YouTube as
1862 a source of content and can play and download video as well as audio.
1863 It can use either mpv or mplayer for playback, and for conversion of
1864 formats ffmpeg or libav is used. Users should install one of the
1865 supported players in addition to this package.")
1866 (license license:gpl3+)))
1868 (define-public handbrake
1874 (uri (string-append "https://handbrake.fr/rotation.php?file="
1875 "HandBrake-" version ".tar.bz2"))
1876 (file-name (string-append "handbrake-" version ".tar.bz2"))
1879 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
1880 (patches (search-patches "handbrake-pkg-config-path.patch"))
1881 (modules '((guix build utils)))
1883 ;; Remove bundled libraries and source not necessary for
1884 ;; running under a GNU environment.
1886 (for-each delete-file-recursively '("contrib" "macosx" "win"))
1888 (build-system glib-or-gtk-build-system)
1890 `(("automake" ,automake) ;gui subpackage must be bootstrapped
1891 ("autoconf" ,autoconf)
1892 ("curl" ,curl) ;not actually used, but tested for
1893 ("intltool" ,intltool)
1894 ("libtool" ,libtool)
1895 ("pkg-config" ,pkg-config)
1896 ("python" ,python-2))) ;for configuration
1899 ("dbus-glib" ,dbus-glib)
1901 ("fontconfig" ,fontconfig)
1902 ("freetype" ,freetype)
1904 ("gstreamer" ,gstreamer)
1905 ("gst-plugins-base" ,gst-plugins-base)
1909 ("libbluray" ,libbluray)
1910 ("libdvdnav" ,libdvdnav)
1911 ("libdvdread" ,libdvdread)
1912 ("libgudev" ,libgudev)
1913 ("libmpeg2" ,libmpeg2)
1914 ("libnotify" ,libnotify)
1916 ("libsamplerate" ,libsamplerate)
1917 ("libtheora" ,libtheora)
1918 ("libvorbis" ,libvorbis)
1920 ("libxml2" ,libxml2)
1921 ("libx264" ,libx264)
1925 `(#:tests? #f ;tests require Ruby and claim to be unsupported
1927 (modify-phases %standard-phases
1928 (add-before 'patch-source-shebangs 'bootstrap-gtk
1929 ;; Run bootstrap ahead of time so that shebangs get patched.
1931 (setenv "CONFIG_SHELL" (which "sh"))
1932 (setenv "NOCONFIGURE" "1")
1933 ;; Patch the Makefile so that it doesn't bootstrap again.
1934 (substitute* "gtk/module.rules"
1935 ((".*autogen\\.sh.*") ""))
1936 (zero? (system* "sh" "./gtk/autogen.sh"))))
1937 (add-before 'configure 'disable-contrib
1939 (substitute* "make/include/main.defs"
1940 ;; Disable unconditional inclusion of some "contrib"
1941 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
1942 ;; and libbluray), which would lead to fetching and
1943 ;; building of these libraries. Use our own instead.
1944 (("MODULES \\+= contrib") "# MODULES += contrib"))
1946 (add-before 'configure 'fix-x265-linking
1948 (substitute* "test/module.defs"
1949 ;; Fix missing library during linking error
1950 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
1953 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1954 ;; 'configure' is not an autoconf-generated script, and
1955 ;; errors on unrecognized arguments,
1956 ;; e.g. --enable-fast-install
1957 (let ((out (assoc-ref outputs "out")))
1958 (zero? (apply system* "./configure"
1959 (string-append "--prefix=" out)
1960 (or configure-flags '()))))))
1961 (add-after 'configure 'chdir-build
1962 (lambda _ (chdir "./build") #t)))))
1963 (home-page "https://handbrake.fr")
1964 (synopsis "Video transcoder")
1966 "HandBrake is a tool for converting video from any format to a selection
1967 of modern, widely supported codecs.")
1968 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
1969 (license (list license:gpl2+ license:bsd-3))))
1971 (define-public openh264
1977 (uri (string-append "https://github.com/cisco/"
1978 name "/archive/v" version ".tar.gz"))
1979 (file-name (string-append name "-" version ".tar.gz"))
1982 "1ix2fhk62i4q4kbnkl0gfk4x53vxqavsn0pck1pashr566zhglv5"))))
1983 (build-system gnu-build-system)
1986 ("python" ,python)))
1988 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1989 #:test-target "test"
1990 #:phases (modify-phases %standard-phases
1991 ;; no configure script
1992 (delete 'configure))))
1993 (home-page "http://www.openh264.org/")
1994 (synopsis "H264 decoder library")
1996 "Openh264 is a library which can decode H264 video streams.")
1997 (license license:bsd-2)))
1999 (define-public libmp4v2
2006 ;; XXX: The new location of upstream is uncertain and will become relevant the
2007 ;; moment when the googlecode archive shuts down. It is past the date it
2008 ;; should've been turned off. I tried to communicate with upstream, but this
2009 ;; wasn't very responsive and not very helpful. The short summary is, it is
2010 ;; chaos when it comes to the amount of forks and only time will tell where
2011 ;; the new upstream location is.
2012 (uri (string-append "https://storage.googleapis.com/google-"
2013 "code-archive-downloads/v2/"
2014 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
2015 (file-name (string-append name "-" version ".tar.bz2"))
2018 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
2019 (build-system gnu-build-system)
2021 "static")) ; 3.7MiB .a file
2024 (modify-phases %standard-phases
2025 (add-after 'unpack 'remove-dates
2027 ;; Make the build reproducible.
2028 (substitute* "configure"
2029 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
2030 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
2032 (add-after 'install 'move-static-libraries
2033 (lambda* (#:key outputs #:allow-other-keys)
2034 ;; Move static libraries to the "static" output.
2035 (let* ((out (assoc-ref outputs "out"))
2036 (lib (string-append out "/lib"))
2037 (static (assoc-ref outputs "static"))
2038 (slib (string-append static "/lib")))
2040 (for-each (lambda (file)
2041 (install-file file slib)
2043 (find-files lib "\\.a$"))
2046 `(("help2man" ,help2man)
2047 ("dejagnu" ,dejagnu)))
2048 (home-page "https://code.google.com/archive/p/mp4v2/")
2049 (synopsis "API to create and modify mp4 files")
2051 "The MP4v2 library provides an API to create and modify mp4 files as defined by
2052 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
2053 file format that has been used as a multimedia file format in a variety of platforms and
2054 applications. It is a very powerful and extensible format that can accommodate
2055 practically any type of media.")
2056 (license license:mpl1.1)))
2058 (define-public libmediainfo
2060 (name "libmediainfo")
2064 (uri (string-append "https://mediaarea.net/download/source/"
2066 name "_" version ".tar.bz2"))
2069 "1kchh6285b07z5nixv619hc9gml2ysdayicdiv30frrlqiyxqw4b"))))
2070 ;; TODO add a Big Buck Bunny webm for tests.
2072 `(("autoconf" ,autoconf)
2073 ("automake" ,automake)
2074 ("libtool" ,libtool)
2075 ("pkg-config" ,pkg-config)
2077 ("tinyxml2" ,tinyxml2)
2079 ("libzen" ,libzen)))
2080 (build-system gnu-build-system)
2082 '(#:tests? #f ; see above TODO
2084 ;; build scripts not in root of archive
2085 (modify-phases %standard-phases
2086 (add-before 'configure 'pre-configure
2088 (chdir "Project/GNU/Library")))
2089 (add-before 'configure 'autogen
2091 (zero? (system* "./autogen.sh")))))))
2092 (home-page "https://mediaarea.net/en/MediaInfo")
2093 (synopsis "Library for retrieving media metadata")
2094 (description "MediaInfo is a library used for retrieving technical
2095 information and other metadata about audio or video files. A non-exhaustive
2096 list of the information MediaInfo can retrieve from media files include:
2099 @item General: title, author, director, album, track number, date, duration...
2100 @item Video: codec, aspect, fps, bitrate...
2101 @item Audio: codec, sample rate, channels, language, bitrate...
2102 @item Text: language of subtitle
2103 @item Chapters: number of chapters, list of chapters
2106 MediaInfo supports the following formats:
2109 @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
2110 MPEG-2, MPEG-4, DVD (VOB)...
2111 @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
2112 @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
2113 @item Subtitles: SRT, SSA, ASS, SAMI...
2115 (license license:bsd-2)))
2117 ;; TODO also have a GUI version available
2118 (define-public mediainfo
2124 (uri (string-append "https://mediaarea.net/download/source/"
2125 name "/" version "/"
2126 name "_" version ".tar.bz2"))
2129 "0dy51a3i79jppmg1gi4f6h7jx4hcgnkmfim4d7d3gmnlbkjh8anv"))))
2131 `(("autoconf" ,autoconf)
2132 ("automake" ,automake)
2133 ("libtool" ,libtool)
2134 ("pkg-config" ,pkg-config)
2136 ("libmediainfo", libmediainfo)
2137 ("libzen" ,libzen)))
2138 (build-system gnu-build-system)
2140 '(#:tests? #f ; lacks tests
2142 ;; build scripts not in root of archive
2143 (modify-phases %standard-phases
2144 (add-before 'configure 'pre-configure
2146 (chdir "Project/GNU/CLI")))
2147 (add-before 'configure 'autogen
2149 (zero? (system* "./autogen.sh")))))))
2150 (home-page "https://mediaarea.net/en/MediaInfo")
2151 (synopsis "Utility for reading media metadata")
2152 (description "MediaInfo is a utility used for retrieving technical
2153 information and other metadata about audio or video files. It supports the
2154 many codecs and formats supported by libmediainfo.")
2155 (license license:bsd-2)))