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