gnu: youtube-viewer: Add '$out/lib/perl5/site_perl/' to search path.
[jackhill/guix/guix.git] / gnu / packages / video.scm
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, 2018 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, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
10 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
11 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
12 ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com>
13 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
14 ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
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, 2018 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>
22 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
23 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
24 ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
25 ;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
26 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
27 ;;;
28 ;;; This file is part of GNU Guix.
29 ;;;
30 ;;; GNU Guix is free software; you can redistribute it and/or modify it
31 ;;; under the terms of the GNU General Public License as published by
32 ;;; the Free Software Foundation; either version 3 of the License, or (at
33 ;;; your option) any later version.
34 ;;;
35 ;;; GNU Guix is distributed in the hope that it will be useful, but
36 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 ;;; GNU General Public License for more details.
39 ;;;
40 ;;; You should have received a copy of the GNU General Public License
41 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42
43 (define-module (gnu packages video)
44 #:use-module (ice-9 match)
45 #:use-module (srfi srfi-1)
46 #:use-module ((guix licenses) #:prefix license:)
47 #:use-module (guix utils)
48 #:use-module (guix packages)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module (guix svn-download)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system glib-or-gtk)
55 #:use-module (guix build-system meson)
56 #:use-module (guix build-system perl)
57 #:use-module (guix build-system python)
58 #:use-module (guix build-system waf)
59 #:use-module (gnu packages)
60 #:use-module (gnu packages algebra)
61 #:use-module (gnu packages audio)
62 #:use-module (gnu packages autotools)
63 #:use-module (gnu packages avahi)
64 #:use-module (gnu packages base)
65 #:use-module (gnu packages bison)
66 #:use-module (gnu packages boost)
67 #:use-module (gnu packages cdrom)
68 #:use-module (gnu packages check)
69 #:use-module (gnu packages cmake)
70 #:use-module (gnu packages compression)
71 #:use-module (gnu packages cpp)
72 #:use-module (gnu packages curl)
73 #:use-module (gnu packages databases)
74 #:use-module (gnu packages dejagnu)
75 #:use-module (gnu packages docbook)
76 #:use-module (gnu packages documentation)
77 #:use-module (gnu packages elf)
78 #:use-module (gnu packages file)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages fontutils)
81 #:use-module (gnu packages freedesktop)
82 #:use-module (gnu packages fribidi)
83 #:use-module (gnu packages gettext)
84 #:use-module (gnu packages ghostscript)
85 #:use-module (gnu packages gl)
86 #:use-module (gnu packages glib)
87 #:use-module (gnu packages guile)
88 #:use-module (gnu packages gnome)
89 #:use-module (gnu packages gnupg)
90 #:use-module (gnu packages gstreamer)
91 #:use-module (gnu packages gtk)
92 #:use-module (gnu packages image)
93 #:use-module (gnu packages imagemagick)
94 #:use-module (gnu packages iso-codes)
95 #:use-module (gnu packages libreoffice)
96 #:use-module (gnu packages linux)
97 #:use-module (gnu packages lua)
98 #:use-module (gnu packages m4)
99 #:use-module (gnu packages man)
100 #:use-module (gnu packages mp3)
101 #:use-module (gnu packages ncurses)
102 #:use-module (gnu packages ocr)
103 #:use-module (gnu packages perl)
104 #:use-module (gnu packages pkg-config)
105 #:use-module (gnu packages popt)
106 #:use-module (gnu packages pulseaudio)
107 #:use-module (gnu packages python)
108 #:use-module (gnu packages python-crypto)
109 #:use-module (gnu packages python-web)
110 #:use-module (gnu packages qt)
111 #:use-module (gnu packages ruby)
112 #:use-module (gnu packages sdl)
113 #:use-module (gnu packages serialization)
114 #:use-module (gnu packages shells)
115 #:use-module (gnu packages ssh)
116 #:use-module (gnu packages texinfo)
117 #:use-module (gnu packages textutils)
118 #:use-module (gnu packages tls)
119 #:use-module (gnu packages version-control)
120 #:use-module (gnu packages vulkan)
121 #:use-module (gnu packages web)
122 #:use-module (gnu packages webkit)
123 #:use-module (gnu packages wxwidgets)
124 #:use-module (gnu packages xdisorg)
125 #:use-module (gnu packages xiph)
126 #:use-module (gnu packages xml)
127 #:use-module (gnu packages xorg)
128 #:use-module (gnu packages assembly))
129
130 (define-public aalib
131 (package
132 (name "aalib")
133 (version "1.4rc5")
134 (source (origin
135 (method url-fetch)
136 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
137 version "/" name "-" version ".tar.gz"))
138 (sha256
139 (base32
140 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
141 (build-system gnu-build-system)
142 (native-inputs
143 `(("makeinfo" ,texinfo)))
144 (inputs
145 `(("ncurses" ,ncurses)))
146 (arguments
147 `(#:phases
148 (modify-phases %standard-phases
149 (replace 'configure
150 (lambda* (#:key build inputs outputs #:allow-other-keys)
151 ;; This old `configure' script doesn't support
152 ;; variables passed as arguments.
153 (let ((out (assoc-ref outputs "out"))
154 (ncurses (assoc-ref inputs "ncurses")))
155 (setenv "CONFIG_SHELL" (which "bash"))
156 (zero? (system* "./configure"
157 (string-append "--prefix=" out)
158 (string-append "--build=" build)
159 ;; The ancient config.guess is unable to
160 ;; guess the host triplet on mips64el.
161 ,@(if (string=? "mips64el-linux"
162 (%current-system))
163 '("--host=mips64el-unknown-linux-gnu")
164 '())
165 ;; The same is also true with aarch64.
166 ,@(if (string=? "aarch64-linux"
167 (%current-system))
168 '("--host=aarch64-unknown-linux-gnu")
169 '())
170 (string-append "--with-ncurses="
171 ncurses)))))))))
172 (home-page "http://aa-project.sourceforge.net/aalib/")
173 (synopsis "ASCII-art library")
174 (description
175 "AA-lib is a low level gfx library which does not require graphics device.
176 In fact, there is no graphical output possible. AA-lib replaces those
177 old-fashioned output methods with powerful ascii-art renderer.")
178 (license license:lgpl2.0+)))
179
180 (define-public liba52
181 (package
182 (name "liba52")
183 (version "0.7.4")
184 (source (origin
185 (method url-fetch)
186 (uri (string-append
187 ;; A mirror://sourceforge URI doesn't work, presumably
188 ;; because the SourceForge project is misconfigured.
189 "http://liba52.sourceforge.net/files/a52dec-" version
190 ".tar.gz"))
191 (sha256
192 (base32
193 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
194 (patches (search-patches "liba52-enable-pic.patch"
195 "liba52-set-soname.patch"
196 "liba52-use-mtune-not-mcpu.patch"
197 "liba52-link-with-libm.patch"))))
198 (build-system gnu-build-system)
199 ;; XXX We need to run ./bootstrap because of the build system fixes above.
200 (native-inputs
201 `(("autoconf" ,autoconf)
202 ("automake" ,automake)
203 ("libtool" ,libtool)))
204 (arguments `(#:configure-flags '("--enable-shared")
205 #:phases
206 (modify-phases %standard-phases
207 ;; XXX We need to run ./bootstrap because of the build
208 ;; system fixes above.
209 (add-after
210 'unpack 'bootstrap
211 (lambda _ (zero? (system* "sh" "bootstrap")))))))
212 (home-page "http://liba52.sourceforge.net/")
213 (synopsis "ATSC A/52 stream decoder")
214 (description "liba52 is a library for decoding ATSC A/52 streams. The
215 A/52 standard is used in a variety of applications, including digital
216 television and DVD. It is also known as AC-3.")
217 (license license:gpl2+)))
218
219 (define-public libmpeg2
220 (package
221 (name "libmpeg2")
222 (version "0.5.1")
223 (source (origin
224 (method url-fetch)
225 ;; A mirror://sourceforge URI doesn't work, presumably
226 ;; because the SourceForge project is misconfigured.
227 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
228 name "-" version ".tar.gz"))
229 (sha256
230 (base32
231 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
232 (inputs
233 `(("libx11" ,libx11)
234 ("libxext" ,libxext)
235 ("libxv" ,libxv)
236 ("libsm" ,libsm)
237 ("libice" ,libice)
238 ("sdl" ,sdl)))
239 (build-system gnu-build-system)
240 (home-page "http://libmpeg2.sourceforge.net/")
241 (synopsis "MPEG1 and MPEG2 video decoder library")
242 (description
243 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
244 (license license:gpl2+)))
245
246 (define-public libx264
247 (package
248 (name "libx264")
249 (version "20180219-2245")
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
253 "x264-snapshot-" version "-stable.tar.bz2"))
254 (sha256
255 (base32
256 "1x0cg8l30wp84mr7q0ddp06jclm0kjrszazrx87d4k7js3qxjy8m"))))
257 (build-system gnu-build-system)
258 (native-inputs
259 `(("pkg-config" ,pkg-config)
260 ("nasm" ,nasm)))
261 ;; TODO: Add gpac input
262 (arguments
263 `(#:tests? #f ;no check target
264 #:configure-flags '("--enable-shared"
265 ;; Don't build the command-line program. If we
266 ;; want it later, we should do so in a different
267 ;; package to avoid a circular dependency (the x264
268 ;; program depends on ffmpeg and ffmpeg depends on
269 ;; libx264).
270 "--disable-cli"
271
272 ;; On MIPS, we must pass "--disable-asm" or else
273 ;; configure fails after printing: "You specified a
274 ;; pre-MSA CPU in your CFLAGS. If you really want
275 ;; to run on such a CPU, configure with
276 ;; --disable-asm."
277 ,@(if (string-prefix? "mips"
278 (or (%current-target-system)
279 (%current-system)))
280 '("--disable-asm")
281 '()))))
282 (home-page "https://www.videolan.org/developers/x264.html")
283 (synopsis "H.264 video coding library")
284 (description "libx264 is an advanced encoding library for creating
285 H.264 (MPEG-4 AVC) video streams.")
286 (license (list license:gpl2+ ;most files
287 license:isc ;common/x86/x86inc.asm
288 license:lgpl2.1+ ;extras/getopt.c
289 license:bsd-3 ;extras/inttypes.h
290 (license:non-copyleft ;extras/cl*.h
291 "file://extras/cl.h"
292 "See extras/cl.h in the distribution.")))))
293
294 (define-public mkvtoolnix
295 (package
296 (name "mkvtoolnix")
297 (version "13.0.0")
298 (source
299 (origin
300 (method url-fetch)
301 (uri (string-append "https://mkvtoolnix.download/sources/"
302 name "-" version ".tar.xz"))
303 (sha256
304 (base32
305 "0hknnnnx9661igm1r73dc7aqxnnrl5a8yvyvr1nhd9ymn2klwpl5"))
306 (modules '((guix build utils)))
307 (snippet
308 '(begin
309 ;; Delete bundled libraries.
310 (for-each delete-file-recursively
311 '("lib/libebml"
312 "lib/libmatroska"
313 "lib/nlohmann-json"
314 "lib/pugixml"
315 "lib/utf8-cpp"))))))
316 (build-system gnu-build-system)
317 (inputs
318 `(("boost" ,boost)
319 ("bzip2" ,bzip2)
320 ("libebml" ,libebml)
321 ("flac" ,flac)
322 ("file" ,file)
323 ("libmatroska" ,libmatroska)
324 ("libogg" ,libogg)
325 ("libvorbis" ,libvorbis)
326 ("lzo" ,lzo)
327 ("pugixml" ,pugixml)
328 ("qt" ,qt)
329 ("utfcpp" ,utfcpp)
330 ("zlib" ,zlib)))
331 (native-inputs
332 `(("docbook-xsl" ,docbook-xsl)
333 ("gettext" ,gettext-minimal)
334 ("googletest" ,googletest)
335 ("libxslt" ,libxslt)
336 ("nlohmann-json-cpp" ,nlohmann-json-cpp)
337 ("perl" ,perl)
338 ("pkg-config" ,pkg-config)
339 ("po4a" ,po4a)
340 ("ruby" ,ruby)))
341 (arguments
342 `(#:configure-flags
343 (list (string-append "--with-boost="
344 (assoc-ref %build-inputs "boost"))
345 (string-append "--with-docbook-xsl-root="
346 (assoc-ref %build-inputs "docbook-xsl")
347 "/xml/xsl/docbook-xsl-"
348 ,(package-version docbook-xsl))
349 (string-append "--with-extra-includes="
350 (assoc-ref %build-inputs "nlohmann-json-cpp")
351 "/include/nlohmann"))
352 #:phases
353 (modify-phases %standard-phases
354 (add-before 'configure 'add-googletest
355 (lambda _
356 (symlink
357 (string-append (assoc-ref %build-inputs "googletest")
358 "/include/gtest") "lib/gtest")
359 #t))
360 (replace 'build
361 (lambda _
362 (let ((-j (list "-j" (number->string (parallel-job-count)))))
363 (zero? (apply system* "rake" -j)))))
364 (replace 'check
365 (lambda _
366 (zero? (system* "rake" "tests/unit"))))
367 (replace 'install
368 (lambda _
369 (zero? (system* "rake" "install")))))))
370 (home-page "https://mkvtoolnix.download")
371 (synopsis "Tools to create, alter and inspect Matroska files")
372 (description
373 "MKVToolNix provides tools for getting information about Matroska files
374 (@code{mkvinfo}), extracting tracks/data from Matroska files (@code{mkvextract})
375 and creating Matroska files from other media files (@code{mkvmerge}).")
376 (license license:gpl2)))
377
378 (define-public x265
379 (package
380 (name "x265")
381 (version "2.6")
382 (source
383 (origin
384 (method url-fetch)
385 (uri (string-append "https://download.videolan.org/videolan/x265/"
386 "x265_" version ".tar.gz"))
387 (sha256
388 (base32
389 "1gyd94jkwdii9308m07nymsbxrmrcl81c0j8i10zhslr2mj07w0v"))
390 (modules '((guix build utils)))
391 (snippet
392 '(delete-file-recursively "source/compat/getopt"))))
393 (build-system cmake-build-system)
394 (arguments
395 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
396 ;; Currently the source code doesn't check for aarch64
397 ,@(if (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))
398 '(#:configure-flags '("-DENABLE_PIC=TRUE"))
399 '())
400 #:phases
401 (modify-phases %standard-phases
402 (add-before 'configure 'prepare-build
403 (lambda _
404 (delete-file-recursively "build")
405 (chdir "source")
406 #t)))))
407 (home-page "http://x265.org/")
408 (synopsis "Library for encoding h.265/HEVC video streams")
409 (description "x265 is a H.265 / HEVC video encoder application library,
410 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
411 (license license:gpl2+)))
412
413 (define-public libass
414 (package
415 (name "libass")
416 (version "0.14.0")
417 (source (origin
418 (method url-fetch)
419 (uri (string-append
420 "https://github.com/libass/libass/releases/download/"
421 version "/libass-" version ".tar.xz"))
422 (sha256
423 (base32
424 "18iqznl4mabhj9ywfsz4kwvbsplcv1jjxq50nxssvbj8my1267w8"))))
425 (build-system gnu-build-system)
426 (native-inputs
427 `(("pkg-config" ,pkg-config)
428 ("nasm" ,nasm)))
429 (propagated-inputs
430 `(("freetype" ,freetype)
431 ("fribidi" ,fribidi)
432 ("fontconfig" ,fontconfig)
433 ("harfbuzz" ,harfbuzz)
434 ("enca" ,enca)))
435 (home-page "https://github.com/libass/libass")
436 (synopsis "Subtitle rendering library for the ASS/SSA format")
437 (description "libass is a subtitle rendering library for the
438 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
439 (license license:isc)))
440
441 (define-public libcaca
442 (package
443 (name "libcaca")
444 (version "0.99.beta19")
445 (source (origin
446 (method url-fetch)
447 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
448 version ".tar.gz"))
449 (sha256
450 (base32
451 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
452 (build-system gnu-build-system)
453 (native-inputs `(("pkg-config" ,pkg-config)))
454 (inputs
455 `(("freeglut" ,freeglut)
456 ("ftgl" ,ftgl)
457 ("imlib2" ,imlib2)
458 ("libx11" ,libx11)
459 ("mesa" ,mesa)
460 ("ncurses" ,ncurses)
461 ("zlib" ,zlib)))
462 (home-page "http://caca.zoy.org/wiki/libcaca")
463 (synopsis "Colour ASCII-art library")
464 (description "libcaca is a graphics library that outputs text instead of
465 pixels, so that it can work on older video cards or text terminals. It
466 supports Unicode, 2048 colors, dithering of color images, and advanced text
467 canvas operations.")
468 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
469
470 (define-public libdca
471 (package
472 (name "libdca")
473 (version "0.0.5")
474 (source (origin
475 (method url-fetch)
476 (uri (string-append
477 "https://download.videolan.org/pub/videolan/libdca/"
478 version "/libdca-" version ".tar.bz2"))
479 (sha256
480 (base32
481 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
482 (build-system gnu-build-system)
483 (home-page "https://www.videolan.org/developers/libdca.html")
484 (synopsis "DTS Coherent Acoustics decoder")
485 (description "libdca is a library for decoding DTS Coherent Acoustics
486 streams.")
487 (license license:gpl2+)))
488
489 (define-public libdv
490 (package
491 (name "libdv")
492 (version "1.0.0")
493 (source (origin
494 (method url-fetch)
495 (uri (string-append
496 "mirror://sourceforge/" name "/" name "/"
497 version "/" name "-" version ".tar.gz"))
498 (sha256
499 (base32
500 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
501 (build-system gnu-build-system)
502 (native-inputs `(("pkg-config" ,pkg-config)))
503 (inputs `(("libxv" ,libxv)))
504 (home-page "http://libdv.sourceforge.net/")
505 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
506 (description "The Quasar DV codec (libdv) is a software codec for DV
507 video, the encoding format used by most digital camcorders, typically those
508 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
509 developed according to the official standards for DV video: IEC 61834 and
510 SMPTE 314M.")
511 (license license:lgpl2.1+)))
512
513 (define-public libmatroska
514 (package
515 (name "libmatroska")
516 (version "1.4.8")
517 (source
518 (origin
519 (method url-fetch)
520 (uri (string-append "https://dl.matroska.org/downloads/"
521 name "/" name "-" version ".tar.xz"))
522 (sha256
523 (base32
524 "14n9sw974prr3yp4yjb7aadi6x2yz5a0hjw8fs3qigy5shh2piyq"))))
525 (build-system gnu-build-system)
526 (native-inputs
527 `(("pkg-config" ,pkg-config)))
528 (inputs
529 `(("libebml" ,libebml)))
530 (home-page "https://www.matroska.org")
531 (synopsis "C++ library to parse Matroska files (.mkv and .mka)")
532 (description
533 "Matroska aims to become the standard of multimedia container formats.
534 It is based on @dfn{EBML} (Extensible Binary Meta Language), a binary derivative
535 of XML. EBML enables the Matroska Development Team to gain significant
536 advantages in terms of future format extensibility, without breaking file
537 support in old parsers.
538 libebml is a C++ library to read and write EBML files.")
539 (license license:lgpl2.1)))
540
541 (define-public libva
542 (package
543 (name "libva")
544 (version "2.0.0")
545 (source
546 (origin
547 (method url-fetch)
548 (uri (list
549 ;; Newer releases are only available on GitHub.
550 (string-append "https://github.com/01org/libva/releases/download/"
551 version "/libva-" version ".tar.bz2")
552 ;; Keep the old URL around for compatibility.
553 (string-append "https://www.freedesktop.org/software/vaapi/releases/"
554 "libva/libva-" version "/libva-" version ".tar.bz2")))
555 (sha256
556 (base32 "0cz5i62jnibmnx0i80i9yipq39v16qr6fw461f6hvrh9lbwh21mv"))))
557 (build-system gnu-build-system)
558 (native-inputs
559 `(("pkg-config" ,pkg-config)))
560 (inputs
561 `(("libdrm" ,libdrm)
562 ("libx11" ,libx11)
563 ("libxext" ,libxext)
564 ("libxfixes" ,libxfixes)
565 ("mesa" ,mesa)))
566 (arguments
567 `(#:phases
568 (modify-phases %standard-phases
569 (add-before
570 'build 'fix-dlopen-paths
571 (lambda* (#:key outputs #:allow-other-keys)
572 (let ((out (assoc-ref outputs "out")))
573 (substitute* "va/drm/va_drm_auth_x11.c"
574 (("\"libva-x11\\.so\\.%d\"")
575 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
576 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
577 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
578 #:configure-flags
579 (list (string-append "--with-drivers-path="
580 (assoc-ref %build-inputs "mesa") "/lib/dri"))
581 ;; However, we can't write to mesa's store directory, so override the
582 ;; following make variable to install the dummy driver to libva's
583 ;; $prefix/lib/dri directory.
584 #:make-flags
585 (list (string-append "dummy_drv_video_ladir="
586 (assoc-ref %outputs "out") "/lib/dri"))))
587 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
588 (synopsis "Video acceleration library")
589 (description "The main motivation for VA-API (Video Acceleration API) is
590 to enable hardware accelerated video decode/encode at various
591 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
592 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
593 (license license:expat)))
594
595 (define-public ffmpeg
596 (package
597 (name "ffmpeg")
598 (version "3.4.2")
599 (source (origin
600 (method url-fetch)
601 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
602 version ".tar.xz"))
603 (sha256
604 (base32
605 "0h6prjn1ijkzzhkyj8mazp0wpx7m0n9ycadjxagf9czqirbyk4ib"))))
606 (build-system gnu-build-system)
607 (inputs
608 `(("fontconfig" ,fontconfig)
609 ("freetype" ,freetype)
610 ("frei0r-plugins" ,frei0r-plugins)
611 ("gnutls" ,gnutls)
612 ("opus" ,opus)
613 ("ladspa" ,ladspa)
614 ("lame" ,lame)
615 ("libass" ,libass)
616 ("libbluray" ,libbluray)
617 ("libcaca" ,libcaca)
618 ("libcdio-paranoia" ,libcdio-paranoia)
619 ("libtheora" ,libtheora)
620 ("libva" ,libva)
621 ("libvdpau" ,libvdpau)
622 ("libvorbis" ,libvorbis)
623 ("libvpx" ,libvpx)
624 ("libx11" ,libx11)
625 ("libx264" ,libx264)
626 ("mesa" ,mesa)
627 ("openal" ,openal)
628 ("pulseaudio" ,pulseaudio)
629 ("sdl" ,sdl2)
630 ("soxr" ,soxr)
631 ("speex" ,speex)
632 ("twolame" ,twolame)
633 ("x265" ,x265)
634 ("xvid" ,xvid)
635 ("zlib" ,zlib)))
636 (native-inputs
637 `(("bc" ,bc)
638 ("perl" ,perl)
639 ("pkg-config" ,pkg-config)
640 ("texinfo" ,texinfo)
641 ("python" ,python-2) ; scripts use interpreter python2
642 ("speex" ,speex)
643 ("yasm" ,yasm)))
644 (arguments
645 `(#:test-target "fate"
646 #:configure-flags
647 ;; possible additional inputs:
648 ;; --enable-avisynth enable reading of AviSynth script
649 ;; files [no]
650 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
651 ;; --enable-libcelt enable CELT decoding via libcelt [no]
652 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
653 ;; and libraw1394 [no]
654 ;; --enable-libfaac enable AAC encoding via libfaac [no]
655 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
656 ;; --enable-libflite enable flite (voice synthesis) support via
657 ;; libflite [no]
658 ;; --enable-libgme enable Game Music Emu via libgme [no]
659 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
660 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
661 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
662 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
663 ;; --enable-libnut enable NUT (de)muxing via libnut,
664 ;; native (de)muxer exists [no]
665 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
666 ;; libopencore-amrnb [no]
667 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
668 ;; libopencore-amrwb [no]
669 ;; --enable-libopencv enable video filtering via libopencv [no]
670 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
671 ;; OpenJPEG [no]
672 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
673 ;; --enable-libschroedinger enable Dirac de/encoding via
674 ;; libschroedinger [no]
675 ;; --enable-libshine enable fixed-point MP3 encoding via
676 ;; libshine [no]
677 ;; --enable-libssh enable SFTP protocol via libssh [no]
678 ;; (libssh2 does not work)
679 ;; --enable-libstagefright-h264 enable H.264 decoding via
680 ;; libstagefright [no]
681 ;; --enable-libutvideo enable Ut Video encoding and decoding via
682 ;; libutvideo [no]
683 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
684 ;; --enable-libvidstab enable video stabilization using
685 ;; vid.stab [no]
686 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
687 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
688 ;; libvo-amrwbenc [no]
689 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
690 ;; --enable-libxavs enable AVS encoding via xavs [no]
691 ;; --enable-libzmq enable message passing via libzmq [no]
692 ;; --enable-libzvbi enable teletext support via libzvbi [no]
693 ;; --enable-opencl enable OpenCL code
694 '("--enable-avresample"
695 "--enable-gpl" ; enable optional gpl licensed parts
696 "--enable-shared"
697 "--enable-frei0r"
698 "--enable-fontconfig"
699 "--enable-gnutls"
700 "--enable-ladspa"
701 "--enable-libass"
702 "--enable-libbluray"
703 "--enable-libcaca"
704 "--enable-libcdio"
705 "--enable-libfreetype"
706 "--enable-libmp3lame"
707 "--enable-libopus"
708 "--enable-libpulse"
709 "--enable-libsoxr"
710 "--enable-libspeex"
711 "--enable-libtheora"
712 "--enable-libtwolame"
713 "--enable-libvorbis"
714 "--enable-libvpx"
715 "--enable-libxvid"
716 "--enable-libx264"
717 "--enable-libx265"
718 "--enable-openal"
719 "--enable-opengl"
720
721 "--enable-runtime-cpudetect"
722
723 ;; The HTML pages take 7.2 MiB
724 "--disable-htmlpages"
725
726 ;; The static libraries are 23 MiB
727 "--disable-static"
728
729 ;; Runtime cpu detection is not implemented on
730 ;; MIPS, so we disable some features.
731 "--disable-mips32r2"
732 "--disable-mipsdsp"
733 "--disable-mipsdspr2"
734 "--disable-mipsfpu")
735 #:phases
736 (modify-phases %standard-phases
737 (replace
738 'configure
739 ;; configure does not work followed by "SHELL=..." and
740 ;; "CONFIG_SHELL=..."; set environment variables instead
741 (lambda* (#:key outputs configure-flags #:allow-other-keys)
742 (let ((out (assoc-ref outputs "out")))
743 (substitute* "configure"
744 (("#! /bin/sh") (string-append "#!" (which "sh"))))
745 (setenv "SHELL" (which "bash"))
746 (setenv "CONFIG_SHELL" (which "bash"))
747 (zero? (apply system*
748 "./configure"
749 (string-append "--prefix=" out)
750 ;; Add $libdir to the RUNPATH of all the binaries.
751 (string-append "--extra-ldflags=-Wl,-rpath="
752 out "/lib")
753 configure-flags)))))
754 (add-before
755 'check 'set-ld-library-path
756 (lambda _
757 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
758 ;; running tests.
759 (let* ((dso (find-files "." "\\.so$"))
760 (path (string-join (map dirname dso) ":")))
761 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
762 (setenv "LD_LIBRARY_PATH" path)
763 #t))))))
764 (home-page "https://www.ffmpeg.org/")
765 (synopsis "Audio and video framework")
766 (description "FFmpeg is a complete, cross-platform solution to record,
767 convert and stream audio and video. It includes the libavcodec
768 audio/video codec library.")
769 (license license:gpl2+)))
770
771 (define-public ffmpeg-2.8
772 (package
773 (inherit ffmpeg)
774 (version "2.8.14")
775 (source (origin
776 (method url-fetch)
777 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
778 version ".tar.xz"))
779 (sha256
780 (base32
781 "05m1272r5qa2r0ym5vq4figdfnpvcys1fgb1026n5s6xdjd1s1pg"))))
782 (arguments
783 (substitute-keyword-arguments (package-arguments ffmpeg)
784 ((#:configure-flags flags)
785 `(map (lambda (flag)
786 (if (string=? flag "--disable-mipsdsp")
787 "--disable-mipsdspr1"
788 flag))
789 ,flags))))))
790
791 ;; Annoyingly enough, the latest mpv release does not build with the stable
792 ;; release of ffmpeg. Use a git commit until the situation is fixed.
793 (define-public ffmpeg-git
794 (let ((commit "3f887440677328c9cfed97ad81d14051ffa32aae")
795 (revision "1"))
796 (package
797 (inherit ffmpeg)
798 (name "ffmpeg-git")
799 (version (string-append "3.4-" revision "." (string-take commit 9)))
800 (source (origin
801 (method git-fetch)
802 (uri (git-reference
803 (url "https://github.com/FFmpeg/FFmpeg.git")
804 (commit commit)))
805 (file-name (string-append name "-" version "-checkout"))
806 (sha256
807 (base32
808 "1b7n3g4m2rbvrwsgbfl8wl91z42g1ld42clwxs8qpl9ny5rwz6sq")))))))
809
810 (define-public vlc
811 (package
812 (name "vlc")
813 (version "2.2.8")
814 (source (origin
815 (method url-fetch)
816 (uri (string-append
817 "https://download.videolan.org/pub/videolan/vlc/"
818 version "/vlc-" version ".tar.xz"))
819 (sha256
820 (base32
821 "1v32snw46rkgbdqdy3dssl2y13i8p2cr1cw1i18r6vdmiy24dw4v"))))
822 (build-system gnu-build-system)
823 (native-inputs
824 `(("git" ,git) ; needed for a test
825 ("pkg-config" ,pkg-config)))
826 ;; FIXME: Add optional inputs once available.
827 (inputs
828 `(("alsa-lib" ,alsa-lib)
829 ("avahi" ,avahi)
830 ("dbus" ,dbus)
831 ("flac" ,flac)
832 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
833 ("fontconfig" ,fontconfig)
834 ("freetype" ,freetype)
835 ("gnutls" ,gnutls)
836 ("liba52" ,liba52)
837 ("libcddb" ,libcddb)
838 ("libdvbpsi" ,libdvbpsi)
839 ("libgcrypt" ,libgcrypt)
840 ("libkate" ,libkate)
841 ("libmad" ,libmad)
842 ("libogg" ,libogg)
843 ("libpng" ,libpng)
844 ("libsamplerate" ,libsamplerate)
845 ("libssh2" ,libssh2)
846 ("libvorbis" ,libvorbis)
847 ("libtheora" ,libtheora)
848 ("libxext" ,libxext)
849 ("libxi" ,libxi)
850 ("libxinerama" ,libxinerama)
851 ("libxml2" ,libxml2)
852 ("libxpm" ,libxpm)
853 ("livemedia-utils" ,livemedia-utils)
854 ("lua" ,lua-5.1)
855 ("mesa" ,mesa)
856 ("opus" ,opus)
857 ("perl" ,perl)
858 ("pulseaudio" ,pulseaudio)
859 ("python" ,python-wrapper)
860 ("qtbase" ,qtbase)
861 ("qtx11extras" ,qtx11extras)
862 ("sdl" ,sdl)
863 ("sdl-image" ,sdl-image)
864 ("speex" ,speex)
865 ("x265" ,x265)
866 ("xcb-util-keysyms" ,xcb-util-keysyms)))
867 (arguments
868 `(#:configure-flags
869 `("CXXFLAGS=-std=gnu++11"
870 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
871 (assoc-ref %build-inputs "ffmpeg")
872 "/lib")) ;needed for the tests
873
874 #:phases
875 (modify-phases %standard-phases
876 (add-after 'unpack 'patch-source
877 (lambda* (#:key inputs #:allow-other-keys)
878 (let ((livemedia-utils (assoc-ref inputs "livemedia-utils")))
879 (substitute* "configure"
880 (("LIVE555_PREFIX=\\$\\{LIVE555_PREFIX-\"/usr\"\\}")
881 (string-append "LIVE555_PREFIX=" livemedia-utils)))
882 ;; Some of the tests require using the display to test out VLC,
883 ;; which fails in our sandboxed build system
884 (substitute* "test/run_vlc.sh"
885 (("./vlc --ignore-config") "echo"))
886 ;; XXX Likely not needed for >2.2.6.
887 (substitute* "modules/gui/qt4/components/interface_widgets.cpp"
888 (("<qx11info_x11.h>") "<QtX11Extras/qx11info_x11.h>"))
889 #t)))
890 (add-after 'install 'regenerate-plugin-cache
891 (lambda* (#:key outputs #:allow-other-keys)
892 ;; The 'install-exec-hook' rule in the top-level Makefile.am
893 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
894 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
895 ;; it references. Thus, we first reset the timestamps of all
896 ;; these files, and then regenerate the cache such that the
897 ;; mtimes it includes are always zero instead of being dependent
898 ;; on the build time.
899 (let* ((out (assoc-ref outputs "out"))
900 (pkglibdir (string-append out "/lib/vlc"))
901 (plugindir (string-append pkglibdir "/plugins"))
902 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
903 ;; TODO: Factorize 'reset-timestamps'.
904 (for-each (lambda (file)
905 (let ((s (lstat file)))
906 (unless (eq? (stat:type s) 'symlink)
907 (utime file 0 0 0 0))))
908 (find-files plugindir))
909 (zero? (system* cachegen plugindir))))))))
910 (home-page "https://www.videolan.org/")
911 (synopsis "Audio and video framework")
912 (description "VLC is a cross-platform multimedia player and framework
913 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
914 treaming protocols.")
915 (license license:gpl2+)))
916
917 (define-public mplayer
918 (package
919 (name "mplayer")
920 (version "1.3.0")
921 (source (origin
922 (method url-fetch)
923 (uri (string-append
924 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
925 version ".tar.xz"))
926 (sha256
927 (base32
928 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
929 (build-system gnu-build-system)
930 ;; FIXME: Add additional inputs once available.
931 (native-inputs
932 `(("pkg-config" ,pkg-config)))
933 (inputs
934 `(("alsa-lib" ,alsa-lib)
935 ("cdparanoia" ,cdparanoia)
936 ("ffmpeg" ,ffmpeg)
937 ("fontconfig" ,fontconfig)
938 ("freetype" ,freetype)
939 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
940 ("lame" ,lame)
941 ("libass" ,libass)
942 ("libdvdcss" ,libdvdcss)
943 ("libdvdnav" ,libdvdnav)
944 ("libjpeg" ,libjpeg)
945 ("libmpeg2" ,libmpeg2)
946 ("libmpg123" ,mpg123) ; audio codec for MP3
947 ("libpng" ,libpng)
948 ("libtheora" ,libtheora)
949 ("libvdpau" ,libvdpau)
950 ("libvorbis" ,libvorbis)
951 ("libx11" ,libx11)
952 ("libx264" ,libx264)
953 ("libxinerama" ,libxinerama)
954 ("libxv" ,libxv)
955 ("libxxf86dga" ,libxxf86dga)
956 ("mesa" ,mesa)
957 ("opus" ,opus)
958 ("perl" ,perl)
959 ("pulseaudio" ,pulseaudio)
960 ("python" ,python-wrapper)
961 ("sdl" ,sdl)
962 ("speex" ,speex)
963 ("yasm" ,yasm)
964 ("zlib" ,zlib)))
965 (arguments
966 `(#:tests? #f ; no test target
967 #:phases
968 (modify-phases %standard-phases
969 (replace 'configure
970 ;; configure does not work followed by "SHELL=..." and
971 ;; "CONFIG_SHELL=..."; set environment variables instead
972 (lambda* (#:key inputs outputs #:allow-other-keys)
973 (let ((out (assoc-ref outputs "out"))
974 (libx11 (assoc-ref inputs "libx11")))
975 (substitute* "configure"
976 (("#! /bin/sh") (string-append "#!" (which "sh"))))
977 (setenv "SHELL" (which "bash"))
978 (setenv "CONFIG_SHELL" (which "bash"))
979 (zero? (system*
980 "./configure"
981 (string-append "--extra-cflags=-I"
982 libx11 "/include") ; to detect libx11
983 "--disable-ffmpeg_a" ; disables bundled ffmpeg
984 (string-append "--prefix=" out)
985 ;; Enable runtime cpu detection where supported,
986 ;; and choose a suitable target.
987 ,@(match (or (%current-target-system)
988 (%current-system))
989 ("x86_64-linux"
990 '("--enable-runtime-cpudetection"
991 "--target=x86_64-linux"))
992 ("i686-linux"
993 '("--enable-runtime-cpudetection"
994 "--target=i686-linux"))
995 ("mips64el-linux"
996 '("--target=mips3-linux"))
997 (_ (list (string-append
998 "--target="
999 (or (%current-target-system)
1000 (nix-system->gnu-triplet
1001 (%current-system)))))))
1002 "--disable-iwmmxt"))))))))
1003 (home-page "https://www.mplayerhq.hu/design7/news.html")
1004 (synopsis "Audio and video player")
1005 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
1006 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
1007 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
1008 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
1009 (license license:gpl2)))
1010
1011 (define-public mpv
1012 (package
1013 (name "mpv")
1014 (version "0.28.2")
1015 (source (origin
1016 (method url-fetch)
1017 (uri (string-append
1018 "https://github.com/mpv-player/mpv/archive/v" version
1019 ".tar.gz"))
1020 (sha256
1021 (base32
1022 "15fp4sa5glqhgidd54vs6knf9dp809wszzsqiqz5nyri4ph19nma"))
1023 (file-name (string-append name "-" version ".tar.gz"))))
1024 (build-system waf-build-system)
1025 (native-inputs
1026 `(("perl" ,perl) ; for zsh completion file
1027 ("pkg-config" ,pkg-config)
1028 ("python-docutils" ,python-docutils)))
1029 ;; Missing features: libguess, V4L2
1030 (inputs
1031 `(("alsa-lib" ,alsa-lib)
1032 ("enca" ,enca)
1033 ("ffmpeg" ,ffmpeg-git)
1034 ("jack" ,jack-1)
1035 ("ladspa" ,ladspa)
1036 ("lcms" ,lcms)
1037 ("libass" ,libass)
1038 ("libbluray" ,libbluray)
1039 ("libcaca" ,libcaca)
1040 ("libbs2b" ,libbs2b)
1041 ("libcdio-paranoia" ,libcdio-paranoia)
1042 ("libdvdread" ,libdvdread)
1043 ("libdvdnav" ,libdvdnav)
1044 ("libjpeg" ,libjpeg)
1045 ("libva" ,libva)
1046 ("libvdpau" ,libvdpau)
1047 ("libx11" ,libx11)
1048 ("libxext" ,libxext)
1049 ("libxinerama" ,libxinerama)
1050 ("libxrandr" ,libxrandr)
1051 ("libxscrnsaver" ,libxscrnsaver)
1052 ("libxv" ,libxv)
1053 ;; XXX: lua > 5.2 is not currently supported; see
1054 ;; waftools/checks/custom.py
1055 ("lua" ,lua-5.2)
1056 ("mesa" ,mesa)
1057 ("mpg123" ,mpg123)
1058 ("pulseaudio" ,pulseaudio)
1059 ("rsound" ,rsound)
1060 ("shaderc" ,shaderc)
1061 ("vulkan-icd-loader" ,vulkan-icd-loader)
1062 ("waf" ,python-waf)
1063 ("wayland" ,wayland)
1064 ("wayland-protocols" ,wayland-protocols)
1065 ("libxkbcommon", libxkbcommon)
1066 ("youtube-dl" ,youtube-dl)
1067 ("zlib" ,zlib)))
1068 (arguments
1069 '(#:phases
1070 (modify-phases %standard-phases
1071 (add-before
1072 'configure 'setup-waf
1073 (lambda* (#:key inputs #:allow-other-keys)
1074 (copy-file (assoc-ref inputs "waf") "waf")
1075 (setenv "CC" "gcc"))))
1076 #:configure-flags (list "--enable-libmpv-shared"
1077 "--enable-cdda"
1078 "--enable-dvdread"
1079 "--enable-dvdnav"
1080 "--enable-zsh-comp"
1081 "--disable-build-date")
1082 ;; No check function defined.
1083 #:tests? #f))
1084 (home-page "https://mpv.io/")
1085 (synopsis "Audio and video player")
1086 (description "mpv is a general-purpose audio and video player. It is a
1087 fork of mplayer2 and MPlayer. It shares some features with the former
1088 projects while introducing many more.")
1089 (license license:gpl2+)))
1090
1091 (define-public gnome-mpv
1092 (package
1093 (name "gnome-mpv")
1094 (version "0.14")
1095 (source
1096 (origin
1097 (method url-fetch)
1098 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
1099 "/download/v" version "/gnome-mpv-" version
1100 ".tar.xz"))
1101 (sha256
1102 (base32
1103 "03kjwd5jq0i5ajnvhjwf5019bjjaa16xkdrhdkiz1k58ipjvvj93"))))
1104 (native-inputs
1105 `(("intltool" ,intltool)
1106 ("pkg-config" ,pkg-config)))
1107 (inputs
1108 `(("gtk+" ,gtk+)
1109 ("libepoxy" ,libepoxy)
1110 ("mpv" ,mpv)))
1111 (build-system glib-or-gtk-build-system)
1112 (home-page "https://github.com/gnome-mpv/gnome-mpv")
1113 (synopsis "GTK+ frontend for the mpv media player")
1114 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
1115 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
1116 access to mpv's powerful playback capabilities.")
1117 (license license:gpl3+)))
1118
1119 (define-public libvpx
1120 (package
1121 (name "libvpx")
1122 (version "1.7.0")
1123 (source (origin
1124 ;; XXX: Upstream does not provide tarballs for > 1.6.1.
1125 (method git-fetch)
1126 (uri (git-reference
1127 (url "https://chromium.googlesource.com/webm/libvpx")
1128 (commit (string-append "v" version))))
1129 (file-name (git-file-name name version))
1130 (sha256
1131 (base32
1132 "0vvh89hvp8qg9an9vcmwb7d9k3nixhxaz6zi65qdjnd0i56kkcz6"))
1133 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
1134 (build-system gnu-build-system)
1135 (arguments
1136 `(#:configure-flags (list "--enable-shared"
1137 "--as=yasm"
1138 ;; Limit size to avoid CVE-2015-1258
1139 "--size-limit=16384x16384"
1140 (string-append "--prefix=" (assoc-ref %outputs "out")))
1141 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1142 (assoc-ref %outputs "out") "/lib"))
1143 #:phases (modify-phases %standard-phases
1144 (replace 'configure
1145 (lambda* (#:key configure-flags #:allow-other-keys)
1146 ;; The configure script does not understand some of the GNU
1147 ;; options, so we only add the flags specified above.
1148 (apply invoke "./configure" configure-flags))))
1149 #:tests? #f)) ; no check target
1150 (native-inputs
1151 `(("perl" ,perl)
1152 ("yasm" ,yasm)))
1153 (synopsis "VP8/VP9 video codec")
1154 (description "libvpx is a codec for the VP8/VP9 video compression format.")
1155 (license license:bsd-3)
1156 (home-page "https://www.webmproject.org/")))
1157
1158 (define-public youtube-dl
1159 (package
1160 (name "youtube-dl")
1161 (version "2018.02.26")
1162 (source (origin
1163 (method url-fetch)
1164 (uri (string-append "https://yt-dl.org/downloads/"
1165 version "/youtube-dl-"
1166 version ".tar.gz"))
1167 (sha256
1168 (base32
1169 "0ijjnx8qjxk07v5dbz3n5z3cvz8dlkmh7jkyvgng7inl74c29zq5"))))
1170 (build-system python-build-system)
1171 (arguments
1172 ;; The problem here is that the directory for the man page and completion
1173 ;; files is relative, and for some reason, setup.py uses the
1174 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
1175 ;; So, we need pass the prefix directly. In addition, make sure the Bash
1176 ;; completion file is called 'youtube-dl' rather than
1177 ;; 'youtube-dl.bash-completion'.
1178 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1179 #:phases (modify-phases %standard-phases
1180 (add-before 'install 'fix-the-data-directories
1181 (lambda* (#:key outputs #:allow-other-keys)
1182 (let ((prefix (assoc-ref outputs "out")))
1183 (mkdir "bash-completion")
1184 (rename-file "youtube-dl.bash-completion"
1185 "bash-completion/youtube-dl")
1186 (substitute* "setup.py"
1187 (("youtube-dl\\.bash-completion")
1188 "bash-completion/youtube-dl")
1189 (("'etc/")
1190 (string-append "'" prefix "/etc/"))
1191 (("'share/")
1192 (string-append "'" prefix "/share/")))
1193 #t))))))
1194 (synopsis "Download videos from YouTube.com and other sites")
1195 (description
1196 "Youtube-dl is a small command-line program to download videos from
1197 YouTube.com and many more sites.")
1198 (home-page "https://yt-dl.org")
1199 (license license:public-domain)))
1200
1201 (define-public youtube-dl-gui
1202 (package
1203 (name "youtube-dl-gui")
1204 (version "0.3.8")
1205 (source
1206 (origin
1207 (method url-fetch)
1208 (uri (pypi-uri "Youtube-DLG" version))
1209 (sha256
1210 (base32
1211 "0napxwzgls5ik1bxbp99vly32l23xpc4ng5kr24hfhf21ypjyadb"))))
1212 (build-system python-build-system)
1213 (arguments
1214 ;; In Guix, wxpython has not yet been packaged for Python 3.
1215 `(#:python ,python-2
1216 ;; This package has no tests.
1217 #:tests? #f
1218 #:phases
1219 (modify-phases %standard-phases
1220 (add-before 'build 'patch-source
1221 (lambda* (#:key inputs #:allow-other-keys)
1222 ;; The youtube-dl-gui program lets you configure options. Some of
1223 ;; them are problematic, so we change their defaults.
1224 (substitute* "youtube_dl_gui/optionsmanager.py"
1225 ;; When this is true, the builder process will try (and fail) to
1226 ;; write logs to the builder user's home directory.
1227 (("'enable_log': True") "'enable_log': False")
1228 ;; This determines which youtube-dl program youtube-dl-gui will
1229 ;; run. If we don't set this, then youtube-dl-gui might download
1230 ;; an arbitrary copy from the Internet into the user's home
1231 ;; directory and run it, so let's make sure youtube-dl-gui uses
1232 ;; the youtube-dl from the inputs by default.
1233 (("'youtubedl_path': self.config_path")
1234 (string-append "'youtubedl_path': '"
1235 (assoc-ref inputs "youtube-dl")
1236 "/bin'"))
1237 ;; When this is True, when youtube-dl-gui is finished downloading
1238 ;; a file, it will try (and possibly fail) to open the directory
1239 ;; containing the downloaded file. This can fail because it
1240 ;; assumes that xdg-open is in PATH. Unfortunately, simply
1241 ;; adding xdg-utils to the propagated inputs is not enough to
1242 ;; make this work, so for now we set the default to False.
1243 (("'open_dl_dir': True") "'open_dl_dir': False"))
1244 ;; The youtube-dl program from the inputs is actually a wrapper
1245 ;; script written in bash, so attempting to invoke it as a python
1246 ;; script will fail.
1247 (substitute* "youtube_dl_gui/downloaders.py"
1248 (("cmd = \\['python', self\\.youtubedl_path\\]")
1249 "cmd = [self.youtubedl_path]"))
1250 ;; Use relative paths for installing data files so youtube-dl-gui
1251 ;; installs the files relative to its prefix in the store, rather
1252 ;; than relative to /. Also, instead of installing data files into
1253 ;; $prefix/usr/share, install them into $prefix/share for
1254 ;; consistency (see: (standards) Directory Variables).
1255 (substitute* "setup.py"
1256 (("= '/usr/share") "= 'share"))
1257 ;; Update get_locale_file() so it finds the installed localization
1258 ;; files.
1259 (substitute* "youtube_dl_gui/utils.py"
1260 (("os\\.path\\.join\\('/usr', 'share'")
1261 (string-append "os.path.join('"
1262 (assoc-ref %outputs "out")
1263 "', 'share'"))))))))
1264 (inputs
1265 `(("python2-wxpython" ,python2-wxpython)
1266 ("youtube-dl" ,youtube-dl)))
1267 (home-page "https://github.com/MrS0m30n3/youtube-dl-gui")
1268 (synopsis
1269 "GUI (Graphical User Interface) for @command{youtube-dl}")
1270 (description
1271 "Youtube-dlG is a GUI (Graphical User Interface) for
1272 @command{youtube-dl}. You can use it to download videos from YouTube and any
1273 other site that youtube-dl supports.")
1274 (license license:unlicense)))
1275
1276 (define-public you-get
1277 (package
1278 (name "you-get")
1279 (version "0.4.1025")
1280 (source (origin
1281 (method url-fetch)
1282 (uri (string-append
1283 "https://github.com/soimort/you-get/archive/v"
1284 version ".tar.gz"))
1285 (file-name (string-append name "-" version ".tar.gz"))
1286 (sha256
1287 (base32
1288 "10103jw1gzar85jlajzl9wslk08vw21n26hkhfcz5bvkm9lxxs2c"))))
1289 (build-system python-build-system)
1290 (inputs
1291 `(("ffmpeg" ,ffmpeg))) ; for multi-part and >=1080p videos
1292 (arguments
1293 `(#:phases
1294 (modify-phases %standard-phases
1295 (add-after 'unpack 'qualify-input-references
1296 ;; Explicitly invoke the input ffmpeg, instead of whichever one
1297 ;; happens to be in the user's $PATH at run time.
1298 (lambda* (#:key inputs #:allow-other-keys)
1299 (let ((ffmpeg (string-append (assoc-ref inputs "ffmpeg")
1300 "/bin/ffmpeg")))
1301 (substitute* "src/you_get/processor/ffmpeg.py"
1302 ;; Don't blindly replace all occurrences of ‘'ffmpeg'’: the
1303 ;; same string is also used when sniffing ffmpeg's output.
1304 (("(FFMPEG == |\\()'ffmpeg'" _ prefix)
1305 (string-append prefix "'" ffmpeg "'")))
1306 #t))))
1307 #:tests? #f)) ; XXX some tests need Internet access
1308 (synopsis "Download videos, audio, or images from Web sites")
1309 (description
1310 "You-Get is a command-line utility to download media contents (videos,
1311 audio, images) from the Web. It can use either mpv or vlc for playback.")
1312 (home-page "https://you-get.org/")
1313 (license license:expat)))
1314
1315 (define-public youtube-viewer
1316 (package
1317 (name "youtube-viewer")
1318 (version "3.3.3")
1319 (source (origin
1320 (method url-fetch)
1321 (uri (string-append
1322 "https://github.com/trizen/youtube-viewer/archive/"
1323 version ".tar.gz"))
1324 (file-name (string-append name "-" version ".tar.gz"))
1325 (sha256
1326 (base32
1327 "1j572his6qmazlmyrbnfq62s9bqml875ay7wy26byy9hfc7m0vgk"))))
1328 (build-system perl-build-system)
1329 (native-inputs
1330 `(("perl-module-build" ,perl-module-build)))
1331 ;; FIXME: Add optional dependencies once available:
1332 ;; perl-lwp-useragent-cached and perl-term-readline-gnu
1333 (inputs
1334 `(("perl-data-dump" ,perl-data-dump)
1335 ("perl-file-sharedir" ,perl-file-sharedir)
1336 ("perl-gtk2" ,perl-gtk2)
1337 ("perl-json" ,perl-json)
1338 ("perl-libwww" ,perl-libwww)
1339 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1340 ("perl-mozilla-ca" ,perl-mozilla-ca)
1341 ("perl-unicode-linebreak" ,perl-unicode-linebreak)))
1342 (arguments
1343 `(#:modules ((guix build perl-build-system)
1344 (guix build utils)
1345 (srfi srfi-26))
1346 #:module-build-flags '("--gtk")
1347 #:phases
1348 (modify-phases %standard-phases
1349 (add-after 'install 'wrap-program
1350 (lambda* (#:key outputs #:allow-other-keys)
1351 (let* ((out (assoc-ref outputs "out"))
1352 (bin-dir (string-append out "/bin/"))
1353 (site-dir (string-append out "/lib/perl5/site_perl/"))
1354 (lib-path (getenv "PERL5LIB")))
1355 (for-each (cut wrap-program <>
1356 `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
1357 (find-files bin-dir))
1358 #t))))))
1359 (synopsis
1360 "Lightweight application for searching and streaming videos from YouTube")
1361 (description
1362 "Youtube-viewer searches and plays YouTube videos in a native player.
1363 It comes with various search options; it can search for videos, playlists
1364 and/or channels. The videos are streamed directly in a selected video player
1365 at the best resolution (customizable) and with closed-captions (if available).
1366 Both command-line and GTK2 interface are available.")
1367 (home-page "https://github.com/trizen/youtube-viewer")
1368 (license license:perl-license)))
1369
1370 (define-public libbluray
1371 (package
1372 (name "libbluray")
1373 (version "1.0.2")
1374 (source (origin
1375 (method url-fetch)
1376 (uri (string-append "https://download.videolan.org/videolan/"
1377 name "/" version "/"
1378 name "-" version ".tar.bz2"))
1379 (sha256
1380 (base32
1381 "1zxfnw1xbghcj7b3zz5djndv6gwssxda19cz1lrlqrkg8577r7kd"))))
1382 (build-system gnu-build-system)
1383 (arguments
1384 `(#:configure-flags '("--disable-bdjava-jar")
1385 #:phases
1386 (modify-phases %standard-phases
1387 (add-after 'unpack 'refer-to-libxml2-in-.pc-file
1388 ;; Avoid the need to propagate libxml2 by referring to it
1389 ;; directly, as is already done for fontconfig & freetype.
1390 (lambda* (#:key inputs #:allow-other-keys)
1391 (let ((libxml2 (assoc-ref inputs "libxml2")))
1392 (substitute* "configure"
1393 ((" libxml-2.0") ""))
1394 (substitute* "src/libbluray.pc.in"
1395 (("^Libs.private:" field)
1396 (string-append field " -L" libxml2 "/lib -lxml2")))
1397 #t)))
1398 (add-before 'build 'fix-dlopen-paths
1399 (lambda* (#:key inputs #:allow-other-keys)
1400 (let ((libaacs (assoc-ref inputs "libaacs"))
1401 (libbdplus (assoc-ref inputs "libbdplus")))
1402 (substitute* "src/libbluray/disc/aacs.c"
1403 (("\"libaacs\"")
1404 (string-append "\"" libaacs "/lib/libaacs\"")))
1405 (substitute* "src/libbluray/disc/bdplus.c"
1406 (("\"libbdplus\"")
1407 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1408 #t))))))
1409 (native-inputs `(("pkg-config" ,pkg-config)))
1410 (inputs
1411 `(("fontconfig" ,fontconfig)
1412 ("freetype" ,freetype)
1413 ("libaacs" ,libaacs)
1414 ("libbdplus" ,libbdplus)
1415 ("libxml2" ,libxml2)))
1416 (home-page "https://www.videolan.org/developers/libbluray.html")
1417 (synopsis "Blu-Ray Disc playback library")
1418 (description
1419 "libbluray is a library designed for Blu-Ray Disc playback for media
1420 players, like VLC or MPlayer.")
1421 (license license:lgpl2.1+)))
1422
1423 (define-public libdvdread
1424 (package
1425 (name "libdvdread")
1426 (version "6.0.0")
1427 (source (origin
1428 (method url-fetch)
1429 (uri (string-append "https://download.videolan.org/videolan/"
1430 name "/" version "/"
1431 name "-" version ".tar.bz2"))
1432 (sha256
1433 (base32
1434 "0dgr23fzcjhb7ck54xkr9zmf4jcq3ph0dz3fbyvla1c6ni9ijfxk"))))
1435 (build-system gnu-build-system)
1436 (arguments
1437 `(#:configure-flags '("--with-libdvdcss=yes")))
1438 (native-inputs
1439 `(("pkg-config" ,pkg-config)))
1440 (propagated-inputs
1441 `(("libdvdcss" ,libdvdcss)))
1442 (home-page "http://dvdnav.mplayerhq.hu/")
1443 (synopsis "Library for reading video DVDs")
1444 (description
1445 "Libdvdread provides a simple foundation for reading DVD video
1446 disks. It provides the functionality that is required to access many
1447 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1448 authentication and descrambling (if an external libdvdcss library is
1449 installed).")
1450 (license license:gpl2+)))
1451
1452 (define-public dvdauthor
1453 (package
1454 (name "dvdauthor")
1455 (version "0.7.2")
1456 (source
1457 (origin
1458 (method url-fetch)
1459 (uri (string-append "mirror://sourceforge/dvdauthor/dvdauthor-"
1460 version ".tar.gz"))
1461 (sha256
1462 (base32
1463 "1drfc47hikfzc9d7hjk34rw10iqw01d2vwmn91pv73ppx4nsj81h"))))
1464 (build-system gnu-build-system)
1465 (inputs
1466 `(("libdvdread" ,libdvdread)
1467 ("libpng" ,libpng)
1468 ("imagemagick" ,imagemagick)
1469 ("libxml2" ,libxml2)
1470 ("freetype" ,freetype)))
1471 (native-inputs
1472 `(("pkg-config" ,pkg-config)))
1473 (synopsis "Generates a DVD-Video movie from a MPEG-2 stream")
1474 (description "@command{dvdauthor} will generate a DVD-Video movie from a
1475 MPEG-2 stream containing VOB packets.")
1476 (home-page "http://dvdauthor.sourceforge.net")
1477 (license license:gpl3+)))
1478
1479 (define-public libdvdnav
1480 (package
1481 (name "libdvdnav")
1482 (version "6.0.0")
1483 (source (origin
1484 (method url-fetch)
1485 (uri (string-append "https://download.videolan.org/videolan/"
1486 name "/" version "/"
1487 name "-" version ".tar.bz2"))
1488 (sha256
1489 (base32
1490 "062njcksmpgw9yv3737qkf93r2pzhaxi9szqjabpa8d010dp38ph"))))
1491 (build-system gnu-build-system)
1492 (native-inputs
1493 `(("pkg-config" ,pkg-config)))
1494 (inputs
1495 `(("libdvdread" ,libdvdread)))
1496 (home-page "http://dvdnav.mplayerhq.hu/")
1497 (synopsis "Library for video DVD navigation features")
1498 (description
1499 "Libdvdnav is a library for developers of multimedia
1500 applications. It allows easy use of sophisticated DVD navigation features
1501 such as DVD menus, multiangle playback and even interactive DVD games. All
1502 this functionality is provided through a simple API which provides the DVD
1503 playback as a single logical stream of blocks, intermitted by special
1504 dvdnav events to report certain conditions. The main usage of libdvdnav is
1505 a loop regularly calling a function to get the next block, surrounded by
1506 additional calls to tell the library of user interaction. The whole
1507 DVD virtual machine and internal playback states are completely
1508 encapsulated.")
1509 (license license:gpl2+)))
1510
1511 (define-public libdvdcss
1512 (package
1513 (name "libdvdcss")
1514 (version "1.4.1")
1515 (source (origin
1516 (method url-fetch)
1517 (uri (string-append "https://download.videolan.org/pub/"
1518 name "/" version "/"
1519 name "-" version ".tar.bz2"))
1520 (sha256
1521 (base32
1522 "1b7awvyahivglp7qmgx2g5005kc5npv257gw7wxdprjsnx93f1zb"))))
1523 (build-system gnu-build-system)
1524 (home-page "https://www.videolan.org/developers/libdvdcss.html")
1525 (synopsis "Library for accessing DVDs as block devices")
1526 (description
1527 "libdvdcss is a simple library designed for accessing DVDs like a block
1528 device without having to bother about the decryption.")
1529 (license license:gpl2+)))
1530
1531 (define-public srt2vtt
1532 (package
1533 (name "srt2vtt")
1534 (version "0.1")
1535 (source (origin
1536 (method url-fetch)
1537 (uri (string-append
1538 "https://files.dthompson.us/srt2vtt/srt2vtt-"
1539 version ".tar.gz"))
1540 (sha256
1541 (base32
1542 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1543 (build-system gnu-build-system)
1544 (inputs
1545 `(("guile" ,guile-2.0)))
1546 (synopsis "SubRip to WebVTT subtitle converter")
1547 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1548 for use with HTML5 video.")
1549 (home-page "http://dthompson.us/pages/software/srt2vtt")
1550 (license license:gpl3+)))
1551
1552 (define-public avidemux
1553 (package
1554 (name "avidemux")
1555 (version "2.6.12")
1556 (source (origin
1557 (method url-fetch)
1558 (uri (string-append
1559 "mirror://sourceforge/" name "/" name "/" version "/"
1560 name "_" version ".tar.gz"))
1561 (sha256
1562 (base32
1563 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1564 (patches (search-patches "avidemux-install-to-lib.patch"))))
1565 (build-system cmake-build-system)
1566 (native-inputs
1567 `(("pkg-config" ,pkg-config)))
1568 ;; FIXME: Once packaged, add libraries not found during the build.
1569 (inputs
1570 `(("alsa-lib" ,alsa-lib)
1571 ("fontconfig" ,fontconfig)
1572 ("freetype" ,freetype)
1573 ("fribidi" ,fribidi)
1574 ("glu" ,glu)
1575 ("jack" ,jack-1)
1576 ("lame" ,lame)
1577 ("libva" ,libva)
1578 ("libvdpau" ,libvdpau)
1579 ("libvorbis" ,libvorbis)
1580 ("libvpx" ,libvpx)
1581 ("libxv" ,libxv)
1582 ("perl" ,perl)
1583 ("pulseaudio" ,pulseaudio)
1584 ("python" ,python-wrapper)
1585 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
1586 ;("qtbase" ,qtbase) with -std=gnu++11.
1587 ;("qttools" ,qttools)
1588 ("sdl" ,sdl)
1589 ("sqlite" ,sqlite)
1590 ("yasm" ,yasm)
1591 ("zlib" ,zlib)))
1592 (arguments
1593 `(#:tests? #f ; no check target
1594 #:phases
1595 ;; Make sure files inside the included ffmpeg tarball are
1596 ;; patch-shebanged.
1597 (modify-phases %standard-phases
1598 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1599 (lambda _
1600 (with-directory-excursion "avidemux_core/ffmpeg_package"
1601 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1602 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1603 (add-after 'patch-source-shebangs 'repack-ffmpeg
1604 (lambda _
1605 (with-directory-excursion "avidemux_core/ffmpeg_package"
1606 (substitute* "ffmpeg-2.7.6/configure"
1607 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1608 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1609 ;; avoid non-determinism in the archive
1610 "--sort=name" "--mtime=@0"
1611 "--owner=root:0" "--group=root:0")
1612 (delete-file-recursively "ffmpeg-2.7.6"))))
1613 (replace 'configure
1614 (lambda _
1615 ;; Copy-paste settings from the cmake build system.
1616 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1617 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1618 (replace 'build
1619 (lambda* (#:key inputs outputs #:allow-other-keys)
1620 (let*
1621 ((out (assoc-ref outputs "out"))
1622 (lib (string-append out "/lib"))
1623 (top (getcwd))
1624 (sdl (assoc-ref inputs "sdl"))
1625 (build_component
1626 (lambda* (component srcdir #:optional (args '()))
1627 (let ((builddir (string-append "build_" component)))
1628 (mkdir builddir)
1629 (with-directory-excursion builddir
1630 (zero?
1631 (and
1632 (apply system* "cmake"
1633 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1634 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1635 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1636 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1637 "\"-Wl,-rpath=" lib "\"")
1638 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1639 (string-append "-DSDL_INCLUDE_DIR="
1640 sdl "/include/SDL")
1641 (string-append "../" srcdir)
1642 "-DENABLE_QT5=True"
1643 args)
1644 (system* "make" "-j"
1645 (number->string (parallel-job-count)))
1646 (system* "make" "install"))))))))
1647 (mkdir out)
1648 (and (build_component "core" "avidemux_core")
1649 (build_component "cli" "avidemux/cli")
1650 (build_component "qt4" "avidemux/qt4")
1651 (build_component "plugins_common" "avidemux_plugins"
1652 '("-DPLUGIN_UI=COMMON"))
1653 (build_component "plugins_cli" "avidemux_plugins"
1654 '("-DPLUGIN_UI=CLI"))
1655 (build_component "plugins_qt4" "avidemux_plugins"
1656 '("-DPLUGIN_UI=QT4"))
1657 (build_component "plugins_settings" "avidemux_plugins"
1658 '("-DPLUGIN_UI=SETTINGS")))
1659 ;; Remove .exe and .dll file.
1660 (delete-file-recursively
1661 (string-append out "/share/ADM6_addons")))))
1662 (delete 'install))))
1663 (home-page "http://fixounet.free.fr/avidemux/")
1664 (synopsis "Video editor")
1665 (description "Avidemux is a video editor designed for simple cutting,
1666 filtering and encoding tasks. It supports many file types, including AVI,
1667 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1668 can be automated using projects, job queue and powerful scripting
1669 capabilities.")
1670 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
1671 ;; Software with various licenses is included, see License.txt.
1672 (license license:gpl2+)))
1673
1674 (define-public vapoursynth
1675 (package
1676 (name "vapoursynth")
1677 (version "37")
1678 (source (origin
1679 (method url-fetch)
1680 (uri (string-append
1681 "https://github.com/vapoursynth/vapoursynth/archive/R"
1682 version ".tar.gz"))
1683 (file-name (string-append name "-" version ".tar.gz"))
1684 (sha256
1685 (base32
1686 "1g3hc079jw4mz1cmkv2y28pdb556wqc8ql7iravgh1rg8j3f1zi5"))))
1687 (build-system gnu-build-system)
1688 (native-inputs
1689 `(("autoconf" ,autoconf)
1690 ("automake" ,automake)
1691 ("cython" ,python-cython)
1692 ("libtool" ,libtool)
1693 ("pkg-config" ,pkg-config)
1694 ("python" ,python)
1695 ("yasm" ,yasm)))
1696 (inputs
1697 `(("ffmpeg" ,ffmpeg)
1698 ("libass" ,libass)
1699 ("tesseract-ocr" ,tesseract-ocr)
1700 ("zimg" ,zimg)))
1701 (arguments
1702 '(#:phases
1703 (modify-phases %standard-phases
1704 (add-after
1705 'unpack 'autogen
1706 (lambda _
1707 (zero? (system* "sh" "autogen.sh")))))))
1708 (home-page "http://www.vapoursynth.com/")
1709 (synopsis "Video processing framework")
1710 (description "VapourSynth is a C++ library and Python module for video
1711 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1712 multithreading, generalized colorspaces, per frame properties, and videos with
1713 format changes.")
1714 ;; src/core/cpufeatures only allows x86, ARM or PPC
1715 (supported-systems (fold delete %supported-systems
1716 '("mips64el-linux" "aarch64-linux")))
1717 ;; As seen from the source files.
1718 (license license:lgpl2.1+)))
1719
1720 (define-public xvid
1721 (package
1722 (name "xvid")
1723 (version "1.3.4")
1724 (source (origin
1725 (method url-fetch)
1726 (uri (string-append
1727 "http://downloads.xvid.org/downloads/xvidcore-"
1728 version ".tar.bz2"))
1729 (sha256
1730 (base32
1731 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1732 (build-system gnu-build-system)
1733 (native-inputs `(("yasm" ,yasm)))
1734 (arguments
1735 '(#:phases
1736 (modify-phases %standard-phases
1737 (add-before
1738 'configure 'pre-configure
1739 (lambda _
1740 (chdir "build/generic")
1741 (substitute* "configure"
1742 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1743 ;; No 'check' target.
1744 #:tests? #f))
1745 (home-page "https://www.xvid.com/")
1746 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1747 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1748 codec library. It uses ASP features such as b-frames, global and quarter
1749 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1750 and custom quantization matrices.")
1751 (license license:gpl2+)))
1752
1753 (define-public streamlink
1754 (package
1755 (name "streamlink")
1756 (version "0.10.0")
1757 (source
1758 (origin
1759 (method url-fetch)
1760 (uri (pypi-uri "streamlink" version))
1761 (sha256
1762 (base32
1763 "17299xnd9jzi7m1d2rr4xdlj47q64bzj2957nlsrhw0hskds1s6h"))))
1764 (build-system python-build-system)
1765 (home-page "https://github.com/streamlink/streamlink")
1766 (native-inputs
1767 `(("python-pytest" ,python-pytest)
1768 ("python-mock" ,python-mock)
1769 ("python-requests-mock" ,python-requests-mock)))
1770 (propagated-inputs
1771 `(("python-pysocks" ,python-pysocks)
1772 ("python-websocket-client" ,python-websocket-client)
1773 ("python-iso3166" ,python-iso3166)
1774 ("python-iso639" ,python-iso639)
1775 ("python-pycryptodome" ,python-pycryptodome)
1776 ("python-requests" ,python-requests)))
1777 (synopsis "Extract streams from various services")
1778 (description "Streamlink is command-line utility that extracts streams
1779 from sites like Twitch.tv and pipes them into a video player of choice.")
1780 (license license:bsd-2)))
1781
1782 (define-public livestreamer
1783 (deprecated-package "livestreamer" streamlink))
1784
1785 (define-public mlt
1786 (package
1787 (name "mlt")
1788 (version "6.4.1")
1789 (source (origin
1790 (method url-fetch)
1791 (uri (string-append "https://github.com/mltframework/mlt/"
1792 "archive/v" version ".tar.gz"))
1793 (file-name (string-append name "-" version ".tar.gz"))
1794 (sha256
1795 (base32
1796 "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))
1797 (modules '((guix build utils)))
1798 (snippet
1799 ;; As of glibc 2.26, <xlocale.h> no longer is.
1800 '(substitute* "src/framework/mlt_property.h"
1801 (("xlocale\\.h") "locale.h")))))
1802 (build-system gnu-build-system)
1803 (arguments
1804 `(#:tests? #f ; no tests
1805 #:make-flags '("CC=gcc")
1806 #:configure-flags
1807 (list "--enable-gpl3"
1808 "--enable-gpl")
1809 #:phases
1810 (modify-phases %standard-phases
1811 (add-after
1812 'configure 'override-LDFLAGS
1813 (lambda* (#:key outputs #:allow-other-keys)
1814 (substitute* "config.mak"
1815 (("LDFLAGS\\+=")
1816 (string-append "LDFLAGS+=-Wl,-rpath="
1817 (assoc-ref outputs "out")
1818 "/lib ")))
1819 #t)))))
1820 (inputs
1821 `(("alsa-lib" ,alsa-lib)
1822 ("ffmpeg" ,ffmpeg)
1823 ("fftw" ,fftw)
1824 ("libxml2" ,libxml2)
1825 ("jack" ,jack-1)
1826 ("ladspa" ,ladspa)
1827 ("libsamplerate" ,libsamplerate)
1828 ("pulseaudio" ,pulseaudio)
1829 ("sdl" ,sdl)
1830 ("sox" ,sox)))
1831 (native-inputs
1832 `(("pkg-config" ,pkg-config)))
1833 (home-page "https://www.mltframework.org/")
1834 (synopsis "Author, manage, and run multitrack audio/video compositions")
1835 (description
1836 "MLT is a multimedia framework, designed and developed for television
1837 broadcasting. It provides a toolkit for broadcasters, video editors, media
1838 players, transcoders, web streamers and many more types of applications. The
1839 functionality of the system is provided via an assortment of ready to use
1840 tools, XML authoring components, and an extensible plug-in based API.")
1841 (license license:gpl3)))
1842
1843 (define-public v4l-utils
1844 (package
1845 (name "v4l-utils")
1846 (version "1.12.5")
1847 (source (origin
1848 (method url-fetch)
1849 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1850 "/v4l-utils-" version ".tar.bz2"))
1851 (sha256
1852 (base32
1853 "03g2b4rivrilimcp57mwrlsa3qvrxmk4sza08mygwmqbvcnic606"))))
1854 (build-system gnu-build-system)
1855 (arguments
1856 '(#:configure-flags
1857 (list (string-append "--with-udevdir="
1858 (assoc-ref %outputs "out")
1859 "/lib/udev")
1860 "CXXFLAGS=-std=gnu++11")))
1861 (native-inputs
1862 `(("perl" ,perl)
1863 ("pkg-config" ,pkg-config)))
1864 (inputs
1865 `(("alsa-lib" ,alsa-lib)
1866 ("glu" ,glu)
1867 ("libjpeg" ,libjpeg)
1868 ("libx11" ,libx11)
1869 ("qtbase" ,qtbase)
1870 ("eudev" ,eudev)))
1871 (synopsis "Realtime video capture utilities for Linux")
1872 (description "The v4l-utils provide a series of libraries and utilities to
1873 be used for realtime video capture via Linux-specific APIs.")
1874 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1875 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1876 (license (list license:lgpl2.1+ license:gpl2))))
1877
1878 (define-public obs
1879 (package
1880 (name "obs")
1881 (version "20.1.3")
1882 (source (origin
1883 (method url-fetch)
1884 (uri (string-append "https://github.com/jp9000/obs-studio"
1885 "/archive/" version ".tar.gz"))
1886 (file-name (string-append name "-" version ".tar.gz"))
1887 (sha256
1888 (base32
1889 "1g5z6z050v25whc7n3xvg6l238wmg5crp7ihvk73qngvzxr8bg28"))))
1890 (build-system cmake-build-system)
1891 (arguments
1892 `(#:tests? #f)) ; no tests
1893 (native-inputs
1894 `(("pkg-config" ,pkg-config)))
1895 (inputs
1896 `(("alsa-lib" ,alsa-lib)
1897 ("curl" ,curl)
1898 ("eudev" ,eudev)
1899 ("ffmpeg" ,ffmpeg)
1900 ("fontconfig" ,fontconfig)
1901 ("freetype" ,freetype)
1902 ("jack" ,jack-1)
1903 ("jansson" ,jansson)
1904 ("libx264" ,libx264)
1905 ("libxcomposite" ,libxcomposite)
1906 ("mesa" ,mesa)
1907 ("pulseaudio" ,pulseaudio)
1908 ("qtbase" ,qtbase)
1909 ("qtx11extras" ,qtx11extras)
1910 ("speex" ,speex)
1911 ("v4l-utils" ,v4l-utils)
1912 ("zlib" ,zlib)))
1913 (synopsis "Live streaming software")
1914 (description "Open Broadcaster Software provides a graphical interface for
1915 video recording and live streaming. OBS supports capturing audio and video
1916 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1917 and JACK.")
1918 (home-page "https://obsproject.com")
1919 (supported-systems '("x86_64-linux" "i686-linux"))
1920 (license license:gpl2+)))
1921
1922 (define-public libvdpau
1923 (package
1924 (name "libvdpau")
1925 (version "1.1.1")
1926 (source
1927 (origin
1928 (method url-fetch)
1929 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1930 name "-" version ".tar.bz2"))
1931 (sha256
1932 (base32
1933 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1934 (build-system gnu-build-system)
1935 (native-inputs
1936 `(("pkg-config" ,pkg-config)))
1937 (inputs
1938 `(("dri2proto" ,dri2proto)
1939 ("libx11" ,libx11 "out")
1940 ("libxext" ,libxext)))
1941 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1942 (synopsis "Video Decode and Presentation API")
1943 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1944 provides an interface to video decode acceleration and presentation hardware
1945 present in modern GPUs.")
1946 (license (license:x11-style "file://COPYING"))))
1947
1948 (define-public vdpauinfo
1949 (package
1950 (name "vdpauinfo")
1951 (version "1.0")
1952 (source
1953 (origin
1954 (method url-fetch)
1955 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1956 name "-" version ".tar.gz"))
1957 (sha256
1958 (base32
1959 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1960 (build-system gnu-build-system)
1961 (native-inputs
1962 `(("pkg-config" ,pkg-config)
1963 ("libx11" ,libx11)))
1964 (propagated-inputs
1965 `(("libvdpau" ,libvdpau)))
1966 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1967 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1968 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1969 implementation.")
1970 (license (license:x11-style "file://COPYING"))))
1971
1972 (define-public libvdpau-va-gl
1973 (package
1974 (name "libvdpau-va-gl")
1975 (version "0.4.2")
1976 (source
1977 (origin
1978 (method url-fetch)
1979 (uri (string-append "https://github.com/i-rinat/libvdpau-va-gl/"
1980 "releases/download/v" version "/libvdpau-va-gl-"
1981 version ".tar.gz"))
1982 (sha256
1983 (base32
1984 "1x2ag1f2fwa4yh1g5spv99w9x1m33hbxlqwyhm205ssq0ra234bx"))
1985 (patches (search-patches "libvdpau-va-gl-unbundle.patch"))
1986 (modules '((guix build utils)))
1987 (snippet '(delete-file-recursively "3rdparty"))))
1988 (build-system cmake-build-system)
1989 (arguments
1990 '(#:tests? #f)) ; Tests require a running X11 server, with VA-API support.
1991 (native-inputs
1992 `(("libvdpau" ,libvdpau)
1993 ("pkg-config" ,pkg-config)))
1994 (inputs
1995 `(("libva" ,libva)
1996 ("mesa" ,mesa)))
1997 (home-page "https://github.com/i-rinat/libvdpau-va-gl")
1998 (synopsis "VDPAU driver with VA-API/OpenGL backend")
1999 (description
2000 "Many applications can use VDPAU to accelerate portions of the video
2001 decoding process and video post-processing to the GPU video hardware. Since
2002 there is no VDPAU available on Intel chips, they fall back to different drawing
2003 techniques. This driver uses OpenGL under the hood to accelerate drawing and
2004 scaling and VA-API (if available) to accelerate video decoding.")
2005 (license license:expat)))
2006
2007 (define-public recordmydesktop
2008 (package
2009 (name "recordmydesktop")
2010 (version "0.3.8.1")
2011 (source (origin
2012 (method url-fetch)
2013 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2014 version "/recordmydesktop-" version ".tar.gz"))
2015 (sha256
2016 (base32
2017 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
2018 (build-system gnu-build-system)
2019 (inputs `(("popt" ,popt)
2020 ("zlib" ,zlib)
2021 ("libx11" ,libx11)
2022 ("libice" ,libice)
2023 ("libsm" ,libsm)
2024 ("libxfixes" ,libxfixes)
2025 ("libxdamage" ,libxdamage)
2026 ("libxext" ,libxext)
2027 ("alsa-lib" ,alsa-lib)
2028 ("libvorbis" ,libvorbis)
2029 ("libtheora" ,libtheora)))
2030 (home-page "http://recordmydesktop.sourceforge.net/")
2031 (synopsis "Desktop session video recorder")
2032 (description
2033 "recordMyDesktop is a command-line tool that captures the activity in
2034 your graphical desktop and encodes it as a video. This is a useful tool for
2035 making @dfn{screencasts}.")
2036 (license license:gpl2+)))
2037
2038 (define-public simplescreenrecorder
2039 (package
2040 (name "simplescreenrecorder")
2041 (version "0.3.9")
2042 (source
2043 (origin
2044 (method url-fetch)
2045 (uri (string-append "https://github.com/MaartenBaert/ssr/archive/"
2046 version ".tar.gz"))
2047 (file-name (string-append name "-" version ".tar.gz"))
2048 (sha256
2049 (base32
2050 "1gnf9wbiq2fcbqcn1a5nfmp8r0nxrrlgh2wly2mfkkwymynhx0pk"))))
2051 (build-system cmake-build-system)
2052 ;; Although libx11, libxfixes, libxext are listed as build dependencies in
2053 ;; README.md, the program builds and functions properly without them.
2054 ;; As a result, they are omitted. Please add them back if problems appear.
2055 (inputs
2056 `(("alsa-lib" ,alsa-lib)
2057 ("ffmpeg" ,ffmpeg)
2058 ("glu" ,glu)
2059 ("jack" ,jack-1)
2060 ("libxi" ,libxi)
2061 ("pulseaudio" ,pulseaudio)
2062 ("qt" ,qt)))
2063 (native-inputs `(("pkg-config" ,pkg-config)))
2064 (arguments
2065 `(#:configure-flags
2066 (list "-DWITH_QT5=TRUE")
2067 #:tests? #f)) ; no test suite
2068 ;; Using HTTPS causes part of the page to be displayed improperly.
2069 (home-page "http://www.maartenbaert.be/simplescreenrecorder/")
2070 (synopsis "Screen recorder")
2071 (description "SimpleScreenRecorder is an easy to use screen recorder with
2072 a graphical user interface. It supports recording the entire screen, or a
2073 part of it, and allows encoding in many different codecs and file formats.
2074 Other features include a live preview and live streaming.")
2075 (license (list license:gpl3+ ; most files
2076 license:zlib ; glinject/elfhacks.*
2077 license:isc ; glinject/*
2078 license:x11)))) ; build-aux/install-sh
2079
2080 (define-public libsmpeg
2081 (package
2082 (name "libsmpeg")
2083 (version "0.4.5")
2084 (source (origin
2085 (method svn-fetch)
2086 (uri (svn-reference
2087 (url "svn://svn.icculus.org/smpeg/trunk/")
2088 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
2089 (file-name (string-append name "-" version "-checkout"))
2090 (sha256
2091 (base32
2092 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
2093 (build-system gnu-build-system)
2094 (arguments
2095 `(#:phases (modify-phases %standard-phases
2096 (add-after 'unpack 'autogen.sh
2097 (lambda _
2098 (zero? (system* "sh" "autogen.sh")))))))
2099 (native-inputs
2100 `(("autoconf" ,autoconf)
2101 ("automake" ,automake)))
2102 (inputs
2103 `(("sdl" ,sdl2)))
2104 (home-page "http://icculus.org/smpeg/")
2105 (synopsis "SDL MPEG decoding library")
2106 (description
2107 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
2108 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
2109 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
2110 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
2111 and MPEG system streams.")
2112 (license (list license:expat
2113 license:lgpl2.1
2114 license:lgpl2.1+
2115 license:gpl2))))
2116
2117 (define-public libbdplus
2118 (package
2119 (name "libbdplus")
2120 (version "0.1.2")
2121 (source
2122 (origin
2123 (method url-fetch)
2124 (uri (string-append "https://ftp.videolan.org/pub/videolan/libbdplus/"
2125 version "/" name "-" version ".tar.bz2"))
2126 (sha256
2127 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
2128 (inputs
2129 `(("libgcrypt" ,libgcrypt)))
2130 (build-system gnu-build-system)
2131 (home-page "https://www.videolan.org/developers/libbdplus.html")
2132 (synopsis "Library for decrypting certain Blu-Ray discs")
2133 (description "libbdplus is a library which implements the BD+ System
2134 specifications.")
2135 (license license:lgpl2.1+)))
2136
2137 (define-public libaacs
2138 (package
2139 (name "libaacs")
2140 (version "0.9.0")
2141 (source
2142 (origin
2143 (method url-fetch)
2144 (uri (string-append "https://ftp.videolan.org/pub/videolan/libaacs/"
2145 version "/" name "-" version ".tar.bz2"))
2146 (sha256
2147 (base32 "1kms92i0c7i1yl659kqjf19lm8172pnpik5lsxp19xphr74vvq27"))))
2148 (inputs
2149 `(("libgcrypt" ,libgcrypt)))
2150 (native-inputs
2151 `(("bison" ,bison)
2152 ("flex" ,flex)))
2153 (build-system gnu-build-system)
2154 (home-page "https://www.videolan.org/developers/libaacs.html")
2155 (synopsis "Library for decrypting certain Blu-Ray discs")
2156 (description "libaacs is a library which implements the Advanced Access
2157 Content System specification.")
2158 (license license:lgpl2.1+)))
2159
2160 (define-public mps-youtube
2161 (package
2162 (name "mps-youtube")
2163 (version "0.2.7.1")
2164 (source
2165 (origin
2166 (method url-fetch)
2167 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
2168 "archive/v" version ".tar.gz"))
2169 (file-name (string-append name "-" version ".tar.gz"))
2170 (sha256
2171 (base32
2172 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
2173 (build-system python-build-system)
2174 (arguments
2175 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
2176 ;; test suite results differ depending on the country and also introduce
2177 ;; non-determinism in the tests.
2178 ;; https://github.com/mps-youtube/mps-youtube/issues/556
2179 `(#:tests? #f))
2180 (propagated-inputs
2181 `(("python-pafy" ,python-pafy)
2182 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
2183 (home-page "https://github.com/mps-youtube/mps-youtube")
2184 (synopsis "Terminal based YouTube player and downloader")
2185 (description
2186 "@code{mps-youtube} is based on mps, a terminal based program to
2187 search, stream and download music. This implementation uses YouTube as
2188 a source of content and can play and download video as well as audio.
2189 It can use either mpv or mplayer for playback, and for conversion of
2190 formats ffmpeg or libav is used. Users should install one of the
2191 supported players in addition to this package.")
2192 (license license:gpl3+)))
2193
2194 (define-public handbrake
2195 (package
2196 (name "handbrake")
2197 (version "0.10.5")
2198 (source (origin
2199 (method url-fetch)
2200 (uri (string-append "https://handbrake.fr/rotation.php?file="
2201 "HandBrake-" version ".tar.bz2"))
2202 (file-name (string-append "handbrake-" version ".tar.bz2"))
2203 (sha256
2204 (base32
2205 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
2206 (patches (search-patches "handbrake-pkg-config-path.patch"))
2207 (modules '((guix build utils)))
2208 (snippet
2209 ;; Remove bundled libraries and source not necessary for
2210 ;; running under a GNU environment.
2211 '(begin
2212 (for-each delete-file-recursively '("contrib" "macosx" "win"))
2213 #t))))
2214 (build-system glib-or-gtk-build-system)
2215 (native-inputs
2216 `(("automake" ,automake) ;gui subpackage must be bootstrapped
2217 ("autoconf" ,autoconf)
2218 ("curl" ,curl) ;not actually used, but tested for
2219 ("intltool" ,intltool)
2220 ("libtool" ,libtool)
2221 ("pkg-config" ,pkg-config)
2222 ("python" ,python-2))) ;for configuration
2223 (inputs
2224 `(("bzip2" ,bzip2)
2225 ("dbus-glib" ,dbus-glib)
2226 ("ffmpeg" ,ffmpeg)
2227 ("fontconfig" ,fontconfig)
2228 ("freetype" ,freetype)
2229 ("glib" ,glib)
2230 ("gstreamer" ,gstreamer)
2231 ("gst-plugins-base" ,gst-plugins-base)
2232 ("gtk+" ,gtk+)
2233 ("lame" ,lame)
2234 ("libass" ,libass)
2235 ("libbluray" ,libbluray)
2236 ("libdvdnav" ,libdvdnav)
2237 ("libdvdread" ,libdvdread)
2238 ("libgudev" ,libgudev)
2239 ("libmpeg2" ,libmpeg2)
2240 ("libnotify" ,libnotify)
2241 ("libogg" ,libogg)
2242 ("libsamplerate" ,libsamplerate)
2243 ("libtheora" ,libtheora)
2244 ("libvorbis" ,libvorbis)
2245 ("libvpx" ,libvpx)
2246 ("libxml2" ,libxml2)
2247 ("libx264" ,libx264)
2248 ("x265" ,x265)
2249 ("zlib" ,zlib)))
2250 (arguments
2251 `(#:tests? #f ;tests require Ruby and claim to be unsupported
2252 #:phases
2253 (modify-phases %standard-phases
2254 (add-before 'patch-source-shebangs 'bootstrap-gtk
2255 ;; Run bootstrap ahead of time so that shebangs get patched.
2256 (lambda _
2257 (setenv "CONFIG_SHELL" (which "sh"))
2258 (setenv "NOCONFIGURE" "1")
2259 ;; Patch the Makefile so that it doesn't bootstrap again.
2260 (substitute* "gtk/module.rules"
2261 ((".*autogen\\.sh.*") ""))
2262 (zero? (system* "sh" "./gtk/autogen.sh"))))
2263 (add-before 'configure 'disable-contrib
2264 (lambda _
2265 (substitute* "make/include/main.defs"
2266 ;; Disable unconditional inclusion of some "contrib"
2267 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
2268 ;; and libbluray), which would lead to fetching and
2269 ;; building of these libraries. Use our own instead.
2270 (("MODULES \\+= contrib") "# MODULES += contrib"))
2271 #t))
2272 (add-before 'configure 'fix-x265-linking
2273 (lambda _
2274 (substitute* "test/module.defs"
2275 ;; Fix missing library during linking error
2276 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
2277 #t))
2278 (replace 'configure
2279 (lambda* (#:key outputs configure-flags #:allow-other-keys)
2280 ;; 'configure' is not an autoconf-generated script, and
2281 ;; errors on unrecognized arguments,
2282 ;; e.g. --enable-fast-install
2283 (let ((out (assoc-ref outputs "out")))
2284 (zero? (apply system* "./configure"
2285 (string-append "--prefix=" out)
2286 (or configure-flags '()))))))
2287 (add-after 'configure 'chdir-build
2288 (lambda _ (chdir "./build") #t)))))
2289 (home-page "https://handbrake.fr")
2290 (synopsis "Video transcoder")
2291 (description
2292 "HandBrake is a tool for converting video from any format to a selection
2293 of modern, widely supported codecs.")
2294 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
2295 (license (list license:gpl2+ license:bsd-3))))
2296
2297 (define-public openh264
2298 (package
2299 (name "openh264")
2300 (version "1.7.0")
2301 (source (origin
2302 (method url-fetch)
2303 (uri (string-append "https://github.com/cisco/"
2304 name "/archive/v" version ".tar.gz"))
2305 (file-name (string-append name "-" version ".tar.gz"))
2306 (sha256
2307 (base32
2308 "0gv571bqkxk7ic64dmavs1q8nr7p59mcf4ibqp4lc070gn6w61ww"))))
2309 (build-system gnu-build-system)
2310 (native-inputs
2311 `(("nasm" ,nasm)
2312 ("python" ,python)))
2313 (arguments
2314 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2315 "CC=gcc")
2316 #:test-target "test"
2317 #:phases (modify-phases %standard-phases
2318 ;; no configure script
2319 (delete 'configure))))
2320 (home-page "http://www.openh264.org/")
2321 (synopsis "H264 decoder library")
2322 (description
2323 "Openh264 is a library which can decode H264 video streams.")
2324 (license license:bsd-2)))
2325
2326 (define-public libmp4v2
2327 (package
2328 (name "libmp4v2")
2329 (version "2.0.0")
2330 (source
2331 (origin
2332 (method url-fetch)
2333 ;; XXX: The new location of upstream is uncertain and will become relevant the
2334 ;; moment when the googlecode archive shuts down. It is past the date it
2335 ;; should've been turned off. I tried to communicate with upstream, but this
2336 ;; wasn't very responsive and not very helpful. The short summary is, it is
2337 ;; chaos when it comes to the amount of forks and only time will tell where
2338 ;; the new upstream location is.
2339 (uri (string-append "https://storage.googleapis.com/google-"
2340 "code-archive-downloads/v2/"
2341 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
2342 (file-name (string-append name "-" version ".tar.bz2"))
2343 (sha256
2344 (base32
2345 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
2346 (build-system gnu-build-system)
2347 (outputs '("out"
2348 "static")) ; 3.7MiB .a file
2349 (arguments
2350 `(#:phases
2351 (modify-phases %standard-phases
2352 (add-after 'unpack 'remove-dates
2353 (lambda _
2354 ;; Make the build reproducible.
2355 (substitute* "configure"
2356 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
2357 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
2358 #t))
2359 (add-after 'install 'move-static-libraries
2360 (lambda* (#:key outputs #:allow-other-keys)
2361 ;; Move static libraries to the "static" output.
2362 (let* ((out (assoc-ref outputs "out"))
2363 (lib (string-append out "/lib"))
2364 (static (assoc-ref outputs "static"))
2365 (slib (string-append static "/lib")))
2366 (mkdir-p slib)
2367 (for-each (lambda (file)
2368 (install-file file slib)
2369 (delete-file file))
2370 (find-files lib "\\.a$"))
2371 #t))))))
2372 (native-inputs
2373 `(("help2man" ,help2man)
2374 ("dejagnu" ,dejagnu)))
2375 (home-page "https://code.google.com/archive/p/mp4v2/")
2376 (synopsis "API to create and modify mp4 files")
2377 (description
2378 "The MP4v2 library provides an API to create and modify mp4 files as defined by
2379 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
2380 file format that has been used as a multimedia file format in a variety of platforms and
2381 applications. It is a very powerful and extensible format that can accommodate
2382 practically any type of media.")
2383 (license license:mpl1.1)))
2384
2385 (define-public libmediainfo
2386 (package
2387 (name "libmediainfo")
2388 (version "0.7.95")
2389 (source (origin
2390 (method url-fetch)
2391 (uri (string-append "https://mediaarea.net/download/source/"
2392 name "/" version"/"
2393 name "_" version ".tar.bz2"))
2394 (sha256
2395 (base32
2396 "1kchh6285b07z5nixv619hc9gml2ysdayicdiv30frrlqiyxqw4b"))))
2397 ;; TODO add a Big Buck Bunny webm for tests.
2398 (native-inputs
2399 `(("autoconf" ,autoconf)
2400 ("automake" ,automake)
2401 ("libtool" ,libtool)
2402 ("pkg-config" ,pkg-config)
2403 ("zlib" ,zlib)
2404 ("tinyxml2" ,tinyxml2)
2405 ("curl" ,curl)
2406 ("libzen" ,libzen)))
2407 (build-system gnu-build-system)
2408 (arguments
2409 '(#:tests? #f ; see above TODO
2410 #:phases
2411 ;; build scripts not in root of archive
2412 (modify-phases %standard-phases
2413 (add-after 'unpack 'change-to-build-dir
2414 (lambda _
2415 (chdir "Project/GNU/Library")
2416 #t))
2417 (add-after 'change-to-build-dir 'autogen
2418 (lambda _
2419 (zero? (system* "sh" "autogen.sh")))))))
2420 (home-page "https://mediaarea.net/en/MediaInfo")
2421 (synopsis "Library for retrieving media metadata")
2422 (description "MediaInfo is a library used for retrieving technical
2423 information and other metadata about audio or video files. A non-exhaustive
2424 list of the information MediaInfo can retrieve from media files include:
2425
2426 @itemize
2427 @item General: title, author, director, album, track number, date, duration...
2428 @item Video: codec, aspect, fps, bitrate...
2429 @item Audio: codec, sample rate, channels, language, bitrate...
2430 @item Text: language of subtitle
2431 @item Chapters: number of chapters, list of chapters
2432 @end itemize
2433
2434 MediaInfo supports the following formats:
2435
2436 @itemize
2437 @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
2438 MPEG-2, MPEG-4, DVD (VOB)...
2439 @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
2440 @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
2441 @item Subtitles: SRT, SSA, ASS, SAMI...
2442 @end itemize\n")
2443 (license license:bsd-2)))
2444
2445 ;; TODO also have a GUI version available
2446 (define-public mediainfo
2447 (package
2448 (name "mediainfo")
2449 (version "0.7.95")
2450 (source (origin
2451 (method url-fetch)
2452 (uri (string-append "https://mediaarea.net/download/source/"
2453 name "/" version "/"
2454 name "_" version ".tar.bz2"))
2455 (sha256
2456 (base32
2457 "0dy51a3i79jppmg1gi4f6h7jx4hcgnkmfim4d7d3gmnlbkjh8anv"))))
2458 (native-inputs
2459 `(("autoconf" ,autoconf)
2460 ("automake" ,automake)
2461 ("libtool" ,libtool)
2462 ("pkg-config" ,pkg-config)
2463 ("zlib" ,zlib)
2464 ("libmediainfo", libmediainfo)
2465 ("libzen" ,libzen)))
2466 (build-system gnu-build-system)
2467 (arguments
2468 '(#:tests? #f ; lacks tests
2469 #:phases
2470 ;; build scripts not in root of archive
2471 (modify-phases %standard-phases
2472 (add-after 'unpack 'change-to-build-dir
2473 (lambda _
2474 (chdir "Project/GNU/CLI")
2475 #t))
2476 (add-after 'change-to-build-dir 'autogen
2477 (lambda _
2478 (zero? (system* "sh" "autogen.sh")))))))
2479 (home-page "https://mediaarea.net/en/MediaInfo")
2480 (synopsis "Utility for reading media metadata")
2481 (description "MediaInfo is a utility used for retrieving technical
2482 information and other metadata about audio or video files. It supports the
2483 many codecs and formats supported by libmediainfo.")
2484 (license license:bsd-2)))
2485
2486 (define-public livemedia-utils
2487 (package
2488 (name "livemedia-utils")
2489 (version "2017.10.28")
2490 (source (origin
2491 (method url-fetch)
2492 (uri (string-append
2493 "https://download.videolan.org/contrib/live555/live."
2494 version ".tar.gz"))
2495 (sha256
2496 (base32
2497 "0f5kxpayqn3yhabqrd2cqlc74i6x2xr01jfkank1lcilxnfyrsnq"))
2498 (modules '((guix build utils)))
2499 (snippet
2500 ;; As of glibc 2.26, <xlocale.h> no longer is.
2501 '(substitute* "liveMedia/include/Locale.hh"
2502 (("xlocale\\.h") "locale.h")))))
2503 (build-system gnu-build-system)
2504 (arguments
2505 '(#:tests? #f ; no tests
2506 #:make-flags (list "CC=gcc"
2507 (string-append "LDFLAGS=-Wl,-rpath="
2508 (assoc-ref %outputs "out") "/lib")
2509 (string-append "PREFIX="
2510 (assoc-ref %outputs "out")))
2511 #:phases (modify-phases %standard-phases
2512 (add-before 'configure 'fix-makefiles-generation
2513 (lambda _
2514 (substitute* "genMakefiles"
2515 (("/bin/rm") "rm"))
2516 #t))
2517 (replace 'configure
2518 (lambda _
2519 (zero? (system* "./genMakefiles"
2520 "linux-with-shared-libraries")))))))
2521 (home-page "http://www.live555.com/liveMedia/")
2522 (synopsis "Set of C++ libraries for multimedia streaming")
2523 (description "This code forms a set of C++ libraries for multimedia
2524 streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). The libraries
2525 can be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or
2526 JPEG video, and several audio codecs. They can easily be extended to support
2527 additional (audio and/or video) codecs, and can also be used to build basic
2528 RTSP or SIP clients and servers.")
2529 (license license:lgpl3+)))
2530
2531 (define-public libdvbpsi
2532 (package
2533 (name "libdvbpsi")
2534 (version "1.3.2")
2535 (source (origin
2536 (method url-fetch)
2537 (uri (string-append
2538 "https://download.videolan.org/pub/libdvbpsi/"
2539 version "/libdvbpsi-" version ".tar.bz2"))
2540 (sha256
2541 (base32
2542 "1zn5hfv4qbahmydbwh59a3b480s3m5ss27r6ml35gqdip7r3jkmc"))))
2543 (build-system gnu-build-system)
2544 (home-page "https://www.videolan.org/developers/libdvbpsi.html")
2545 (synopsis "Library for decoding and generation of MPEG TS and DVB PSI
2546 tables")
2547 (description "libdvbpsi is a simple library designed for decoding and
2548 generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818s
2549 and ITU-T H.222.0.")
2550 (license license:lgpl2.1)))
2551
2552 (define-public ffms2
2553 (package
2554 (name "ffms2")
2555 (version "2.23")
2556 (home-page "https://github.com/FFMS/ffms2")
2557 (source (origin
2558 (method url-fetch)
2559 (uri (string-append home-page "/archive/" version ".tar.gz"))
2560 (file-name (string-append name "-" version ".tar.gz"))
2561 (sha256
2562 (base32
2563 "1vbkab8vrplxz5xgag8ggzkwp4f7nf285pd0l2a7zy66n6i2m6xh"))))
2564 (build-system gnu-build-system)
2565 (arguments
2566 '(#:configure-flags
2567 (list "--enable-avresample")))
2568 (inputs
2569 `(("zlib" ,zlib)))
2570 (propagated-inputs
2571 `(("ffmpeg" ,ffmpeg)))
2572 (native-inputs
2573 `(("pkg-config" ,pkg-config)))
2574 (synopsis "Cross-platform wrapper around ffmpeg/libav")
2575 (description
2576 "FFMpegSource is a wrapper library around ffmpeg/libav that allows
2577 programmers to access a standard API to open and decompress media files.")
2578 ;; sources are distributed under a different license that the binary.
2579 ;; see https://github.com/FFMS/ffms2/blob/master/COPYING
2580 (license license:gpl2+))); inherits from ffmpeg
2581
2582 (define-public aegisub
2583 (package
2584 (name "aegisub")
2585 (version "3.2.2")
2586 (source (origin
2587 (method url-fetch)
2588 (uri (string-append
2589 "http://ftp.aegisub.org/pub/archives/releases/source/"
2590 name "-" version ".tar.xz"))
2591 (sha256
2592 (base32
2593 "11b83qazc8h0iidyj1rprnnjdivj1lpphvpa08y53n42bfa36pn5"))))
2594 (build-system gnu-build-system)
2595 (arguments
2596 `(#:configure-flags
2597 (list "--disable-update-checker"
2598 "--without-portaudio"
2599 "--without-openal"
2600 "--without-oss")
2601 ;; tests require busted, a lua package we don't have yet
2602 #:tests? #f
2603 #:phases
2604 (modify-phases %standard-phases
2605 (add-before 'configure 'fix-ldflags
2606 (lambda _
2607 (setenv "LDFLAGS" "-pthread"))))))
2608 (inputs
2609 `(("boost" ,boost)
2610 ("desktop-file-utils" ,desktop-file-utils)
2611 ("ffms2" ,ffms2)
2612 ("fftw" ,fftw)
2613 ("hunspell" ,hunspell)
2614 ("mesa" ,mesa)
2615 ("libass" ,libass)
2616 ("alsa-lib" ,alsa-lib)
2617 ("pulseaudio" ,pulseaudio)
2618 ("libx11" ,libx11)
2619 ("freetype" ,freetype)
2620 ("wxwidgets-gtk2" ,wxwidgets-gtk2)))
2621 (native-inputs
2622 `(("intltool" ,intltool)
2623 ("pkg-config" ,pkg-config)))
2624 (home-page "http://www.aegisub.org/")
2625 (synopsis "Subtitle engine")
2626 (description
2627 "Aegisub is a tool for creating and modifying subtitles. Aegisub makes
2628 it quick and easy to time subtitles to audio, and features many powerful
2629 tools for styling them, including a built-in real-time video preview.")
2630 (license (list license:bsd-3 ; the package is licensed under the bsd-3, except
2631 license:mpl1.1 ; for vendor/universalchardet under the mpl1.1
2632 license:expat)))) ; and src/gl that is under a license similar
2633 ; the the Expat license, with a rewording (Software -> Materials). (called MIT
2634 ; by upstream). See https://github.com/Aegisub/Aegisub/blob/master/LICENCE
2635 ; src/MatroskaParser.(c|h) is under bsd-3 with permission from the author
2636
2637 (define-public gst-transcoder
2638 (package
2639 (name "gst-transcoder")
2640 (version "1.12.2")
2641 (source
2642 (origin
2643 (method url-fetch)
2644 (uri (string-append "https://github.com/pitivi/gst-transcoder/"
2645 "archive/" version ".tar.gz"))
2646 (file-name (string-append name "-" version ".tar.gz"))
2647 (sha256
2648 (base32
2649 "0cnwmrsd321s02ff91m3j27ydj7f8wks0jvmp5admlhka6z7zxm9"))))
2650 (build-system meson-build-system)
2651 (inputs
2652 `(("gobject-introspection" ,gobject-introspection)
2653 ("glib" ,glib)
2654 ("gstreamer" ,gstreamer)
2655 ("gst-plugins-base" ,gst-plugins-base)))
2656 (native-inputs
2657 `(("python" ,python)
2658 ("pkg-config" ,pkg-config)))
2659 (home-page "https://github.com/pitivi/gst-transcoder/")
2660 (synopsis "GStreamer Transcoding API")
2661 (description "GStreamer Transcoding API")
2662 (license license:lgpl2.1)))
2663
2664 (define-public gavl
2665 (package
2666 (name "gavl")
2667 (version "1.4.0")
2668 (source
2669 (origin
2670 (method url-fetch)
2671 (uri (string-append "mirror://sourceforge/gmerlin/"
2672 name "/" version "/"
2673 name "-" version ".tar.gz"))
2674 (file-name (string-append name "-" version ".tar.gz"))
2675 (sha256
2676 (base32
2677 "1kikkn971a14zzm7svi7190ldc14fjai0xyhpbcmp48s750sraji"))))
2678 (build-system gnu-build-system)
2679 (arguments
2680 '(#:configure-flags '("LIBS=-lm")))
2681 (native-inputs
2682 `(("pkg-config" ,pkg-config)
2683 ("doxygen" ,doxygen)))
2684 (home-page "http://gmerlin.sourceforge.net")
2685 (synopsis "Low level library for multimedia API building")
2686 (description
2687 "Gavl is short for Gmerlin Audio Video Library. It is a low level
2688 library, upon which multimedia APIs can be built. Gavl handles all the
2689 details of audio and video formats like colorspaces, sample rates,
2690 multichannel configurations, etc. It provides standardized definitions for
2691 those formats as well as container structures for carrying audio samples or
2692 video images inside an application.
2693
2694 In addition, it handles the sometimes ugly task of converting between all
2695 these formats and provides some elementary operations (copying, scaling,
2696 alpha blending etc).")
2697 (license license:gpl3)))
2698
2699 (define-public frei0r-plugins
2700 (package
2701 (name "frei0r-plugins")
2702 (version "1.6.1")
2703 (source
2704 (origin
2705 (method url-fetch)
2706 (uri (string-append "https://files.dyne.org/frei0r/"
2707 "frei0r-plugins-" version ".tar.gz"))
2708 (sha256
2709 (base32
2710 "0pji26fpd0dqrx1akyhqi6729s394irl73dacnyxk58ijqq4dhp0"))))
2711 (build-system gnu-build-system)
2712 (arguments
2713 `(#:phases
2714 (modify-phases %standard-phases
2715 (add-after 'unpack 'autotools
2716 (lambda _
2717 (zero? (system* "sh" "autogen.sh")))))))
2718 ;; TODO: opencv for additional face detection filters
2719 (inputs
2720 `(("gavl" ,gavl)
2721 ("cairo" ,cairo)))
2722 (native-inputs
2723 `(("pkg-config" ,pkg-config)
2724 ("libtool" ,libtool)
2725 ("automake" ,automake)
2726 ("autoconf" ,autoconf)))
2727 (home-page "https://www.dyne.org/software/frei0r/")
2728 (synopsis "Minimalistic plugin API for video effects")
2729 (description
2730 "Frei0r is a minimalistic plugin API for video effects.
2731 The main emphasis is on simplicity for an API that will round up
2732 the most common video effects into simple filters, sources and
2733 mixers that can be controlled by parameters. Frei0r wants to
2734 provide a way to share these simple effects between many
2735 applications, avoiding their reimplementation by different projects.
2736 It counts more than 100 plugins.")
2737 (license (list license:gpl2+
2738 ;; The following files are licensed as LGPL2.1+:
2739 ;; src/generator/ising0r/ising0r.c
2740 ;; src/generator/onecol0r/onecol0r.cpp
2741 ;; src/generator/nois0r/nois0r.cpp
2742 ;; src/generator/lissajous0r/lissajous0r.cpp
2743 ;; src/filter/ndvi/gradientlut.hpp
2744 ;; src/filter/ndvi/ndvi.cpp
2745 ;; src/filter/facedetect/facedetect.cpp
2746 license:lgpl2.1+))))
2747
2748 (define-public motion
2749 (package
2750 (name "motion")
2751 (version "4.1.1")
2752 (home-page "https://motion-project.github.io/")
2753 (source (origin
2754 (method url-fetch)
2755 (uri (string-append
2756 "https://github.com/Motion-Project/motion/archive/"
2757 "release-" version ".tar.gz"))
2758 (sha256
2759 (base32
2760 "1qm4i8zrqafl60sv2frhixvkd0wh0r5jfcrj5i6gha7yplsvjx10"))
2761 (file-name (string-append name "-" version ".tar.gz"))))
2762 (build-system gnu-build-system)
2763 (native-inputs
2764 `(("autoconf" ,(autoconf-wrapper))
2765 ("automake" ,automake)
2766 ("pkg-config" ,pkg-config)))
2767 (inputs
2768 `(("libjpeg" ,libjpeg)
2769 ("ffmpeg" ,ffmpeg)
2770 ("sqlite" ,sqlite)))
2771 (arguments
2772 '(#:phases (modify-phases %standard-phases
2773 (add-after 'unpack 'bootstrap
2774 (lambda _
2775 (patch-shebang "version.sh")
2776 (invoke "autoreconf" "-vfi"))))
2777 #:configure-flags '("--sysconfdir=/etc")
2778 #:make-flags (list (string-append "sysconfdir="
2779 (assoc-ref %outputs "out")
2780 "/etc"))
2781
2782 #:tests? #f)) ;no 'check' target
2783 (synopsis "Detect motion from video signals")
2784 (description
2785 "Motion is a program that monitors the video signal from one or more
2786 cameras and is able to detect if a significant part of the picture has
2787 changed. Or in other words, it can detect motion.")
2788
2789 ;; Some files say "version 2" and others "version 2 or later".
2790 (license license:gpl2)))