Merge branch 'master' into core-updates
[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 Nils Gillmann <ng0@n0.is>
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 (replace 'bootstrap
210 (lambda _ (zero? (system* "sh" "bootstrap")))))))
211 (home-page "http://liba52.sourceforge.net/")
212 (synopsis "ATSC A/52 stream decoder")
213 (description "liba52 is a library for decoding ATSC A/52 streams. The
214 A/52 standard is used in a variety of applications, including digital
215 television and DVD. It is also known as AC-3.")
216 (license license:gpl2+)))
217
218 (define-public libmpeg2
219 (package
220 (name "libmpeg2")
221 (version "0.5.1")
222 (source (origin
223 (method url-fetch)
224 ;; A mirror://sourceforge URI doesn't work, presumably
225 ;; because the SourceForge project is misconfigured.
226 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
227 name "-" version ".tar.gz"))
228 (sha256
229 (base32
230 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
231 (inputs
232 `(("libx11" ,libx11)
233 ("libxext" ,libxext)
234 ("libxv" ,libxv)
235 ("libsm" ,libsm)
236 ("libice" ,libice)
237 ("sdl" ,sdl)))
238 (build-system gnu-build-system)
239 (home-page "http://libmpeg2.sourceforge.net/")
240 (synopsis "MPEG1 and MPEG2 video decoder library")
241 (description
242 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
243 (license license:gpl2+)))
244
245 (define-public libx264
246 (package
247 (name "libx264")
248 (version "20180219-2245")
249 (source (origin
250 (method url-fetch)
251 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
252 "x264-snapshot-" version "-stable.tar.bz2"))
253 (sha256
254 (base32
255 "1x0cg8l30wp84mr7q0ddp06jclm0kjrszazrx87d4k7js3qxjy8m"))))
256 (build-system gnu-build-system)
257 (native-inputs
258 `(("pkg-config" ,pkg-config)
259 ("nasm" ,nasm)))
260 ;; TODO: Add gpac input
261 (arguments
262 `(#:tests? #f ;no check target
263 #:configure-flags '("--enable-shared"
264 ;; Don't build the command-line program. If we
265 ;; want it later, we should do so in a different
266 ;; package to avoid a circular dependency (the x264
267 ;; program depends on ffmpeg and ffmpeg depends on
268 ;; libx264).
269 "--disable-cli"
270
271 ;; On MIPS, we must pass "--disable-asm" or else
272 ;; configure fails after printing: "You specified a
273 ;; pre-MSA CPU in your CFLAGS. If you really want
274 ;; to run on such a CPU, configure with
275 ;; --disable-asm."
276 ,@(if (string-prefix? "mips"
277 (or (%current-target-system)
278 (%current-system)))
279 '("--disable-asm")
280 '()))))
281 (home-page "https://www.videolan.org/developers/x264.html")
282 (synopsis "H.264 video coding library")
283 (description "libx264 is an advanced encoding library for creating
284 H.264 (MPEG-4 AVC) video streams.")
285 (license (list license:gpl2+ ;most files
286 license:isc ;common/x86/x86inc.asm
287 license:lgpl2.1+ ;extras/getopt.c
288 license:bsd-3 ;extras/inttypes.h
289 (license:non-copyleft ;extras/cl*.h
290 "file://extras/cl.h"
291 "See extras/cl.h in the distribution.")))))
292
293 (define-public mkvtoolnix
294 (package
295 (name "mkvtoolnix")
296 (version "13.0.0")
297 (source
298 (origin
299 (method url-fetch)
300 (uri (string-append "https://mkvtoolnix.download/sources/"
301 name "-" version ".tar.xz"))
302 (sha256
303 (base32
304 "0hknnnnx9661igm1r73dc7aqxnnrl5a8yvyvr1nhd9ymn2klwpl5"))
305 (modules '((guix build utils)))
306 (snippet '(begin
307 ;; Delete bundled libraries.
308 (for-each delete-file-recursively
309 '("lib/libebml"
310 "lib/libmatroska"
311 "lib/nlohmann-json"
312 "lib/pugixml"
313 "lib/utf8-cpp"))
314 #t))))
315 (build-system gnu-build-system)
316 (inputs
317 `(("boost" ,boost)
318 ("bzip2" ,bzip2)
319 ("libebml" ,libebml)
320 ("flac" ,flac)
321 ("file" ,file)
322 ("libmatroska" ,libmatroska)
323 ("libogg" ,libogg)
324 ("libvorbis" ,libvorbis)
325 ("lzo" ,lzo)
326 ("pugixml" ,pugixml)
327 ("qt" ,qt)
328 ("utfcpp" ,utfcpp)
329 ("zlib" ,zlib)))
330 (native-inputs
331 `(("docbook-xsl" ,docbook-xsl)
332 ("gettext" ,gettext-minimal)
333 ("googletest" ,googletest)
334 ("libxslt" ,libxslt)
335 ("nlohmann-json-cpp" ,nlohmann-json-cpp)
336 ("perl" ,perl)
337 ("pkg-config" ,pkg-config)
338 ("po4a" ,po4a)
339 ("ruby" ,ruby)))
340 (arguments
341 `(#:configure-flags
342 (list (string-append "--with-boost="
343 (assoc-ref %build-inputs "boost"))
344 (string-append "--with-docbook-xsl-root="
345 (assoc-ref %build-inputs "docbook-xsl")
346 "/xml/xsl/docbook-xsl-"
347 ,(package-version docbook-xsl))
348 (string-append "--with-extra-includes="
349 (assoc-ref %build-inputs "nlohmann-json-cpp")
350 "/include/nlohmann"))
351 #:phases
352 (modify-phases %standard-phases
353 (add-before 'configure 'add-googletest
354 (lambda _
355 (symlink
356 (string-append (assoc-ref %build-inputs "googletest")
357 "/include/gtest") "lib/gtest")
358 #t))
359 (replace 'build
360 (lambda _
361 (let ((-j (list "-j" (number->string (parallel-job-count)))))
362 (zero? (apply system* "rake" -j)))))
363 (replace 'check
364 (lambda _
365 (zero? (system* "rake" "tests/unit"))))
366 (replace 'install
367 (lambda _
368 (zero? (system* "rake" "install")))))))
369 (home-page "https://mkvtoolnix.download")
370 (synopsis "Tools to create, alter and inspect Matroska files")
371 (description
372 "MKVToolNix provides tools for getting information about Matroska files
373 (@code{mkvinfo}), extracting tracks/data from Matroska files (@code{mkvextract})
374 and creating Matroska files from other media files (@code{mkvmerge}).")
375 (license license:gpl2)))
376
377 (define-public x265
378 (package
379 (name "x265")
380 (version "2.6")
381 (source
382 (origin
383 (method url-fetch)
384 (uri (string-append "https://download.videolan.org/videolan/x265/"
385 "x265_" version ".tar.gz"))
386 (sha256
387 (base32
388 "1gyd94jkwdii9308m07nymsbxrmrcl81c0j8i10zhslr2mj07w0v"))
389 (modules '((guix build utils)))
390 (snippet '(begin
391 (delete-file-recursively "source/compat/getopt")
392 #t))))
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.1.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 "03sb1b3fxw8myf9kz6rxw5f3v1p0vfmk34779qx0q8fk24x9bypk"))))
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.03.14")
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 "0j8j797gqc29fd5ra3cjvwkp8dgvigdydsj0zzjs05zccfqrj9lh"))))
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.1040")
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 "0257p9bn426rv0cjk2j5hsx6cg7dz5gpjwlqq0sy1axa47phis46"))))
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 '(begin
1799 ;; As of glibc 2.26, <xlocale.h> no longer is.
1800 (substitute* "src/framework/mlt_property.h"
1801 (("xlocale\\.h") "locale.h"))
1802 #t))))
1803 (build-system gnu-build-system)
1804 (arguments
1805 `(#:tests? #f ; no tests
1806 #:make-flags '("CC=gcc")
1807 #:configure-flags
1808 (list "--enable-gpl3"
1809 "--enable-gpl")
1810 #:phases
1811 (modify-phases %standard-phases
1812 (add-after
1813 'configure 'override-LDFLAGS
1814 (lambda* (#:key outputs #:allow-other-keys)
1815 (substitute* "config.mak"
1816 (("LDFLAGS\\+=")
1817 (string-append "LDFLAGS+=-Wl,-rpath="
1818 (assoc-ref outputs "out")
1819 "/lib ")))
1820 #t)))))
1821 (inputs
1822 `(("alsa-lib" ,alsa-lib)
1823 ("ffmpeg" ,ffmpeg)
1824 ("fftw" ,fftw)
1825 ("libxml2" ,libxml2)
1826 ("jack" ,jack-1)
1827 ("ladspa" ,ladspa)
1828 ("libsamplerate" ,libsamplerate)
1829 ("pulseaudio" ,pulseaudio)
1830 ("sdl" ,sdl)
1831 ("sox" ,sox)))
1832 (native-inputs
1833 `(("pkg-config" ,pkg-config)))
1834 (home-page "https://www.mltframework.org/")
1835 (synopsis "Author, manage, and run multitrack audio/video compositions")
1836 (description
1837 "MLT is a multimedia framework, designed and developed for television
1838 broadcasting. It provides a toolkit for broadcasters, video editors, media
1839 players, transcoders, web streamers and many more types of applications. The
1840 functionality of the system is provided via an assortment of ready to use
1841 tools, XML authoring components, and an extensible plug-in based API.")
1842 (license license:gpl3)))
1843
1844 (define-public v4l-utils
1845 (package
1846 (name "v4l-utils")
1847 (version "1.12.5")
1848 (source (origin
1849 (method url-fetch)
1850 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1851 "/v4l-utils-" version ".tar.bz2"))
1852 (sha256
1853 (base32
1854 "03g2b4rivrilimcp57mwrlsa3qvrxmk4sza08mygwmqbvcnic606"))))
1855 (build-system gnu-build-system)
1856 (arguments
1857 '(#:configure-flags
1858 (list (string-append "--with-udevdir="
1859 (assoc-ref %outputs "out")
1860 "/lib/udev")
1861 "CXXFLAGS=-std=gnu++11")))
1862 (native-inputs
1863 `(("perl" ,perl)
1864 ("pkg-config" ,pkg-config)))
1865 (inputs
1866 `(("alsa-lib" ,alsa-lib)
1867 ("glu" ,glu)
1868 ("libjpeg" ,libjpeg)
1869 ("libx11" ,libx11)
1870 ("qtbase" ,qtbase)
1871 ("eudev" ,eudev)))
1872 (synopsis "Realtime video capture utilities for Linux")
1873 (description "The v4l-utils provide a series of libraries and utilities to
1874 be used for realtime video capture via Linux-specific APIs.")
1875 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1876 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1877 (license (list license:lgpl2.1+ license:gpl2))))
1878
1879 (define-public obs
1880 (package
1881 (name "obs")
1882 (version "20.1.3")
1883 (source (origin
1884 (method url-fetch)
1885 (uri (string-append "https://github.com/jp9000/obs-studio"
1886 "/archive/" version ".tar.gz"))
1887 (file-name (string-append name "-" version ".tar.gz"))
1888 (sha256
1889 (base32
1890 "1g5z6z050v25whc7n3xvg6l238wmg5crp7ihvk73qngvzxr8bg28"))))
1891 (build-system cmake-build-system)
1892 (arguments
1893 `(#:tests? #f)) ; no tests
1894 (native-inputs
1895 `(("pkg-config" ,pkg-config)))
1896 (inputs
1897 `(("alsa-lib" ,alsa-lib)
1898 ("curl" ,curl)
1899 ("eudev" ,eudev)
1900 ("ffmpeg" ,ffmpeg)
1901 ("fontconfig" ,fontconfig)
1902 ("freetype" ,freetype)
1903 ("jack" ,jack-1)
1904 ("jansson" ,jansson)
1905 ("libx264" ,libx264)
1906 ("libxcomposite" ,libxcomposite)
1907 ("mesa" ,mesa)
1908 ("pulseaudio" ,pulseaudio)
1909 ("qtbase" ,qtbase)
1910 ("qtx11extras" ,qtx11extras)
1911 ("speex" ,speex)
1912 ("v4l-utils" ,v4l-utils)
1913 ("zlib" ,zlib)))
1914 (synopsis "Live streaming software")
1915 (description "Open Broadcaster Software provides a graphical interface for
1916 video recording and live streaming. OBS supports capturing audio and video
1917 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1918 and JACK.")
1919 (home-page "https://obsproject.com")
1920 (supported-systems '("x86_64-linux" "i686-linux"))
1921 (license license:gpl2+)))
1922
1923 (define-public libvdpau
1924 (package
1925 (name "libvdpau")
1926 (version "1.1.1")
1927 (source
1928 (origin
1929 (method url-fetch)
1930 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1931 name "-" version ".tar.bz2"))
1932 (sha256
1933 (base32
1934 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1935 (build-system gnu-build-system)
1936 (native-inputs
1937 `(("pkg-config" ,pkg-config)))
1938 (inputs
1939 `(("libx11" ,libx11 "out")
1940 ("libxext" ,libxext)
1941 ("xorgproto" ,xorgproto)))
1942 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1943 (synopsis "Video Decode and Presentation API")
1944 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1945 provides an interface to video decode acceleration and presentation hardware
1946 present in modern GPUs.")
1947 (license (license:x11-style "file://COPYING"))))
1948
1949 (define-public vdpauinfo
1950 (package
1951 (name "vdpauinfo")
1952 (version "1.0")
1953 (source
1954 (origin
1955 (method url-fetch)
1956 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1957 name "-" version ".tar.gz"))
1958 (sha256
1959 (base32
1960 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1961 (build-system gnu-build-system)
1962 (native-inputs
1963 `(("pkg-config" ,pkg-config)
1964 ("libx11" ,libx11)))
1965 (propagated-inputs
1966 `(("libvdpau" ,libvdpau)))
1967 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1968 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1969 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1970 implementation.")
1971 (license (license:x11-style "file://COPYING"))))
1972
1973 (define-public libvdpau-va-gl
1974 (package
1975 (name "libvdpau-va-gl")
1976 (version "0.4.2")
1977 (source
1978 (origin
1979 (method url-fetch)
1980 (uri (string-append "https://github.com/i-rinat/libvdpau-va-gl/"
1981 "releases/download/v" version "/libvdpau-va-gl-"
1982 version ".tar.gz"))
1983 (sha256
1984 (base32
1985 "1x2ag1f2fwa4yh1g5spv99w9x1m33hbxlqwyhm205ssq0ra234bx"))
1986 (patches (search-patches "libvdpau-va-gl-unbundle.patch"))
1987 (modules '((guix build utils)))
1988 (snippet '(begin (delete-file-recursively "3rdparty")
1989 #t))))
1990 (build-system cmake-build-system)
1991 (arguments
1992 '(#:tests? #f)) ; Tests require a running X11 server, with VA-API support.
1993 (native-inputs
1994 `(("libvdpau" ,libvdpau)
1995 ("pkg-config" ,pkg-config)))
1996 (inputs
1997 `(("libva" ,libva)
1998 ("mesa" ,mesa)))
1999 (home-page "https://github.com/i-rinat/libvdpau-va-gl")
2000 (synopsis "VDPAU driver with VA-API/OpenGL backend")
2001 (description
2002 "Many applications can use VDPAU to accelerate portions of the video
2003 decoding process and video post-processing to the GPU video hardware. Since
2004 there is no VDPAU available on Intel chips, they fall back to different drawing
2005 techniques. This driver uses OpenGL under the hood to accelerate drawing and
2006 scaling and VA-API (if available) to accelerate video decoding.")
2007 (license license:expat)))
2008
2009 (define-public recordmydesktop
2010 (package
2011 (name "recordmydesktop")
2012 (version "0.3.8.1")
2013 (source (origin
2014 (method url-fetch)
2015 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2016 version "/recordmydesktop-" version ".tar.gz"))
2017 (sha256
2018 (base32
2019 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
2020 (build-system gnu-build-system)
2021 (inputs `(("popt" ,popt)
2022 ("zlib" ,zlib)
2023 ("libx11" ,libx11)
2024 ("libice" ,libice)
2025 ("libsm" ,libsm)
2026 ("libxfixes" ,libxfixes)
2027 ("libxdamage" ,libxdamage)
2028 ("libxext" ,libxext)
2029 ("alsa-lib" ,alsa-lib)
2030 ("libvorbis" ,libvorbis)
2031 ("libtheora" ,libtheora)))
2032 (home-page "http://recordmydesktop.sourceforge.net/")
2033 (synopsis "Desktop session video recorder")
2034 (description
2035 "recordMyDesktop is a command-line tool that captures the activity in
2036 your graphical desktop and encodes it as a video. This is a useful tool for
2037 making @dfn{screencasts}.")
2038 (license license:gpl2+)))
2039
2040 (define-public simplescreenrecorder
2041 (package
2042 (name "simplescreenrecorder")
2043 (version "0.3.10")
2044 (source
2045 (origin
2046 (method url-fetch)
2047 (uri (string-append "https://github.com/MaartenBaert/ssr/archive/"
2048 version ".tar.gz"))
2049 (file-name (string-append name "-" version ".tar.gz"))
2050 (sha256
2051 (base32
2052 "02rl9yyx3hlz9fqvgzv7ipmvx2qahj7ws5wx2m7zs3lssq3qag3g"))))
2053 (build-system cmake-build-system)
2054 ;; Although libx11, libxfixes, libxext are listed as build dependencies in
2055 ;; README.md, the program builds and functions properly without them.
2056 ;; As a result, they are omitted. Please add them back if problems appear.
2057 (inputs
2058 `(("alsa-lib" ,alsa-lib)
2059 ("ffmpeg" ,ffmpeg)
2060 ("glu" ,glu)
2061 ("jack" ,jack-1)
2062 ("libxi" ,libxi)
2063 ("pulseaudio" ,pulseaudio)
2064 ("qt" ,qt)))
2065 (native-inputs `(("pkg-config" ,pkg-config)))
2066 (arguments
2067 `(#:configure-flags
2068 (list "-DWITH_QT5=TRUE")
2069 #:tests? #f)) ; no test suite
2070 ;; Using HTTPS causes part of the page to be displayed improperly.
2071 (home-page "http://www.maartenbaert.be/simplescreenrecorder/")
2072 (synopsis "Screen recorder")
2073 (description "SimpleScreenRecorder is an easy to use screen recorder with
2074 a graphical user interface. It supports recording the entire screen, or a
2075 part of it, and allows encoding in many different codecs and file formats.
2076 Other features include a live preview and live streaming.")
2077 (license (list license:gpl3+ ; most files
2078 license:zlib ; glinject/elfhacks.*
2079 license:isc ; glinject/*
2080 license:x11)))) ; build-aux/install-sh
2081
2082 (define-public libsmpeg
2083 (package
2084 (name "libsmpeg")
2085 (version "0.4.5")
2086 (source (origin
2087 (method svn-fetch)
2088 (uri (svn-reference
2089 (url "svn://svn.icculus.org/smpeg/trunk/")
2090 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
2091 (file-name (string-append name "-" version "-checkout"))
2092 (sha256
2093 (base32
2094 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
2095 (build-system gnu-build-system)
2096 (arguments
2097 `(#:phases (modify-phases %standard-phases
2098 (add-after 'unpack 'autogen.sh
2099 (lambda _
2100 (zero? (system* "sh" "autogen.sh")))))))
2101 (native-inputs
2102 `(("autoconf" ,autoconf)
2103 ("automake" ,automake)))
2104 (inputs
2105 `(("sdl" ,sdl2)))
2106 (home-page "http://icculus.org/smpeg/")
2107 (synopsis "SDL MPEG decoding library")
2108 (description
2109 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
2110 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
2111 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
2112 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
2113 and MPEG system streams.")
2114 (license (list license:expat
2115 license:lgpl2.1
2116 license:lgpl2.1+
2117 license:gpl2))))
2118
2119 (define-public libbdplus
2120 (package
2121 (name "libbdplus")
2122 (version "0.1.2")
2123 (source
2124 (origin
2125 (method url-fetch)
2126 (uri (string-append "https://ftp.videolan.org/pub/videolan/libbdplus/"
2127 version "/" name "-" version ".tar.bz2"))
2128 (sha256
2129 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
2130 (inputs
2131 `(("libgcrypt" ,libgcrypt)))
2132 (build-system gnu-build-system)
2133 (home-page "https://www.videolan.org/developers/libbdplus.html")
2134 (synopsis "Library for decrypting certain Blu-Ray discs")
2135 (description "libbdplus is a library which implements the BD+ System
2136 specifications.")
2137 (license license:lgpl2.1+)))
2138
2139 (define-public libaacs
2140 (package
2141 (name "libaacs")
2142 (version "0.9.0")
2143 (source
2144 (origin
2145 (method url-fetch)
2146 (uri (string-append "https://ftp.videolan.org/pub/videolan/libaacs/"
2147 version "/" name "-" version ".tar.bz2"))
2148 (sha256
2149 (base32 "1kms92i0c7i1yl659kqjf19lm8172pnpik5lsxp19xphr74vvq27"))))
2150 (inputs
2151 `(("libgcrypt" ,libgcrypt)))
2152 (native-inputs
2153 `(("bison" ,bison)
2154 ("flex" ,flex)))
2155 (build-system gnu-build-system)
2156 (home-page "https://www.videolan.org/developers/libaacs.html")
2157 (synopsis "Library for decrypting certain Blu-Ray discs")
2158 (description "libaacs is a library which implements the Advanced Access
2159 Content System specification.")
2160 (license license:lgpl2.1+)))
2161
2162 (define-public mps-youtube
2163 (package
2164 (name "mps-youtube")
2165 (version "0.2.7.1")
2166 (source
2167 (origin
2168 (method url-fetch)
2169 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
2170 "archive/v" version ".tar.gz"))
2171 (file-name (string-append name "-" version ".tar.gz"))
2172 (sha256
2173 (base32
2174 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
2175 (build-system python-build-system)
2176 (arguments
2177 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
2178 ;; test suite results differ depending on the country and also introduce
2179 ;; non-determinism in the tests.
2180 ;; https://github.com/mps-youtube/mps-youtube/issues/556
2181 `(#:tests? #f))
2182 (propagated-inputs
2183 `(("python-pafy" ,python-pafy)
2184 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
2185 (home-page "https://github.com/mps-youtube/mps-youtube")
2186 (synopsis "Terminal based YouTube player and downloader")
2187 (description
2188 "@code{mps-youtube} is based on mps, a terminal based program to
2189 search, stream and download music. This implementation uses YouTube as
2190 a source of content and can play and download video as well as audio.
2191 It can use either mpv or mplayer for playback, and for conversion of
2192 formats ffmpeg or libav is used. Users should install one of the
2193 supported players in addition to this package.")
2194 (license license:gpl3+)))
2195
2196 (define-public handbrake
2197 (package
2198 (name "handbrake")
2199 (version "0.10.5")
2200 (source (origin
2201 (method url-fetch)
2202 (uri (string-append "https://handbrake.fr/rotation.php?file="
2203 "HandBrake-" version ".tar.bz2"))
2204 (file-name (string-append "handbrake-" version ".tar.bz2"))
2205 (sha256
2206 (base32
2207 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
2208 (patches (search-patches "handbrake-pkg-config-path.patch"))
2209 (modules '((guix build utils)))
2210 (snippet
2211 ;; Remove bundled libraries and source not necessary for
2212 ;; running under a GNU environment.
2213 '(begin
2214 (for-each delete-file-recursively '("contrib" "macosx" "win"))
2215 #t))))
2216 (build-system glib-or-gtk-build-system)
2217 (native-inputs
2218 `(("automake" ,automake) ;gui subpackage must be bootstrapped
2219 ("autoconf" ,autoconf)
2220 ("curl" ,curl) ;not actually used, but tested for
2221 ("intltool" ,intltool)
2222 ("libtool" ,libtool)
2223 ("pkg-config" ,pkg-config)
2224 ("python" ,python-2))) ;for configuration
2225 (inputs
2226 `(("bzip2" ,bzip2)
2227 ("dbus-glib" ,dbus-glib)
2228 ("ffmpeg" ,ffmpeg)
2229 ("fontconfig" ,fontconfig)
2230 ("freetype" ,freetype)
2231 ("glib" ,glib)
2232 ("gstreamer" ,gstreamer)
2233 ("gst-plugins-base" ,gst-plugins-base)
2234 ("gtk+" ,gtk+)
2235 ("lame" ,lame)
2236 ("libass" ,libass)
2237 ("libbluray" ,libbluray)
2238 ("libdvdnav" ,libdvdnav)
2239 ("libdvdread" ,libdvdread)
2240 ("libgudev" ,libgudev)
2241 ("libmpeg2" ,libmpeg2)
2242 ("libnotify" ,libnotify)
2243 ("libogg" ,libogg)
2244 ("libsamplerate" ,libsamplerate)
2245 ("libtheora" ,libtheora)
2246 ("libvorbis" ,libvorbis)
2247 ("libvpx" ,libvpx)
2248 ("libxml2" ,libxml2)
2249 ("libx264" ,libx264)
2250 ("x265" ,x265)
2251 ("zlib" ,zlib)))
2252 (arguments
2253 `(#:tests? #f ;tests require Ruby and claim to be unsupported
2254 #:phases
2255 (modify-phases %standard-phases
2256 (replace 'bootstrap
2257 ;; Run bootstrap ahead of time so that shebangs get patched.
2258 (lambda _
2259 (setenv "CONFIG_SHELL" (which "sh"))
2260 (setenv "NOCONFIGURE" "1")
2261 ;; Patch the Makefile so that it doesn't bootstrap again.
2262 (substitute* "gtk/module.rules"
2263 ((".*autogen\\.sh.*") ""))
2264 (zero? (system* "sh" "./gtk/autogen.sh"))))
2265 (add-before 'configure 'disable-contrib
2266 (lambda _
2267 (substitute* "make/include/main.defs"
2268 ;; Disable unconditional inclusion of some "contrib"
2269 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
2270 ;; and libbluray), which would lead to fetching and
2271 ;; building of these libraries. Use our own instead.
2272 (("MODULES \\+= contrib") "# MODULES += contrib"))
2273 #t))
2274 (add-before 'configure 'fix-x265-linking
2275 (lambda _
2276 (substitute* "test/module.defs"
2277 ;; Fix missing library during linking error
2278 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
2279 #t))
2280 (replace 'configure
2281 (lambda* (#:key outputs configure-flags #:allow-other-keys)
2282 ;; 'configure' is not an autoconf-generated script, and
2283 ;; errors on unrecognized arguments,
2284 ;; e.g. --enable-fast-install
2285 (let ((out (assoc-ref outputs "out")))
2286 (zero? (apply system* "./configure"
2287 (string-append "--prefix=" out)
2288 (or configure-flags '()))))))
2289 (add-after 'configure 'chdir-build
2290 (lambda _ (chdir "./build") #t)))))
2291 (home-page "https://handbrake.fr")
2292 (synopsis "Video transcoder")
2293 (description
2294 "HandBrake is a tool for converting video from any format to a selection
2295 of modern, widely supported codecs.")
2296 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
2297 (license (list license:gpl2+ license:bsd-3))))
2298
2299 (define-public openh264
2300 (package
2301 (name "openh264")
2302 (version "1.7.0")
2303 (source (origin
2304 (method url-fetch)
2305 (uri (string-append "https://github.com/cisco/"
2306 name "/archive/v" version ".tar.gz"))
2307 (file-name (string-append name "-" version ".tar.gz"))
2308 (sha256
2309 (base32
2310 "0gv571bqkxk7ic64dmavs1q8nr7p59mcf4ibqp4lc070gn6w61ww"))))
2311 (build-system gnu-build-system)
2312 (native-inputs
2313 `(("nasm" ,nasm)
2314 ("python" ,python)))
2315 (arguments
2316 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2317 "CC=gcc")
2318 #:test-target "test"
2319 #:phases (modify-phases %standard-phases
2320 ;; no configure script
2321 (delete 'configure))))
2322 (home-page "http://www.openh264.org/")
2323 (synopsis "H264 decoder library")
2324 (description
2325 "Openh264 is a library which can decode H264 video streams.")
2326 (license license:bsd-2)))
2327
2328 (define-public libmp4v2
2329 (package
2330 (name "libmp4v2")
2331 (version "2.0.0")
2332 (source
2333 (origin
2334 (method url-fetch)
2335 ;; XXX: The new location of upstream is uncertain and will become relevant the
2336 ;; moment when the googlecode archive shuts down. It is past the date it
2337 ;; should've been turned off. I tried to communicate with upstream, but this
2338 ;; wasn't very responsive and not very helpful. The short summary is, it is
2339 ;; chaos when it comes to the amount of forks and only time will tell where
2340 ;; the new upstream location is.
2341 (uri (string-append "https://storage.googleapis.com/google-"
2342 "code-archive-downloads/v2/"
2343 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
2344 (file-name (string-append name "-" version ".tar.bz2"))
2345 (sha256
2346 (base32
2347 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
2348 (build-system gnu-build-system)
2349 (outputs '("out"
2350 "static")) ; 3.7MiB .a file
2351 (arguments
2352 `(#:phases
2353 (modify-phases %standard-phases
2354 (add-after 'unpack 'remove-dates
2355 (lambda _
2356 ;; Make the build reproducible.
2357 (substitute* "configure"
2358 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
2359 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
2360 #t))
2361 (add-after 'install 'move-static-libraries
2362 (lambda* (#:key outputs #:allow-other-keys)
2363 ;; Move static libraries to the "static" output.
2364 (let* ((out (assoc-ref outputs "out"))
2365 (lib (string-append out "/lib"))
2366 (static (assoc-ref outputs "static"))
2367 (slib (string-append static "/lib")))
2368 (mkdir-p slib)
2369 (for-each (lambda (file)
2370 (install-file file slib)
2371 (delete-file file))
2372 (find-files lib "\\.a$"))
2373 #t))))))
2374 (native-inputs
2375 `(("help2man" ,help2man)
2376 ("dejagnu" ,dejagnu)))
2377 (home-page "https://code.google.com/archive/p/mp4v2/")
2378 (synopsis "API to create and modify mp4 files")
2379 (description
2380 "The MP4v2 library provides an API to create and modify mp4 files as defined by
2381 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
2382 file format that has been used as a multimedia file format in a variety of platforms and
2383 applications. It is a very powerful and extensible format that can accommodate
2384 practically any type of media.")
2385 (license license:mpl1.1)))
2386
2387 (define-public libmediainfo
2388 (package
2389 (name "libmediainfo")
2390 (version "0.7.95")
2391 (source (origin
2392 (method url-fetch)
2393 (uri (string-append "https://mediaarea.net/download/source/"
2394 name "/" version"/"
2395 name "_" version ".tar.bz2"))
2396 (sha256
2397 (base32
2398 "1kchh6285b07z5nixv619hc9gml2ysdayicdiv30frrlqiyxqw4b"))))
2399 ;; TODO add a Big Buck Bunny webm for tests.
2400 (native-inputs
2401 `(("autoconf" ,autoconf)
2402 ("automake" ,automake)
2403 ("libtool" ,libtool)
2404 ("pkg-config" ,pkg-config)
2405 ("zlib" ,zlib)
2406 ("tinyxml2" ,tinyxml2)
2407 ("curl" ,curl)
2408 ("libzen" ,libzen)))
2409 (build-system gnu-build-system)
2410 (arguments
2411 '(#:tests? #f ; see above TODO
2412 #:phases
2413 ;; build scripts not in root of archive
2414 (modify-phases %standard-phases
2415 (add-after 'unpack 'change-to-build-dir
2416 (lambda _
2417 (chdir "Project/GNU/Library")
2418 #t))
2419 (add-after 'change-to-build-dir 'autogen
2420 (lambda _
2421 (zero? (system* "sh" "autogen.sh")))))))
2422 (home-page "https://mediaarea.net/en/MediaInfo")
2423 (synopsis "Library for retrieving media metadata")
2424 (description "MediaInfo is a library used for retrieving technical
2425 information and other metadata about audio or video files. A non-exhaustive
2426 list of the information MediaInfo can retrieve from media files include:
2427
2428 @itemize
2429 @item General: title, author, director, album, track number, date, duration...
2430 @item Video: codec, aspect, fps, bitrate...
2431 @item Audio: codec, sample rate, channels, language, bitrate...
2432 @item Text: language of subtitle
2433 @item Chapters: number of chapters, list of chapters
2434 @end itemize
2435
2436 MediaInfo supports the following formats:
2437
2438 @itemize
2439 @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
2440 MPEG-2, MPEG-4, DVD (VOB)...
2441 @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
2442 @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
2443 @item Subtitles: SRT, SSA, ASS, SAMI...
2444 @end itemize\n")
2445 (license license:bsd-2)))
2446
2447 ;; TODO also have a GUI version available
2448 (define-public mediainfo
2449 (package
2450 (name "mediainfo")
2451 (version "0.7.95")
2452 (source (origin
2453 (method url-fetch)
2454 (uri (string-append "https://mediaarea.net/download/source/"
2455 name "/" version "/"
2456 name "_" version ".tar.bz2"))
2457 (sha256
2458 (base32
2459 "0dy51a3i79jppmg1gi4f6h7jx4hcgnkmfim4d7d3gmnlbkjh8anv"))))
2460 (native-inputs
2461 `(("autoconf" ,autoconf)
2462 ("automake" ,automake)
2463 ("libtool" ,libtool)
2464 ("pkg-config" ,pkg-config)
2465 ("zlib" ,zlib)
2466 ("libmediainfo" ,libmediainfo)
2467 ("libzen" ,libzen)))
2468 (build-system gnu-build-system)
2469 (arguments
2470 '(#:tests? #f ; lacks tests
2471 #:phases
2472 ;; build scripts not in root of archive
2473 (modify-phases %standard-phases
2474 (add-after 'unpack 'change-to-build-dir
2475 (lambda _
2476 (chdir "Project/GNU/CLI")
2477 #t))
2478 (add-after 'change-to-build-dir 'autogen
2479 (lambda _
2480 (zero? (system* "sh" "autogen.sh")))))))
2481 (home-page "https://mediaarea.net/en/MediaInfo")
2482 (synopsis "Utility for reading media metadata")
2483 (description "MediaInfo is a utility used for retrieving technical
2484 information and other metadata about audio or video files. It supports the
2485 many codecs and formats supported by libmediainfo.")
2486 (license license:bsd-2)))
2487
2488 (define-public livemedia-utils
2489 (package
2490 (name "livemedia-utils")
2491 (version "2017.10.28")
2492 (source (origin
2493 (method url-fetch)
2494 (uri (string-append
2495 "https://download.videolan.org/contrib/live555/live."
2496 version ".tar.gz"))
2497 (sha256
2498 (base32
2499 "0f5kxpayqn3yhabqrd2cqlc74i6x2xr01jfkank1lcilxnfyrsnq"))
2500 (modules '((guix build utils)))
2501 (snippet '(begin
2502 ;; As of glibc 2.26, <xlocale.h> no longer is.
2503 (substitute* "liveMedia/include/Locale.hh"
2504 (("xlocale\\.h") "locale.h"))
2505 #t))))
2506 (build-system gnu-build-system)
2507 (arguments
2508 '(#:tests? #f ; no tests
2509 #:make-flags (list "CC=gcc"
2510 (string-append "LDFLAGS=-Wl,-rpath="
2511 (assoc-ref %outputs "out") "/lib")
2512 (string-append "PREFIX="
2513 (assoc-ref %outputs "out")))
2514 #:phases (modify-phases %standard-phases
2515 (add-before 'configure 'fix-makefiles-generation
2516 (lambda _
2517 (substitute* "genMakefiles"
2518 (("/bin/rm") "rm"))
2519 #t))
2520 (replace 'configure
2521 (lambda _
2522 (zero? (system* "./genMakefiles"
2523 "linux-with-shared-libraries")))))))
2524 (home-page "http://www.live555.com/liveMedia/")
2525 (synopsis "Set of C++ libraries for multimedia streaming")
2526 (description "This code forms a set of C++ libraries for multimedia
2527 streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). The libraries
2528 can be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or
2529 JPEG video, and several audio codecs. They can easily be extended to support
2530 additional (audio and/or video) codecs, and can also be used to build basic
2531 RTSP or SIP clients and servers.")
2532 (license license:lgpl3+)))
2533
2534 (define-public libdvbpsi
2535 (package
2536 (name "libdvbpsi")
2537 (version "1.3.2")
2538 (source (origin
2539 (method url-fetch)
2540 (uri (string-append
2541 "https://download.videolan.org/pub/libdvbpsi/"
2542 version "/libdvbpsi-" version ".tar.bz2"))
2543 (sha256
2544 (base32
2545 "1zn5hfv4qbahmydbwh59a3b480s3m5ss27r6ml35gqdip7r3jkmc"))))
2546 (build-system gnu-build-system)
2547 (home-page "https://www.videolan.org/developers/libdvbpsi.html")
2548 (synopsis "Library for decoding and generation of MPEG TS and DVB PSI
2549 tables")
2550 (description "libdvbpsi is a simple library designed for decoding and
2551 generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818s
2552 and ITU-T H.222.0.")
2553 (license license:lgpl2.1)))
2554
2555 (define-public ffms2
2556 (package
2557 (name "ffms2")
2558 (version "2.23")
2559 (home-page "https://github.com/FFMS/ffms2")
2560 (source (origin
2561 (method url-fetch)
2562 (uri (string-append home-page "/archive/" version ".tar.gz"))
2563 (file-name (string-append name "-" version ".tar.gz"))
2564 (sha256
2565 (base32
2566 "1vbkab8vrplxz5xgag8ggzkwp4f7nf285pd0l2a7zy66n6i2m6xh"))))
2567 (build-system gnu-build-system)
2568 (arguments
2569 '(#:configure-flags
2570 (list "--enable-avresample")))
2571 (inputs
2572 `(("zlib" ,zlib)))
2573 (propagated-inputs
2574 `(("ffmpeg" ,ffmpeg)))
2575 (native-inputs
2576 `(("pkg-config" ,pkg-config)))
2577 (synopsis "Cross-platform wrapper around ffmpeg/libav")
2578 (description
2579 "FFMpegSource is a wrapper library around ffmpeg/libav that allows
2580 programmers to access a standard API to open and decompress media files.")
2581 ;; sources are distributed under a different license that the binary.
2582 ;; see https://github.com/FFMS/ffms2/blob/master/COPYING
2583 (license license:gpl2+))); inherits from ffmpeg
2584
2585 (define-public aegisub
2586 (package
2587 (name "aegisub")
2588 (version "3.2.2")
2589 (source (origin
2590 (method url-fetch)
2591 (uri (string-append
2592 "http://ftp.aegisub.org/pub/archives/releases/source/"
2593 name "-" version ".tar.xz"))
2594 (sha256
2595 (base32
2596 "11b83qazc8h0iidyj1rprnnjdivj1lpphvpa08y53n42bfa36pn5"))))
2597 (build-system gnu-build-system)
2598 (arguments
2599 `(#:configure-flags
2600 (list "--disable-update-checker"
2601 "--without-portaudio"
2602 "--without-openal"
2603 "--without-oss")
2604 ;; tests require busted, a lua package we don't have yet
2605 #:tests? #f
2606 #:phases
2607 (modify-phases %standard-phases
2608 (add-before 'configure 'fix-ldflags
2609 (lambda _
2610 (setenv "LDFLAGS" "-pthread"))))))
2611 (inputs
2612 `(("boost" ,boost)
2613 ("desktop-file-utils" ,desktop-file-utils)
2614 ("ffms2" ,ffms2)
2615 ("fftw" ,fftw)
2616 ("hunspell" ,hunspell)
2617 ("mesa" ,mesa)
2618 ("libass" ,libass)
2619 ("alsa-lib" ,alsa-lib)
2620 ("pulseaudio" ,pulseaudio)
2621 ("libx11" ,libx11)
2622 ("freetype" ,freetype)
2623 ("wxwidgets-gtk2" ,wxwidgets-gtk2)))
2624 (native-inputs
2625 `(("intltool" ,intltool)
2626 ("pkg-config" ,pkg-config)))
2627 (home-page "http://www.aegisub.org/")
2628 (synopsis "Subtitle engine")
2629 (description
2630 "Aegisub is a tool for creating and modifying subtitles. Aegisub makes
2631 it quick and easy to time subtitles to audio, and features many powerful
2632 tools for styling them, including a built-in real-time video preview.")
2633 (license (list license:bsd-3 ; the package is licensed under the bsd-3, except
2634 license:mpl1.1 ; for vendor/universalchardet under the mpl1.1
2635 license:expat)))) ; and src/gl that is under a license similar
2636 ; the the Expat license, with a rewording (Software -> Materials). (called MIT
2637 ; by upstream). See https://github.com/Aegisub/Aegisub/blob/master/LICENCE
2638 ; src/MatroskaParser.(c|h) is under bsd-3 with permission from the author
2639
2640 (define-public gst-transcoder
2641 (package
2642 (name "gst-transcoder")
2643 (version "1.12.2")
2644 (source
2645 (origin
2646 (method url-fetch)
2647 (uri (string-append "https://github.com/pitivi/gst-transcoder/"
2648 "archive/" version ".tar.gz"))
2649 (file-name (string-append name "-" version ".tar.gz"))
2650 (sha256
2651 (base32
2652 "0cnwmrsd321s02ff91m3j27ydj7f8wks0jvmp5admlhka6z7zxm9"))))
2653 (build-system meson-build-system)
2654 (inputs
2655 `(("gobject-introspection" ,gobject-introspection)
2656 ("glib" ,glib)
2657 ("gstreamer" ,gstreamer)
2658 ("gst-plugins-base" ,gst-plugins-base)))
2659 (native-inputs
2660 `(("python" ,python)
2661 ("pkg-config" ,pkg-config)))
2662 (home-page "https://github.com/pitivi/gst-transcoder/")
2663 (synopsis "GStreamer Transcoding API")
2664 (description "GStreamer Transcoding API")
2665 (license license:lgpl2.1)))
2666
2667 (define-public gavl
2668 (package
2669 (name "gavl")
2670 (version "1.4.0")
2671 (source
2672 (origin
2673 (method url-fetch)
2674 (uri (string-append "mirror://sourceforge/gmerlin/"
2675 name "/" version "/"
2676 name "-" version ".tar.gz"))
2677 (file-name (string-append name "-" version ".tar.gz"))
2678 (sha256
2679 (base32
2680 "1kikkn971a14zzm7svi7190ldc14fjai0xyhpbcmp48s750sraji"))))
2681 (build-system gnu-build-system)
2682 (arguments
2683 '(#:configure-flags '("LIBS=-lm")))
2684 (native-inputs
2685 `(("pkg-config" ,pkg-config)
2686 ("doxygen" ,doxygen)))
2687 (home-page "http://gmerlin.sourceforge.net")
2688 (synopsis "Low level library for multimedia API building")
2689 (description
2690 "Gavl is short for Gmerlin Audio Video Library. It is a low level
2691 library, upon which multimedia APIs can be built. Gavl handles all the
2692 details of audio and video formats like colorspaces, sample rates,
2693 multichannel configurations, etc. It provides standardized definitions for
2694 those formats as well as container structures for carrying audio samples or
2695 video images inside an application.
2696
2697 In addition, it handles the sometimes ugly task of converting between all
2698 these formats and provides some elementary operations (copying, scaling,
2699 alpha blending etc).")
2700 (license license:gpl3)))
2701
2702 (define-public frei0r-plugins
2703 (package
2704 (name "frei0r-plugins")
2705 (version "1.6.1")
2706 (source
2707 (origin
2708 (method url-fetch)
2709 (uri (string-append "https://files.dyne.org/frei0r/"
2710 "frei0r-plugins-" version ".tar.gz"))
2711 (sha256
2712 (base32
2713 "0pji26fpd0dqrx1akyhqi6729s394irl73dacnyxk58ijqq4dhp0"))))
2714 (build-system gnu-build-system)
2715 (arguments
2716 `(#:phases
2717 (modify-phases %standard-phases
2718 (add-after 'unpack 'autotools
2719 (lambda _
2720 (zero? (system* "sh" "autogen.sh")))))))
2721 ;; TODO: opencv for additional face detection filters
2722 (inputs
2723 `(("gavl" ,gavl)
2724 ("cairo" ,cairo)))
2725 (native-inputs
2726 `(("pkg-config" ,pkg-config)
2727 ("libtool" ,libtool)
2728 ("automake" ,automake)
2729 ("autoconf" ,autoconf)))
2730 (home-page "https://www.dyne.org/software/frei0r/")
2731 (synopsis "Minimalistic plugin API for video effects")
2732 (description
2733 "Frei0r is a minimalistic plugin API for video effects.
2734 The main emphasis is on simplicity for an API that will round up
2735 the most common video effects into simple filters, sources and
2736 mixers that can be controlled by parameters. Frei0r wants to
2737 provide a way to share these simple effects between many
2738 applications, avoiding their reimplementation by different projects.
2739 It counts more than 100 plugins.")
2740 (license (list license:gpl2+
2741 ;; The following files are licensed as LGPL2.1+:
2742 ;; src/generator/ising0r/ising0r.c
2743 ;; src/generator/onecol0r/onecol0r.cpp
2744 ;; src/generator/nois0r/nois0r.cpp
2745 ;; src/generator/lissajous0r/lissajous0r.cpp
2746 ;; src/filter/ndvi/gradientlut.hpp
2747 ;; src/filter/ndvi/ndvi.cpp
2748 ;; src/filter/facedetect/facedetect.cpp
2749 license:lgpl2.1+))))
2750
2751 (define-public motion
2752 (package
2753 (name "motion")
2754 (version "4.1.1")
2755 (home-page "https://motion-project.github.io/")
2756 (source (origin
2757 (method url-fetch)
2758 (uri (string-append
2759 "https://github.com/Motion-Project/motion/archive/"
2760 "release-" version ".tar.gz"))
2761 (sha256
2762 (base32
2763 "1qm4i8zrqafl60sv2frhixvkd0wh0r5jfcrj5i6gha7yplsvjx10"))
2764 (file-name (string-append name "-" version ".tar.gz"))))
2765 (build-system gnu-build-system)
2766 (native-inputs
2767 `(("autoconf" ,autoconf-wrapper)
2768 ("automake" ,automake)
2769 ("pkg-config" ,pkg-config)))
2770 (inputs
2771 `(("libjpeg" ,libjpeg)
2772 ("ffmpeg" ,ffmpeg)
2773 ("sqlite" ,sqlite)))
2774 (arguments
2775 '(#:phases (modify-phases %standard-phases
2776 (replace 'bootstrap
2777 (lambda _
2778 (patch-shebang "version.sh")
2779 (invoke "autoreconf" "-vfi"))))
2780 #:configure-flags '("--sysconfdir=/etc")
2781 #:make-flags (list (string-append "sysconfdir="
2782 (assoc-ref %outputs "out")
2783 "/etc"))
2784
2785 #:tests? #f)) ;no 'check' target
2786 (synopsis "Detect motion from video signals")
2787 (description
2788 "Motion is a program that monitors the video signal from one or more
2789 cameras and is able to detect if a significant part of the picture has
2790 changed. Or in other words, it can detect motion.")
2791
2792 ;; Some files say "version 2" and others "version 2 or later".
2793 (license license:gpl2)))