gnu: dav1d: Remove defunct mirror URL.
[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, 2018 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2015, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 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@n0.is>
15 ;;; Copyright © 2016, 2018, 2019 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, 2019 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, 2018 Clément Lassieur <clement@lassieur.org>
23 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
24 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
25 ;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
26 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
27 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
28 ;;; Copyright © 2018, 2019 Leo Famulari <leo@famulari.name>
29 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
30 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
31 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
32 ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
33 ;;; Copyright © 2018 Gábor Boskovit <boskovits@gmail.com>
34 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
35 ;;; Copyright © 2019 Timo Eisenmann <eisenmann@fn.de>
36 ;;; Copyright © 2019 Arne Babenhauserheide <arne_bab@web.de>
37 ;;;
38 ;;; This file is part of GNU Guix.
39 ;;;
40 ;;; GNU Guix is free software; you can redistribute it and/or modify it
41 ;;; under the terms of the GNU General Public License as published by
42 ;;; the Free Software Foundation; either version 3 of the License, or (at
43 ;;; your option) any later version.
44 ;;;
45 ;;; GNU Guix is distributed in the hope that it will be useful, but
46 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
47 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 ;;; GNU General Public License for more details.
49 ;;;
50 ;;; You should have received a copy of the GNU General Public License
51 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
52
53 (define-module (gnu packages video)
54 #:use-module (ice-9 match)
55 #:use-module (srfi srfi-1)
56 #:use-module (srfi srfi-26)
57 #:use-module ((guix licenses) #:prefix license:)
58 #:use-module (guix utils)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix git-download)
62 #:use-module (guix svn-download)
63 #:use-module (guix build-system cmake)
64 #:use-module (guix build-system gnu)
65 #:use-module (guix build-system glib-or-gtk)
66 #:use-module (guix build-system meson)
67 #:use-module (guix build-system perl)
68 #:use-module (guix build-system python)
69 #:use-module (guix build-system waf)
70 #:use-module (guix build-system trivial)
71 #:use-module (gnu packages)
72 #:use-module (gnu packages algebra)
73 #:use-module (gnu packages assembly)
74 #:use-module (gnu packages audio)
75 #:use-module (gnu packages autotools)
76 #:use-module (gnu packages avahi)
77 #:use-module (gnu packages backup)
78 #:use-module (gnu packages base)
79 #:use-module (gnu packages bison)
80 #:use-module (gnu packages boost)
81 #:use-module (gnu packages cdrom)
82 #:use-module (gnu packages check)
83 #:use-module (gnu packages cmake)
84 #:use-module (gnu packages compression)
85 #:use-module (gnu packages cpp)
86 #:use-module (gnu packages curl)
87 #:use-module (gnu packages dejagnu)
88 #:use-module (gnu packages dns)
89 #:use-module (gnu packages docbook)
90 #:use-module (gnu packages documentation)
91 #:use-module (gnu packages elf)
92 #:use-module (gnu packages file)
93 #:use-module (gnu packages flex)
94 #:use-module (gnu packages fonts)
95 #:use-module (gnu packages fontutils)
96 #:use-module (gnu packages freedesktop)
97 #:use-module (gnu packages fribidi)
98 #:use-module (gnu packages gettext)
99 #:use-module (gnu packages ghostscript)
100 #:use-module (gnu packages gl)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages guile)
103 #:use-module (gnu packages gnome)
104 #:use-module (gnu packages gnunet)
105 #:use-module (gnu packages gnupg)
106 #:use-module (gnu packages gstreamer)
107 #:use-module (gnu packages gtk)
108 #:use-module (gnu packages image)
109 #:use-module (gnu packages imagemagick)
110 #:use-module (gnu packages iso-codes)
111 #:use-module (gnu packages libidn)
112 #:use-module (gnu packages libreoffice)
113 #:use-module (gnu packages linux)
114 #:use-module (gnu packages lua)
115 #:use-module (gnu packages m4)
116 #:use-module (gnu packages man)
117 #:use-module (gnu packages markup)
118 #:use-module (gnu packages mp3)
119 #:use-module (gnu packages ncurses)
120 #:use-module (gnu packages networking)
121 #:use-module (gnu packages ocr)
122 #:use-module (gnu packages perl)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages pretty-print)
126 #:use-module (gnu packages protobuf)
127 #:use-module (gnu packages pulseaudio)
128 #:use-module (gnu packages python)
129 #:use-module (gnu packages python-crypto)
130 #:use-module (gnu packages python-web)
131 #:use-module (gnu packages python-xyz)
132 #:use-module (gnu packages qt)
133 #:use-module (gnu packages rdesktop)
134 #:use-module (gnu packages ruby)
135 #:use-module (gnu packages samba)
136 #:use-module (gnu packages sdl)
137 #:use-module (gnu packages serialization)
138 #:use-module (gnu packages shells)
139 #:use-module (gnu packages sqlite)
140 #:use-module (gnu packages ssh)
141 #:use-module (gnu packages swig)
142 #:use-module (gnu packages texinfo)
143 #:use-module (gnu packages textutils)
144 #:use-module (gnu packages tls)
145 #:use-module (gnu packages time)
146 #:use-module (gnu packages upnp)
147 #:use-module (gnu packages version-control)
148 #:use-module (gnu packages vulkan)
149 #:use-module (gnu packages web)
150 #:use-module (gnu packages webkit)
151 #:use-module (gnu packages wxwidgets)
152 #:use-module (gnu packages xdisorg)
153 #:use-module (gnu packages xiph)
154 #:use-module (gnu packages xml)
155 #:use-module (gnu packages xorg))
156
157 (define-public aalib
158 (package
159 (name "aalib")
160 (version "1.4rc5")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
164 version "/" name "-" version ".tar.gz"))
165 (sha256
166 (base32
167 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
168 (build-system gnu-build-system)
169 (native-inputs
170 `(("makeinfo" ,texinfo)))
171 (inputs
172 `(("ncurses" ,ncurses)))
173 (arguments
174 `(#:phases
175 (modify-phases %standard-phases
176 (replace 'configure
177 (lambda* (#:key build inputs outputs #:allow-other-keys)
178 ;; This old `configure' script doesn't support
179 ;; variables passed as arguments.
180 (let ((out (assoc-ref outputs "out"))
181 (ncurses (assoc-ref inputs "ncurses")))
182 (setenv "CONFIG_SHELL" (which "bash"))
183 (invoke "./configure"
184 (string-append "--prefix=" out)
185 (string-append "--build=" build)
186 ;; The ancient config.guess is unable to
187 ;; guess the host triplet on mips64el.
188 ,@(if (string=? "mips64el-linux"
189 (%current-system))
190 '("--host=mips64el-unknown-linux-gnu")
191 '())
192 ;; The same is also true with aarch64.
193 ,@(if (string=? "aarch64-linux"
194 (%current-system))
195 '("--host=aarch64-unknown-linux-gnu")
196 '())
197 (string-append "--with-ncurses="
198 ncurses))))))))
199 (home-page "http://aa-project.sourceforge.net/aalib/")
200 (synopsis "ASCII-art library")
201 (description
202 "AA-lib is a low level gfx library which does not require graphics device.
203 In fact, there is no graphical output possible. AA-lib replaces those
204 old-fashioned output methods with powerful ascii-art renderer.")
205 (license license:lgpl2.0+)))
206
207 (define-public celluloid
208 (package
209 (name "celluloid")
210 (version "0.17")
211 (source
212 (origin
213 (method url-fetch)
214 (uri (string-append "https://github.com/celluloid-player/celluloid/releases"
215 "/download/v" version "/celluloid-" version ".tar.xz"))
216 (sha256
217 (base32 "0a3bhvs38gxjplygb0q9cx5djl5y0bmnxgaq0sd65j610a60f5h0"))))
218 (build-system glib-or-gtk-build-system)
219 (native-inputs
220 `(("intltool" ,intltool)
221 ("pkg-config" ,pkg-config)))
222 (inputs
223 `(("gtk+" ,gtk+)
224 ("libepoxy" ,libepoxy)
225 ("mpv" ,mpv)))
226 (home-page "https://github.com/celluloid-player/celluloid")
227 (synopsis "GTK+ frontend for the mpv media player")
228 (description "Celluloid is a simple GTK+ frontend for the mpv media player.
229 It interacts with mpv via the client API exported by libmpv, allowing access to
230 mpv's powerful playback capabilities.")
231 (license license:gpl3+)))
232
233 (define-public liba52
234 (package
235 (name "liba52")
236 (version "0.7.4")
237 (source (origin
238 (method url-fetch)
239 (uri (string-append
240 ;; A mirror://sourceforge URI doesn't work, presumably
241 ;; because the SourceForge project is misconfigured.
242 "http://liba52.sourceforge.net/files/a52dec-" version
243 ".tar.gz"))
244 (sha256
245 (base32
246 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
247 (patches (search-patches "liba52-enable-pic.patch"
248 "liba52-set-soname.patch"
249 "liba52-use-mtune-not-mcpu.patch"
250 "liba52-link-with-libm.patch"))))
251 (build-system gnu-build-system)
252 ;; XXX We need to run ./bootstrap because of the build system fixes above.
253 (native-inputs
254 `(("autoconf" ,autoconf)
255 ("automake" ,automake)
256 ("libtool" ,libtool)))
257 (arguments `(#:configure-flags '("--enable-shared")
258 #:phases
259 (modify-phases %standard-phases
260 ;; XXX We need to run ./bootstrap because of the build
261 ;; system fixes above.
262 (replace 'bootstrap
263 (lambda _ (invoke "sh" "bootstrap"))))))
264 (home-page "http://liba52.sourceforge.net/")
265 (synopsis "ATSC A/52 stream decoder")
266 (description "liba52 is a library for decoding ATSC A/52 streams. The
267 A/52 standard is used in a variety of applications, including digital
268 television and DVD. It is also known as AC-3.")
269 (license license:gpl2+)))
270
271 (define-public libaom
272 ;; The 1.0.0-errata1 release installs a broken pkg-config .pc file. This
273 ;; is fixed in libaom commit 0ddc150, but we use an even later commit.
274 (let ((commit "22b150bf040608028a56d8bf39e72f771383d836")
275 (revision "0"))
276 (package
277 (name "libaom")
278 (version (git-version "1.0.0-errata1" revision commit))
279 (source (origin
280 (method git-fetch)
281 (uri (git-reference
282 (url "https://aomedia.googlesource.com/aom/")
283 (commit commit)))
284 (file-name (git-file-name name version))
285 (sha256
286 (base32
287 "1pdd5h3n42607n6qmggz4yv8izhjr2kl6knb3kh7gh4v0vy47h1r"))))
288 (build-system cmake-build-system)
289 (native-inputs
290 `(("perl" ,perl)
291 ("pkg-config" ,pkg-config)
292 ("python" ,python))) ; to detect the version
293 (arguments
294 `(#:tests? #f ;no check target
295 #:configure-flags
296 ;; build dynamic library
297 (list "-DBUILD_SHARED_LIBS=YES"
298 "-DENABLE_PIC=TRUE"
299 "-DAOM_TARGET_CPU=generic"
300 (string-append "-DCMAKE_INSTALL_PREFIX="
301 (assoc-ref %outputs "out")))))
302 (home-page "https://aomedia.googlesource.com/aom/")
303 (synopsis "AV1 video codec")
304 (description "Libaom is the reference implementation of AV1. It includes
305 a shared library and encoder and decoder command-line executables.")
306 (license license:bsd-2))))
307
308 (define-public libmpeg2
309 (package
310 (name "libmpeg2")
311 (version "0.5.1")
312 (source (origin
313 (method url-fetch)
314 ;; A mirror://sourceforge URI doesn't work, presumably
315 ;; because the SourceForge project is misconfigured.
316 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
317 name "-" version ".tar.gz"))
318 (patches (search-patches "libmpeg2-arm-private-symbols.patch"
319 "libmpeg2-global-symbol-test.patch"))
320 (sha256
321 (base32
322 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
323 (inputs
324 `(("libx11" ,libx11)
325 ("libxext" ,libxext)
326 ("libxv" ,libxv)
327 ("libsm" ,libsm)
328 ("libice" ,libice)
329 ("sdl" ,sdl)))
330 (build-system gnu-build-system)
331 (home-page "http://libmpeg2.sourceforge.net/")
332 (synopsis "MPEG1 and MPEG2 video decoder library")
333 (description
334 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
335 (license license:gpl2+)))
336
337 (define-public libx264
338 (package
339 (name "libx264")
340 (version "20180810-2245")
341 (source (origin
342 (method url-fetch)
343 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
344 "x264-snapshot-" version "-stable.tar.bz2"))
345 (sha256
346 (base32
347 "0f25f39imas9pcqm7lnaa0shhjmf42hdx7jxzcnvxc7qsb7lh1bv"))))
348 (build-system gnu-build-system)
349 (native-inputs
350 `(("pkg-config" ,pkg-config)
351 ("nasm" ,nasm)))
352 ;; TODO: Add gpac input
353 (arguments
354 `(#:tests? #f ;no check target
355 #:configure-flags '("--enable-shared"
356 ;; Don't build the command-line program. If we
357 ;; want it later, we should do so in a different
358 ;; package to avoid a circular dependency (the x264
359 ;; program depends on ffmpeg and ffmpeg depends on
360 ;; libx264).
361 "--disable-cli"
362
363 ;; On MIPS, we must pass "--disable-asm" or else
364 ;; configure fails after printing: "You specified a
365 ;; pre-MSA CPU in your CFLAGS. If you really want
366 ;; to run on such a CPU, configure with
367 ;; --disable-asm."
368 ,@(if (string-prefix? "mips"
369 (or (%current-target-system)
370 (%current-system)))
371 '("--disable-asm")
372 '()))))
373 (home-page "https://www.videolan.org/developers/x264.html")
374 (synopsis "H.264 video coding library")
375 (description "libx264 is an advanced encoding library for creating
376 H.264 (MPEG-4 AVC) video streams.")
377 (license (list license:gpl2+ ;most files
378 license:isc ;common/x86/x86inc.asm
379 license:lgpl2.1+ ;extras/getopt.c
380 license:bsd-3 ;extras/inttypes.h
381 (license:non-copyleft ;extras/cl*.h
382 "file://extras/cl.h"
383 "See extras/cl.h in the distribution.")))))
384
385 (define-public mkvtoolnix
386 (package
387 (name "mkvtoolnix")
388 (version "37.0.0")
389 (source
390 (origin
391 (method url-fetch)
392 (uri (string-append "https://mkvtoolnix.download/sources/"
393 "mkvtoolnix-" version ".tar.xz"))
394 (sha256
395 (base32 "0r4d9318ymb9a0mkc0shi9p4kjy3m70s49v4f8dmjhvj63silhix"))
396 (modules '((guix build utils)))
397 (snippet '(begin
398 ;; Delete bundled libraries.
399 (for-each delete-file-recursively
400 '("lib/fmt"
401 "lib/libebml"
402 "lib/libmatroska"
403 "lib/nlohmann-json"
404 "lib/pugixml"
405 "lib/utf8-cpp"))
406 #t))))
407 (build-system gnu-build-system)
408 (outputs '("out" "gui")) ; "mkvtoolnix-gui" brings the closure size from ~300 MB to 1.5+ GB.
409 (inputs
410 `(("boost" ,boost)
411 ("bzip2" ,bzip2)
412 ("cmark" ,cmark)
413 ("libebml" ,libebml)
414 ("file" ,file)
415 ("flac" ,flac)
416 ("fmt" ,fmt)
417 ("libmatroska" ,libmatroska)
418 ("libogg" ,libogg)
419 ("libvorbis" ,libvorbis)
420 ("lzo" ,lzo)
421 ("pugixml" ,pugixml)
422 ("qtbase" ,qtbase)
423 ("qtmultimedia" ,qtmultimedia)
424 ("utfcpp" ,utfcpp)
425 ("zlib" ,zlib)))
426 (native-inputs
427 `(("docbook-xsl" ,docbook-xsl)
428 ("gettext" ,gettext-minimal)
429 ("googletest" ,googletest)
430 ("libxslt" ,libxslt)
431 ("nlohmann-json-cpp" ,nlohmann-json-cpp)
432 ("perl" ,perl)
433 ("pkg-config" ,pkg-config)
434 ("po4a" ,po4a)
435 ("qttools" ,qttools)
436 ("ruby" ,ruby)))
437 (arguments
438 `(#:configure-flags
439 (list (string-append "--with-boost="
440 (assoc-ref %build-inputs "boost"))
441 (string-append "--with-docbook-xsl-root="
442 (assoc-ref %build-inputs "docbook-xsl")
443 "/xml/xsl/docbook-xsl-"
444 ,(package-version docbook-xsl))
445 "--enable-update-check=no"
446 "--enable-precompiled-headers=no")
447 #:phases
448 (modify-phases %standard-phases
449 (add-after 'unpack 'patch-relative-file-names
450 (lambda* (#:key outputs #:allow-other-keys)
451 (let ((out (assoc-ref outputs "out")))
452 (substitute* "src/mkvtoolnix-gui/util/settings.cpp"
453 (("mkvmerge" match)
454 (string-append out "/bin/" match)))
455 #t)))
456 (add-before 'configure 'add-googletest
457 (lambda* (#:key inputs #:allow-other-keys)
458 (symlink
459 (string-append (assoc-ref inputs "googletest")
460 "/include/gtest") "lib/gtest")
461 #t))
462 (replace 'build
463 (lambda _
464 (let ((-j (list "-j" (number->string (parallel-job-count)))))
465 (apply invoke "rake" -j))))
466 (replace 'check
467 (lambda _
468 (invoke "rake" "tests/unit")))
469 (replace 'install
470 (lambda _
471 (invoke "rake" "install")))
472 (add-after 'install 'post-install
473 (lambda* (#:key outputs #:allow-other-keys)
474 ;; Move the Qt interface to "gui".
475 (let* ((out (assoc-ref outputs "out"))
476 (gui (assoc-ref outputs "gui"))
477 (strip-store-dir (lambda (path)
478 (substring path (string-prefix-length out path)))))
479 (for-each
480 (lambda (file)
481 (mkdir-p (string-append gui (dirname file)))
482 (rename-file (string-append out file)
483 (string-append gui file)))
484 (append '("/bin/mkvtoolnix-gui"
485 "/share/applications/org.bunkus.mkvtoolnix-gui.desktop"
486 "/share/metainfo/org.bunkus.mkvtoolnix-gui.appdata.xml"
487 "/share/mime/packages/org.bunkus.mkvtoolnix-gui.xml")
488 (map strip-store-dir (find-files out "\\.ogg$"))
489 (map strip-store-dir (find-files out "mkvtoolnix-gui\\.png$"))
490 (map strip-store-dir (find-files out "mkvtoolnix-gui\\.1"))))
491 (for-each
492 (lambda (file)
493 (delete-file-recursively (string-append out file)))
494 '("/share/applications"
495 "/share/metainfo"
496 "/share/mime"
497 "/share/mkvtoolnix")))
498 #t)))))
499 (home-page "https://mkvtoolnix.download")
500 (synopsis "Tools to create, alter and inspect Matroska files")
501 (description
502 "MKVToolNix provides tools for getting information about Matroska files
503 (@command{mkvinfo}), extracting tracks/data from Matroska files
504 (@command{mkvextract}), and creating Matroska files from other media files
505 (@command{mkvmerge}).")
506 (license license:gpl2)))
507
508 (define-public x265
509 (package
510 (name "x265")
511 (version "3.1.2")
512 (outputs '("out" "static"))
513 (source
514 (origin
515 (method url-fetch)
516 (uri (list (string-append "https://bitbucket.org/multicoreware/x265"
517 "/downloads/x265_" version ".tar.gz")
518 (string-append "https://download.videolan.org/videolan/x265/"
519 "x265_" version ".tar.gz")))
520 (sha256
521 (base32
522 "1ajr59gjj47gnczfb2qhmzclj746pdiq9a1d81b0mq22k8f5yy3g"))
523 (patches (search-patches "x265-arm-flags.patch"))
524 (modules '((guix build utils)))
525 (snippet '(begin
526 (delete-file-recursively "source/compat/getopt")
527 #t))))
528 (build-system cmake-build-system)
529 (arguments
530 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
531 #:configure-flags
532 ;; Ensure position independent code for everyone.
533 (list "-DENABLE_PIC=TRUE"
534 ,@(if (string-prefix? "armhf" (or (%current-system)
535 (%current-target-system)))
536 '("-DENABLE_ASSEMBLY=OFF")
537 '())
538 (string-append "-DCMAKE_INSTALL_PREFIX="
539 (assoc-ref %outputs "out")))
540 #:phases
541 (modify-phases %standard-phases
542 (add-after 'unpack 'prepare-build
543 (lambda _
544 (delete-file-recursively "build")
545 (chdir "source")
546 ;; recognize armv8 in 32-bit mode as ARM
547 (substitute* "CMakeLists.txt"
548 (("armv6l") "armv8l"))
549 #t))
550 (add-before 'configure 'build-12-bit
551 (lambda* (#:key (configure-flags '()) #:allow-other-keys)
552 (mkdir "../build-12bit")
553 (with-directory-excursion "../build-12bit"
554 (apply invoke
555 "cmake" "../source"
556 "-DHIGH_BIT_DEPTH=ON"
557 "-DEXPORT_C_API=OFF"
558 "-DENABLE_CLI=OFF"
559 "-DMAIN12=ON"
560 configure-flags)
561 (substitute* (cons "cmake_install.cmake"
562 (append
563 (find-files "CMakeFiles/x265-shared.dir" ".")
564 (find-files "CMakeFiles/x265-static.dir" ".")))
565 (("libx265") "libx265_main12"))
566 (invoke "make"))))
567 (add-before 'configure 'build-10-bit
568 (lambda* (#:key (configure-flags '()) #:allow-other-keys)
569 (mkdir "../build-10bit")
570 (with-directory-excursion "../build-10bit"
571 (apply invoke
572 "cmake" "../source"
573 "-DHIGH_BIT_DEPTH=ON"
574 "-DEXPORT_C_API=OFF"
575 "-DENABLE_CLI=OFF"
576 configure-flags)
577 (substitute* (cons "cmake_install.cmake"
578 (append
579 (find-files "CMakeFiles/x265-shared.dir" ".")
580 (find-files "CMakeFiles/x265-static.dir" ".")))
581 (("libx265") "libx265_main10"))
582 (invoke "make"))))
583 (add-after 'install 'install-more-libs
584 (lambda _
585 (with-directory-excursion "../build-12bit"
586 (invoke "make" "install"))
587 (with-directory-excursion "../build-10bit"
588 (invoke "make" "install"))))
589 (add-before 'strip 'move-static-libs
590 (lambda* (#:key outputs #:allow-other-keys)
591 (let ((out (assoc-ref outputs "out"))
592 (static (assoc-ref outputs "static")))
593 (mkdir-p (string-append static "/lib"))
594 (with-directory-excursion
595 (string-append out "/lib")
596 (for-each
597 (lambda (file)
598 (rename-file file
599 (string-append static "/lib/" file)))
600 (find-files "." "\\.a$"))))
601 #t)))))
602 (home-page "http://x265.org/")
603 (synopsis "Library for encoding h.265/HEVC video streams")
604 (description "x265 is a H.265 / HEVC video encoder application library,
605 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
606 (license license:gpl2+)))
607
608 (define-public libass
609 (package
610 (name "libass")
611 (version "0.14.0")
612 (source (origin
613 (method url-fetch)
614 (uri (string-append
615 "https://github.com/libass/libass/releases/download/"
616 version "/libass-" version ".tar.xz"))
617 (sha256
618 (base32
619 "18iqznl4mabhj9ywfsz4kwvbsplcv1jjxq50nxssvbj8my1267w8"))))
620 (build-system gnu-build-system)
621 (native-inputs
622 `(("pkg-config" ,pkg-config)
623 ("nasm" ,nasm)))
624 (propagated-inputs
625 `(("freetype" ,freetype)
626 ("fribidi" ,fribidi)
627 ("fontconfig" ,fontconfig)
628 ("harfbuzz" ,harfbuzz)
629 ("enca" ,enca)))
630 (home-page "https://github.com/libass/libass")
631 (synopsis "Subtitle rendering library for the ASS/SSA format")
632 (description "libass is a subtitle rendering library for the
633 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
634 (license license:isc)))
635
636 (define-public libcaca
637 (package
638 (name "libcaca")
639 (version "0.99.beta19")
640 (source (origin
641 (method url-fetch)
642 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
643 version ".tar.gz"))
644 (sha256
645 (base32
646 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
647 (build-system gnu-build-system)
648 (native-inputs `(("pkg-config" ,pkg-config)))
649 (inputs
650 `(("freeglut" ,freeglut)
651 ("ftgl" ,ftgl)
652 ("imlib2" ,imlib2)
653 ("libx11" ,libx11)
654 ("mesa" ,mesa)
655 ("ncurses" ,ncurses)
656 ("zlib" ,zlib)))
657 (home-page "http://caca.zoy.org/wiki/libcaca")
658 (synopsis "Colour ASCII-art library")
659 (description "libcaca is a graphics library that outputs text instead of
660 pixels, so that it can work on older video cards or text terminals. It
661 supports Unicode, 2048 colors, dithering of color images, and advanced text
662 canvas operations.")
663 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
664
665 (define-public libdca
666 (package
667 (name "libdca")
668 (version "0.0.6")
669 (source (origin
670 (method url-fetch)
671 (uri (string-append
672 "https://download.videolan.org/pub/videolan/libdca/"
673 version "/libdca-" version ".tar.bz2"))
674 (sha256
675 (base32
676 "0h0zvcn97i9kyljdpifzi8in9xnw31fx3b3ggj96p8h0l2d8mycq"))))
677 (build-system gnu-build-system)
678 (home-page "https://www.videolan.org/developers/libdca.html")
679 (synopsis "DTS Coherent Acoustics decoder")
680 (description "libdca is a library for decoding DTS Coherent Acoustics
681 streams.")
682 (license license:gpl2+)))
683
684 (define-public libdv
685 (package
686 (name "libdv")
687 (version "1.0.0")
688 (source (origin
689 (method url-fetch)
690 (uri (string-append
691 "mirror://sourceforge/" name "/" name "/"
692 version "/" name "-" version ".tar.gz"))
693 (sha256
694 (base32
695 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
696 (build-system gnu-build-system)
697 (native-inputs `(("pkg-config" ,pkg-config)))
698 (inputs `(("libxv" ,libxv)))
699 (home-page "http://libdv.sourceforge.net/")
700 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
701 (description "The Quasar DV codec (libdv) is a software codec for DV
702 video, the encoding format used by most digital camcorders, typically those
703 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
704 developed according to the official standards for DV video: IEC 61834 and
705 SMPTE 314M.")
706 (license license:lgpl2.1+)))
707
708 (define-public libmatroska
709 (package
710 (name "libmatroska")
711 (version "1.5.2")
712 (source
713 (origin
714 (method url-fetch)
715 (uri (string-append "https://dl.matroska.org/downloads/"
716 "libmatroska/libmatroska-" version ".tar.xz"))
717 (sha256
718 (base32 "0qn9lfs0877wbv581yxw2gywxywxpvwslc5q07q4f7bqpyzxxiha"))))
719 (build-system cmake-build-system)
720 (inputs
721 `(("libebml" ,libebml)))
722 (arguments
723 `(#:configure-flags
724 (list "-DBUILD_SHARED_LIBS=YES")
725 #:tests? #f)) ; no test suite
726 (home-page "https://www.matroska.org")
727 (synopsis "C++ library to parse Matroska files (.mkv and .mka)")
728 (description
729 "Matroska aims to become the standard of multimedia container formats.
730 It is based on @dfn{EBML} (Extensible Binary Meta Language), a binary derivative
731 of XML. EBML enables the Matroska Development Team to gain significant
732 advantages in terms of future format extensibility, without breaking file
733 support in old parsers.
734 libebml is a C++ library to read and write EBML files.")
735 (license license:lgpl2.1)))
736
737 (define-public libva
738 (package
739 (name "libva")
740 (version "2.5.0")
741 (source
742 (origin
743 (method url-fetch)
744 (uri (list
745 ;; Newer releases are only available on GitHub.
746 (string-append "https://github.com/01org/libva/releases/download/"
747 version "/libva-" version ".tar.bz2")
748 ;; Keep the old URL around for compatibility.
749 (string-append "https://www.freedesktop.org/software/vaapi/releases/"
750 "libva/libva-" version "/libva-" version ".tar.bz2")))
751 (sha256
752 (base32 "0y38mw1ggxm15zq06r4qpwhd5wx4bppw1rsxpr6sq1m5d79rra1s"))))
753 (build-system gnu-build-system)
754 (native-inputs
755 `(("pkg-config" ,pkg-config)))
756 (inputs
757 `(("libdrm" ,libdrm)
758 ("libx11" ,libx11)
759 ("libxext" ,libxext)
760 ("libxfixes" ,libxfixes)
761 ("mesa" ,mesa)
762 ("wayland" ,wayland)))
763 (arguments
764 `(#:phases
765 (modify-phases %standard-phases
766 (add-before
767 'build 'fix-dlopen-paths
768 (lambda* (#:key outputs #:allow-other-keys)
769 (let ((out (assoc-ref outputs "out")))
770 (substitute* "va/drm/va_drm_auth_x11.c"
771 (("\"libva-x11\\.so\\.%d\"")
772 (string-append "\"" out "/lib/libva-x11.so.%d\"")))
773 #t))))
774 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
775 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
776 #:configure-flags
777 (list (string-append "--with-drivers-path="
778 (assoc-ref %build-inputs "mesa") "/lib/dri"))
779 ;; However, we can't write to mesa's store directory, so override the
780 ;; following make variable to install the dummy driver to libva's
781 ;; $prefix/lib/dri directory.
782 #:make-flags
783 (list (string-append "dummy_drv_video_ladir="
784 (assoc-ref %outputs "out") "/lib/dri"))))
785 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
786 (synopsis "Video acceleration library")
787 (description "The main motivation for VA-API (Video Acceleration API) is
788 to enable hardware accelerated video decode/encode at various
789 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
790 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
791 (license license:expat)))
792
793 (define-public libva-utils
794 (package
795 (name "libva-utils")
796 (version "2.5.0")
797 (source
798 (origin
799 (method url-fetch)
800 (uri (string-append "https://github.com/intel/libva-utils/releases/download/"
801 version "/libva-utils-" version ".tar.bz2"))
802 (sha256
803 (base32 "05rasyqnsg522zqxak1q8rrm1hys7wwbi41kd0szjq0d27awjf4j"))))
804 (build-system gnu-build-system)
805 (arguments
806 `(#:configure-flags
807 (list "--enable-wayland"
808 "--enable-x11")))
809 (native-inputs
810 `(("pkg-config" ,pkg-config)))
811 (inputs
812 `(("libdrm" ,libdrm)
813 ("libva" ,libva)
814 ("libx11" ,libx11)
815 ("mesa" ,mesa)
816 ("wayland" ,wayland)))
817 (home-page "https://01.org/linuxmedia/vaapi")
818 (synopsis "Collection of testing utilities for VA-API")
819 (description
820 "This is a collection of utilities to query and test the @acronym{VA-API,
821 Video Acceleration API} implemented by the libva library.
822
823 These tools require a supported graphics chip, driver, and VA-API back end to
824 operate properly.")
825 (license license:expat)))
826
827 (define-public ffmpeg
828 (package
829 (name "ffmpeg")
830 (version "4.2.1")
831 (source (origin
832 (method url-fetch)
833 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
834 version ".tar.xz"))
835 (sha256
836 (base32
837 "1m5nkc61ihgcf0b2wabm0zyqa8sj3c0w8fi6kr879lb0kdzciiyf"))))
838 (build-system gnu-build-system)
839 (inputs
840 `(("dav1d" ,dav1d)
841 ("fontconfig" ,fontconfig)
842 ("freetype" ,freetype)
843 ("frei0r-plugins" ,frei0r-plugins)
844 ("gnutls" ,gnutls)
845 ("opus" ,opus)
846 ("ladspa" ,ladspa)
847 ("lame" ,lame)
848 ("libaom" ,libaom)
849 ("libass" ,libass)
850 ("libbluray" ,libbluray)
851 ("libcaca" ,libcaca)
852 ("libcdio-paranoia" ,libcdio-paranoia)
853 ("libdrm" ,libdrm)
854 ("libtheora" ,libtheora)
855 ("libva" ,libva)
856 ("libvdpau" ,libvdpau)
857 ("libvorbis" ,libvorbis)
858 ("libvpx" ,libvpx)
859 ("libx11" ,libx11)
860 ("libx264" ,libx264)
861 ("mesa" ,mesa)
862 ("openal" ,openal)
863 ("pulseaudio" ,pulseaudio)
864 ("sdl" ,sdl2)
865 ("soxr" ,soxr)
866 ("speex" ,speex)
867 ("twolame" ,twolame)
868 ("vidstab" ,vidstab)
869 ("x265" ,x265)
870 ("xvid" ,xvid)
871 ("zlib" ,zlib)))
872 (native-inputs
873 `(("bc" ,bc)
874 ("perl" ,perl)
875 ("pkg-config" ,pkg-config)
876 ("texinfo" ,texinfo)
877 ("python" ,python-2) ; scripts use interpreter python2
878 ("speex" ,speex)
879 ("yasm" ,yasm)))
880 (arguments
881 `(#:test-target "fate"
882 #:configure-flags
883 ;; possible additional inputs:
884 ;; --enable-avisynth enable reading of AviSynth script
885 ;; files [no]
886 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
887 ;; --enable-libcelt enable CELT decoding via libcelt [no]
888 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
889 ;; and libraw1394 [no]
890 ;; --enable-libfaac enable AAC encoding via libfaac [no]
891 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
892 ;; --enable-libflite enable flite (voice synthesis) support via
893 ;; libflite [no]
894 ;; --enable-libgme enable Game Music Emu via libgme [no]
895 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
896 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
897 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
898 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
899 ;; --enable-libnut enable NUT (de)muxing via libnut,
900 ;; native (de)muxer exists [no]
901 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
902 ;; libopencore-amrnb [no]
903 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
904 ;; libopencore-amrwb [no]
905 ;; --enable-libopencv enable video filtering via libopencv [no]
906 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
907 ;; OpenJPEG [no]
908 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
909 ;; --enable-libschroedinger enable Dirac de/encoding via
910 ;; libschroedinger [no]
911 ;; --enable-libshine enable fixed-point MP3 encoding via
912 ;; libshine [no]
913 ;; --enable-libssh enable SFTP protocol via libssh [no]
914 ;; (libssh2 does not work)
915 ;; --enable-libstagefright-h264 enable H.264 decoding via
916 ;; libstagefright [no]
917 ;; --enable-libutvideo enable Ut Video encoding and decoding via
918 ;; libutvideo [no]
919 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
920 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
921 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
922 ;; libvo-amrwbenc [no]
923 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
924 ;; --enable-libxavs enable AVS encoding via xavs [no]
925 ;; --enable-libzmq enable message passing via libzmq [no]
926 ;; --enable-libzvbi enable teletext support via libzvbi [no]
927 ;; --enable-opencl enable OpenCL code
928 '("--enable-avresample"
929 "--enable-gpl" ; enable optional gpl licensed parts
930 "--enable-shared"
931 "--enable-frei0r"
932 "--enable-fontconfig"
933 "--enable-gnutls"
934 "--enable-ladspa"
935 "--enable-libaom"
936 "--enable-libass"
937 "--enable-libbluray"
938 "--enable-libcaca"
939 "--enable-libcdio"
940 "--enable-libdav1d"
941 "--enable-libfreetype"
942 "--enable-libmp3lame"
943 "--enable-libopus"
944 "--enable-libpulse"
945 "--enable-libsoxr"
946 "--enable-libspeex"
947 "--enable-libtheora"
948 "--enable-libtwolame"
949 "--enable-libvidstab"
950 "--enable-libvorbis"
951 "--enable-libvpx"
952 "--enable-libxvid"
953 "--enable-libx264"
954 "--enable-libx265"
955 "--enable-openal"
956 "--enable-opengl"
957 "--enable-libdrm"
958
959 "--enable-runtime-cpudetect"
960
961 ;; The HTML pages take 7.2 MiB
962 "--disable-htmlpages"
963
964 ;; The static libraries are 23 MiB
965 "--disable-static"
966
967 ;; Runtime cpu detection is not implemented on
968 ;; MIPS, so we disable some features.
969 "--disable-mips32r2"
970 "--disable-mipsdsp"
971 "--disable-mipsdspr2"
972 "--disable-mipsfpu")
973 #:phases
974 (modify-phases %standard-phases
975 (replace
976 'configure
977 ;; configure does not work followed by "SHELL=..." and
978 ;; "CONFIG_SHELL=..."; set environment variables instead
979 (lambda* (#:key outputs configure-flags #:allow-other-keys)
980 (let ((out (assoc-ref outputs "out")))
981 (substitute* "configure"
982 (("#! /bin/sh") (string-append "#!" (which "sh"))))
983 (setenv "SHELL" (which "bash"))
984 (setenv "CONFIG_SHELL" (which "bash"))
985 (apply invoke
986 "./configure"
987 (string-append "--prefix=" out)
988 ;; Add $libdir to the RUNPATH of all the binaries.
989 (string-append "--extra-ldflags=-Wl,-rpath="
990 out "/lib")
991 configure-flags))))
992 (add-before
993 'check 'set-ld-library-path
994 (lambda _
995 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
996 ;; running tests.
997 (let* ((dso (find-files "." "\\.so$"))
998 (path (string-join (map dirname dso) ":")))
999 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
1000 (setenv "LD_LIBRARY_PATH" path)
1001 #t))))))
1002 (home-page "https://www.ffmpeg.org/")
1003 (synopsis "Audio and video framework")
1004 (description "FFmpeg is a complete, cross-platform solution to record,
1005 convert and stream audio and video. It includes the libavcodec
1006 audio/video codec library.")
1007 (license license:gpl2+)))
1008
1009 (define-public ffmpeg-3.4
1010 (package
1011 (inherit ffmpeg)
1012 (version "3.4.6")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
1016 version ".tar.xz"))
1017 (sha256
1018 (base32
1019 "0gmqbhg5jjcfanrxrl657zn12lzz73sfs8xwryfy7n9rn6f2fwim"))))
1020 (arguments
1021 (substitute-keyword-arguments (package-arguments ffmpeg)
1022 ((#:configure-flags flags)
1023 `(delete "--enable-libdav1d" (delete "--enable-libaom"
1024 ,flags)))))
1025 (inputs (alist-delete "dav1d" (alist-delete "libaom"
1026 (package-inputs ffmpeg))))))
1027
1028 (define-public ffmpeg-for-stepmania
1029 (hidden-package
1030 (package
1031 (inherit ffmpeg)
1032 (version "2.1.3")
1033 (source
1034 (origin
1035 (method git-fetch)
1036 (uri (git-reference
1037 (url "https://github.com/stepmania/ffmpeg.git")
1038 (commit "eda6effcabcf9c238e4635eb058d72371336e09b")))
1039 (sha256
1040 (base32 "1by8rmbva8mfrivdbbkr2gx4kga89zqygkd4cfjl76nr8mdcdamb"))
1041 (file-name (git-file-name "ffmpeg" version))))
1042 (arguments
1043 (substitute-keyword-arguments (package-arguments ffmpeg)
1044 ((#:configure-flags flags)
1045 '(list "--disable-programs"
1046 "--disable-doc"
1047 "--disable-debug"
1048 "--disable-avdevice"
1049 "--disable-swresample"
1050 "--disable-postproc"
1051 "--disable-avfilter"
1052 "--disable-shared"
1053 "--enable-static"))))
1054 (inputs '()))))
1055
1056 (define-public ffmpegthumbnailer
1057 (package
1058 (name "ffmpegthumbnailer")
1059 (version "2.2.0")
1060 (source (origin
1061 (method git-fetch)
1062 (uri (git-reference
1063 (url "https://github.com/dirkvdb/ffmpegthumbnailer.git")
1064 (commit version)))
1065 (file-name (git-file-name name version))
1066 (sha256
1067 (base32
1068 "0kl8aa547icy9b05njps02a8sw4yn4f8fzs228kig247sn09s4cp"))))
1069 (build-system cmake-build-system)
1070 (native-inputs
1071 `(("pkg-config" ,pkg-config)))
1072 (inputs
1073 `(("ffmpeg" ,ffmpeg)
1074 ("libjpeg-turbo" ,libjpeg-turbo)
1075 ("libpng" ,libpng)
1076 ("gvfs" ,gvfs)))
1077 (arguments
1078 `(#:configure-flags (list "-DENABLE_GIO=ON" "-DENABLE_THUMBNAILER=ON")))
1079 (home-page "https://github.com/dirkvdb/ffmpegthumbnailer")
1080 (synopsis "Create thumbnails from video files")
1081 (description "FFmpegthumbnailer is a lightweight video thumbnailer that
1082 can be used by file managers to create thumbnails for your video files. The
1083 thumbnailer uses ffmpeg to decode frames from the video files, so supported
1084 videoformats depend on the configuration flags of ffmpeg.")
1085 (license license:gpl2+)))
1086
1087 (define-public vlc
1088 (package
1089 (name "vlc")
1090 (version "3.0.8")
1091 (source (origin
1092 (method url-fetch)
1093 (uri (string-append
1094 "https://download.videolan.org/pub/videolan/vlc/"
1095 (car (string-split version #\-))
1096 "/vlc-" version ".tar.xz"))
1097 (sha256
1098 (base32
1099 "1xmxjpyzdhabchwncz6lvx3kzvl7fz9c42bkv3nbj68albs9w570"))))
1100 (build-system gnu-build-system)
1101 (native-inputs
1102 `(("flex" ,flex)
1103 ("bison" ,bison)
1104 ("gettext" ,gettext-minimal)
1105 ("git" ,git) ; needed for a test
1106 ("pkg-config" ,pkg-config)))
1107 ;; FIXME: Add optional inputs once available.
1108 (inputs
1109 `(("alsa-lib" ,alsa-lib)
1110 ("avahi" ,avahi)
1111 ("dbus" ,dbus)
1112 ("eudev" ,eudev)
1113 ("flac" ,flac)
1114 ("ffmpeg" ,ffmpeg)
1115 ("fontconfig" ,fontconfig)
1116 ("freetype" ,freetype)
1117 ("fribidi" ,fribidi)
1118 ("gnutls" ,gnutls)
1119 ("liba52" ,liba52)
1120 ("libarchive" ,libarchive)
1121 ("libass" ,libass)
1122 ("libavc1394" ,libavc1394)
1123 ("libbluray" ,libbluray)
1124 ("libcaca" ,libcaca)
1125 ("libcddb" ,libcddb)
1126 ("libdca" ,libdca)
1127 ("libdvbpsi" ,libdvbpsi)
1128 ("libdvdnav" ,libdvdnav)
1129 ("libdvdread" ,libdvdread)
1130 ("libebml" ,libebml)
1131 ("libgcrypt" ,libgcrypt)
1132 ("libidn" ,libidn)
1133 ("libkate" ,libkate)
1134 ("libmad" ,libmad)
1135 ("libmatroska" ,libmatroska)
1136 ("libmicrodns" ,libmicrodns)
1137 ("libmodplug" ,libmodplug)
1138 ("libmpeg2" ,libmpeg2)
1139 ("libogg" ,libogg)
1140 ("libpng" ,libpng)
1141 ("libraw1394" ,libraw1394)
1142 ("librsvg" ,librsvg)
1143 ("libsamplerate" ,libsamplerate)
1144 ("libsecret" ,libsecret)
1145 ("libssh2" ,libssh2)
1146 ("libupnp" ,libupnp)
1147 ("libva" ,libva)
1148 ("libvdpau" ,libvdpau)
1149 ("libvorbis" ,libvorbis)
1150 ("libvpx" ,libvpx)
1151 ("libtheora" ,libtheora)
1152 ("libx264" ,libx264)
1153 ("libxext" ,libxext)
1154 ("libxi" ,libxi)
1155 ("libxinerama" ,libxinerama)
1156 ("libxml2" ,libxml2)
1157 ("libxpm" ,libxpm)
1158 ("livemedia-utils" ,livemedia-utils)
1159 ("lua" ,lua-5.2)
1160 ("mesa" ,mesa)
1161 ("opus" ,opus)
1162 ("perl" ,perl)
1163 ("pulseaudio" ,pulseaudio)
1164 ("protobuf" ,protobuf)
1165 ("python" ,python-wrapper)
1166 ("qtbase" ,qtbase)
1167 ("qtsvg" ,qtsvg)
1168 ("qtx11extras" ,qtx11extras)
1169 ("samba" ,samba)
1170 ("sdl" ,sdl)
1171 ("sdl-image" ,sdl-image)
1172 ("speex" ,speex)
1173 ("speexdsp" ,speexdsp)
1174 ("taglib" ,taglib)
1175 ("twolame" ,twolame)
1176 ("unzip" ,unzip)
1177 ("wayland" ,wayland)
1178 ("wayland-protocols" ,wayland-protocols)
1179 ("x265" ,x265)
1180 ("xcb-util-keysyms" ,xcb-util-keysyms)))
1181 (arguments
1182 `(#:configure-flags
1183 `("CXXFLAGS=-std=gnu++11"
1184 "BUILDCC=gcc"
1185 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
1186 (assoc-ref %build-inputs "ffmpeg")
1187 "/lib")) ;needed for the tests
1188
1189 #:phases
1190 (modify-phases %standard-phases
1191 (add-after 'unpack 'patch-source
1192 (lambda* (#:key inputs #:allow-other-keys)
1193 (let ((livemedia-utils (assoc-ref inputs "livemedia-utils")))
1194 (substitute* "configure"
1195 (("LIVE555_PREFIX=\\$\\{LIVE555_PREFIX-\"/usr\"\\}")
1196 (string-append "LIVE555_PREFIX=" livemedia-utils)))
1197 ;; Some of the tests require using the display to test out VLC,
1198 ;; which fails in our sandboxed build system
1199 (substitute* "test/run_vlc.sh"
1200 (("./vlc --ignore-config") "echo"))
1201
1202 ;; modules/text_renderer/freetype/text_layout.c uses a
1203 ;; now-deprecated interface 'fribidi_get_par_embedding_levels'
1204 ;; from fribidi.h, so for now we enable the use of deprecated
1205 ;; fribidi interfaces from this file.
1206 ;; FIXME: Try removing this for vlc >= 3.0.3.
1207 (substitute* "modules/text_renderer/freetype/text_layout.c"
1208 (("# define FRIBIDI_NO_DEPRECATED 1") ""))
1209
1210 ;; Fix build with libssh2 > 1.8.0:
1211 ;; <https://trac.videolan.org/vlc/ticket/22060>
1212 ;; <https://git.videolan.org/?p=vlc.git;a=commit;h=11449b5cd8b415768e010d9b7c1d6ba3cea21f82>
1213 (substitute* "modules/access/sftp.c"
1214 (("010801") "010900"))
1215 #t)))
1216 (add-after 'strip 'regenerate-plugin-cache
1217 (lambda* (#:key outputs #:allow-other-keys)
1218 ;; The 'install-exec-hook' rule in the top-level Makefile.am
1219 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
1220 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
1221 ;; it references. Thus, we first reset the timestamps of all
1222 ;; these files, and then regenerate the cache such that the
1223 ;; mtimes it includes are always zero instead of being dependent
1224 ;; on the build time.
1225 (let* ((out (assoc-ref outputs "out"))
1226 (pkglibdir (string-append out "/lib/vlc"))
1227 (plugindir (string-append pkglibdir "/plugins"))
1228 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
1229 ;; TODO: Factorize 'reset-timestamps'.
1230 (for-each (lambda (file)
1231 (let ((s (lstat file)))
1232 (unless (eq? (stat:type s) 'symlink)
1233 (utime file 1 1))))
1234 (find-files plugindir))
1235 (invoke cachegen plugindir))))
1236 (add-after 'install 'wrap-executable
1237 (lambda* (#:key outputs #:allow-other-keys)
1238 (let ((out (assoc-ref outputs "out"))
1239 (plugin-path (getenv "QT_PLUGIN_PATH")))
1240 (wrap-program (string-append out "/bin/vlc")
1241 `("QT_PLUGIN_PATH" ":" prefix (,plugin-path))))
1242 #t)))))
1243 (home-page "https://www.videolan.org/")
1244 (synopsis "Audio and video framework")
1245 (description "VLC is a cross-platform multimedia player and framework
1246 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
1247 streaming protocols.")
1248 (license license:gpl2+)))
1249
1250 (define-public mplayer
1251 (package
1252 (name "mplayer")
1253 (version "1.3.0")
1254 (source (origin
1255 (method url-fetch)
1256 (uri (string-append
1257 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
1258 version ".tar.xz"))
1259 (sha256
1260 (base32
1261 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
1262 (build-system gnu-build-system)
1263 ;; FIXME: Add additional inputs once available.
1264 (native-inputs
1265 `(("pkg-config" ,pkg-config)))
1266 (inputs
1267 `(("alsa-lib" ,alsa-lib)
1268 ("cdparanoia" ,cdparanoia)
1269 ("ffmpeg" ,ffmpeg-3.4)
1270 ("fontconfig" ,fontconfig)
1271 ("freetype" ,freetype)
1272 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
1273 ("lame" ,lame)
1274 ("libass" ,libass)
1275 ("libdvdcss" ,libdvdcss)
1276 ("libdvdnav" ,libdvdnav)
1277 ("libjpeg" ,libjpeg)
1278 ("libmpeg2" ,libmpeg2)
1279 ("libmpg123" ,mpg123) ; audio codec for MP3
1280 ("libpng" ,libpng)
1281 ("libtheora" ,libtheora)
1282 ("libvdpau" ,libvdpau)
1283 ("libvorbis" ,libvorbis)
1284 ("libx11" ,libx11)
1285 ("libx264" ,libx264)
1286 ("libxinerama" ,libxinerama)
1287 ("libxv" ,libxv)
1288 ("libxxf86dga" ,libxxf86dga)
1289 ("mesa" ,mesa)
1290 ("opus" ,opus)
1291 ("perl" ,perl)
1292 ("pulseaudio" ,pulseaudio)
1293 ("python" ,python-wrapper)
1294 ("sdl" ,sdl)
1295 ("speex" ,speex)
1296 ("yasm" ,yasm)
1297 ("zlib" ,zlib)))
1298 (arguments
1299 `(#:tests? #f ; no test target
1300 #:phases
1301 (modify-phases %standard-phases
1302 (replace 'configure
1303 ;; configure does not work followed by "SHELL=..." and
1304 ;; "CONFIG_SHELL=..."; set environment variables instead
1305 (lambda* (#:key inputs outputs #:allow-other-keys)
1306 (let ((out (assoc-ref outputs "out"))
1307 (libx11 (assoc-ref inputs "libx11")))
1308 (substitute* "configure"
1309 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1310 (setenv "SHELL" (which "bash"))
1311 (setenv "CONFIG_SHELL" (which "bash"))
1312 (invoke "./configure"
1313 (string-append "--extra-cflags=-I"
1314 libx11 "/include") ; to detect libx11
1315 "--disable-ffmpeg_a" ; disables bundled ffmpeg
1316 (string-append "--prefix=" out)
1317 ;; Enable runtime cpu detection where supported,
1318 ;; and choose a suitable target.
1319 ,@(match (or (%current-target-system)
1320 (%current-system))
1321 ("x86_64-linux"
1322 '("--enable-runtime-cpudetection"
1323 "--target=x86_64-linux"))
1324 ("i686-linux"
1325 '("--enable-runtime-cpudetection"
1326 "--target=i686-linux"))
1327 ("mips64el-linux"
1328 '("--target=mips3-linux"))
1329 (_ (list (string-append
1330 "--target="
1331 (or (%current-target-system)
1332 (nix-system->gnu-triplet
1333 (%current-system)))))))
1334 "--disable-iwmmxt")))))))
1335 (home-page "https://www.mplayerhq.hu/design7/news.html")
1336 (synopsis "Audio and video player")
1337 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
1338 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
1339 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
1340 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
1341 (license license:gpl2)))
1342
1343 (define-public mpv
1344 (package
1345 (name "mpv")
1346 (version "0.29.1")
1347 (source (origin
1348 (method git-fetch)
1349 (uri (git-reference
1350 (url "https://github.com/mpv-player/mpv.git")
1351 (commit (string-append "v" version))))
1352 (file-name (git-file-name name version))
1353 (sha256
1354 (base32
1355 "138921kx8g6qprim558xin09xximjhsj9ss8b71ifg2m6kclym8m"))))
1356 (build-system waf-build-system)
1357 (native-inputs
1358 `(("perl" ,perl) ; for zsh completion file
1359 ("pkg-config" ,pkg-config)
1360 ("python-docutils" ,python-docutils)))
1361 ;; Missing features: libguess, V4L2
1362 (inputs
1363 `(("alsa-lib" ,alsa-lib)
1364 ("enca" ,enca)
1365 ("ffmpeg" ,ffmpeg)
1366 ("jack" ,jack-1)
1367 ("ladspa" ,ladspa)
1368 ("lcms" ,lcms)
1369 ("libass" ,libass)
1370 ("libbluray" ,libbluray)
1371 ("libcaca" ,libcaca)
1372 ("libbs2b" ,libbs2b)
1373 ("libcdio-paranoia" ,libcdio-paranoia)
1374 ("libdvdread" ,libdvdread)
1375 ("libdvdnav" ,libdvdnav)
1376 ("libjpeg" ,libjpeg)
1377 ("libva" ,libva)
1378 ("libvdpau" ,libvdpau)
1379 ("libx11" ,libx11)
1380 ("libxext" ,libxext)
1381 ("libxinerama" ,libxinerama)
1382 ("libxrandr" ,libxrandr)
1383 ("libxscrnsaver" ,libxscrnsaver)
1384 ("libxv" ,libxv)
1385 ;; XXX: lua > 5.2 is not currently supported; see
1386 ;; waftools/checks/custom.py
1387 ("lua" ,lua-5.2)
1388 ("mesa" ,mesa)
1389 ("mpg123" ,mpg123)
1390 ("pulseaudio" ,pulseaudio)
1391 ("rsound" ,rsound)
1392 ("shaderc" ,shaderc)
1393 ("vulkan-headers" ,vulkan-headers)
1394 ("vulkan-loader" ,vulkan-loader)
1395 ("waf" ,python-waf)
1396 ("wayland" ,wayland)
1397 ("wayland-protocols" ,wayland-protocols)
1398 ("libxkbcommon" ,libxkbcommon)
1399 ("youtube-dl" ,youtube-dl)
1400 ("zlib" ,zlib)))
1401 (arguments
1402 '(#:phases
1403 (modify-phases %standard-phases
1404 (add-after
1405 'unpack 'patch-paths
1406 (lambda* (#:key inputs #:allow-other-keys)
1407 (let ((ytdl (assoc-ref inputs "youtube-dl")))
1408 (substitute* "player/lua/ytdl_hook.lua"
1409 (("\"youtube-dl\",")
1410 (string-append "\"" ytdl "/bin/youtube-dl\",")))
1411 #t)))
1412 (add-before
1413 'configure 'setup-waf
1414 (lambda* (#:key inputs #:allow-other-keys)
1415 (let ((waf (assoc-ref inputs "waf")))
1416 (copy-file (string-append waf "/bin/waf") "waf"))
1417 (setenv "CC" "gcc")
1418 #t)))
1419 #:configure-flags (list "--enable-libmpv-shared"
1420 "--enable-cdda"
1421 "--enable-dvdread"
1422 "--enable-dvdnav"
1423 "--enable-zsh-comp"
1424 "--disable-build-date")
1425 ;; No check function defined.
1426 #:tests? #f))
1427 (home-page "https://mpv.io/")
1428 (synopsis "Audio and video player")
1429 (description "mpv is a general-purpose audio and video player. It is a
1430 fork of mplayer2 and MPlayer. It shares some features with the former
1431 projects while introducing many more.")
1432 (license license:gpl2+)))
1433
1434 (define-public gnome-mpv
1435 (deprecated-package "gnome-mpv" celluloid))
1436
1437 (define-public libvpx
1438 (package
1439 (name "libvpx")
1440 (version "1.8.1")
1441 (source (origin
1442 ;; XXX: Upstream does not provide tarballs for > 1.6.1.
1443 (method git-fetch)
1444 (uri (git-reference
1445 (url "https://chromium.googlesource.com/webm/libvpx")
1446 (commit (string-append "v" version))))
1447 (file-name (git-file-name name version))
1448 (sha256
1449 (base32
1450 "0mm1dcfa268rwsrgzqpbbgq4lwrvdzgp90h9dxsnkhai70l7gipq"))
1451 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
1452 (build-system gnu-build-system)
1453 (arguments
1454 `(#:configure-flags (list "--enable-shared"
1455 "--as=yasm"
1456 ;; Limit size to avoid CVE-2015-1258
1457 "--size-limit=16384x16384"
1458 (string-append "--prefix=" (assoc-ref %outputs "out")))
1459 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1460 (assoc-ref %outputs "out") "/lib"))
1461 #:phases (modify-phases %standard-phases
1462 (replace 'configure
1463 (lambda* (#:key configure-flags #:allow-other-keys)
1464 ;; The configure script does not understand some of the GNU
1465 ;; options, so we only add the flags specified above.
1466 (apply invoke "./configure" configure-flags))))
1467 #:tests? #f)) ; no check target
1468 (native-inputs
1469 `(("perl" ,perl)
1470 ("yasm" ,yasm)))
1471 (synopsis "VP8/VP9 video codec")
1472 (description "libvpx is a codec for the VP8/VP9 video compression format.")
1473 (license license:bsd-3)
1474 (home-page "https://www.webmproject.org/")))
1475
1476 ;; GNU IceCat fails to build against 1.8.0, so keep this version for now.
1477 (define-public libvpx-1.7
1478 (package
1479 (inherit libvpx)
1480 (version "1.7.0")
1481 (source (origin
1482 (inherit (package-source libvpx))
1483 (uri (git-reference
1484 (url "https://chromium.googlesource.com/webm/libvpx")
1485 (commit (string-append "v" version))))
1486 (file-name (git-file-name "libvpx" version))
1487 (sha256
1488 (base32
1489 "0vvh89hvp8qg9an9vcmwb7d9k3nixhxaz6zi65qdjnd0i56kkcz6"))
1490 (patches
1491 (append
1492 (origin-patches (package-source libvpx))
1493 (search-patches "libvpx-use-after-free-in-postproc.patch")))))))
1494
1495 (define-public youtube-dl
1496 (package
1497 (name "youtube-dl")
1498 (version "2019.09.28")
1499 (source (origin
1500 (method url-fetch)
1501 (uri (string-append "https://github.com/ytdl-org/youtube-dl/"
1502 "releases/download/" version "/youtube-dl-"
1503 version ".tar.gz"))
1504 (sha256
1505 (base32
1506 "0nrk0bk6lksnmng8lwhcpkc57iibzjjamlqz8rxjpsw6dnzxz82h"))))
1507 (build-system python-build-system)
1508 (arguments
1509 ;; The problem here is that the directory for the man page and completion
1510 ;; files is relative, and for some reason, setup.py uses the
1511 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
1512 ;; So, we need pass the prefix directly. In addition, make sure the Bash
1513 ;; completion file is called 'youtube-dl' rather than
1514 ;; 'youtube-dl.bash-completion'.
1515 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1516 #:phases (modify-phases %standard-phases
1517 (add-before 'install 'fix-the-data-directories
1518 (lambda* (#:key outputs #:allow-other-keys)
1519 (let ((prefix (assoc-ref outputs "out")))
1520 (mkdir "bash-completion")
1521 (rename-file "youtube-dl.bash-completion"
1522 "bash-completion/youtube-dl")
1523 (substitute* "setup.py"
1524 (("youtube-dl\\.bash-completion")
1525 "bash-completion/youtube-dl")
1526 (("'etc/")
1527 (string-append "'" prefix "/etc/"))
1528 (("'share/")
1529 (string-append "'" prefix "/share/")))
1530 #t))))))
1531 (synopsis "Download videos from YouTube.com and other sites")
1532 (description
1533 "Youtube-dl is a small command-line program to download videos from
1534 YouTube.com and many more sites.")
1535 (home-page "https://yt-dl.org")
1536 (license license:public-domain)))
1537
1538 (define-public youtube-dl-gui
1539 (package
1540 (name "youtube-dl-gui")
1541 (version "0.3.8")
1542 (source
1543 (origin
1544 (method url-fetch)
1545 (uri (pypi-uri "Youtube-DLG" version))
1546 (sha256
1547 (base32
1548 "0napxwzgls5ik1bxbp99vly32l23xpc4ng5kr24hfhf21ypjyadb"))))
1549 (build-system python-build-system)
1550 (arguments
1551 ;; In Guix, wxpython has not yet been packaged for Python 3.
1552 `(#:python ,python-2
1553 ;; This package has no tests.
1554 #:tests? #f
1555 #:phases
1556 (modify-phases %standard-phases
1557 (add-before 'build 'patch-source
1558 (lambda* (#:key inputs #:allow-other-keys)
1559 ;; The youtube-dl-gui program lets you configure options. Some of
1560 ;; them are problematic, so we change their defaults.
1561 (substitute* "youtube_dl_gui/optionsmanager.py"
1562 ;; When this is true, the builder process will try (and fail) to
1563 ;; write logs to the builder user's home directory.
1564 (("'enable_log': True") "'enable_log': False")
1565 ;; This determines which youtube-dl program youtube-dl-gui will
1566 ;; run. If we don't set this, then youtube-dl-gui might download
1567 ;; an arbitrary copy from the Internet into the user's home
1568 ;; directory and run it, so let's make sure youtube-dl-gui uses
1569 ;; the youtube-dl from the inputs by default.
1570 (("'youtubedl_path': self.config_path")
1571 (string-append "'youtubedl_path': '"
1572 (assoc-ref inputs "youtube-dl")
1573 "/bin'"))
1574 ;; When this is True, when youtube-dl-gui is finished downloading
1575 ;; a file, it will try (and possibly fail) to open the directory
1576 ;; containing the downloaded file. This can fail because it
1577 ;; assumes that xdg-open is in PATH. Unfortunately, simply
1578 ;; adding xdg-utils to the propagated inputs is not enough to
1579 ;; make this work, so for now we set the default to False.
1580 (("'open_dl_dir': True") "'open_dl_dir': False"))
1581 ;; The youtube-dl program from the inputs is actually a wrapper
1582 ;; script written in bash, so attempting to invoke it as a python
1583 ;; script will fail.
1584 (substitute* "youtube_dl_gui/downloaders.py"
1585 (("cmd = \\['python', self\\.youtubedl_path\\]")
1586 "cmd = [self.youtubedl_path]"))
1587 ;; Use relative paths for installing data files so youtube-dl-gui
1588 ;; installs the files relative to its prefix in the store, rather
1589 ;; than relative to /. Also, instead of installing data files into
1590 ;; $prefix/usr/share, install them into $prefix/share for
1591 ;; consistency (see: (standards) Directory Variables).
1592 (substitute* "setup.py"
1593 (("= '/usr/share") "= 'share"))
1594 ;; Update get_locale_file() so it finds the installed localization
1595 ;; files.
1596 (substitute* "youtube_dl_gui/utils.py"
1597 (("os\\.path\\.join\\('/usr', 'share'")
1598 (string-append "os.path.join('"
1599 (assoc-ref %outputs "out")
1600 "', 'share'")))
1601 #t))
1602 (add-after 'install 'create-desktop-file
1603 (lambda* (#:key outputs #:allow-other-keys)
1604 (let* ((out (assoc-ref outputs "out"))
1605 (applications (string-append out "/share/applications")))
1606 (mkdir-p applications)
1607 (call-with-output-file
1608 (string-append applications "/youtube-dl-gui.desktop")
1609 (lambda (file)
1610 (format
1611 file
1612 "[Desktop Entry]~@
1613 Name=Youtube-dl GUI~@
1614 Comment=Graphical interface to download video with youtube-dl~@
1615 Exec=youtube-dl-gui~@
1616 TryExec=youtube-dl-gui~@
1617 Terminal=false~@
1618 Icon=youtube-dl-gui~@
1619 Type=Application~@
1620 Categories=AudioVideo;Audio;Video;Network~%")))
1621 #t))))))
1622 (inputs
1623 `(("python2-wxpython" ,python2-wxpython)
1624 ("youtube-dl" ,youtube-dl)))
1625 (home-page "https://github.com/MrS0m30n3/youtube-dl-gui")
1626 (synopsis
1627 "GUI (Graphical User Interface) for @command{youtube-dl}")
1628 (description
1629 "Youtube-dlG is a GUI (Graphical User Interface) for
1630 @command{youtube-dl}. You can use it to download videos from YouTube and any
1631 other site that youtube-dl supports.")
1632 (license license:unlicense)))
1633
1634 (define-public you-get
1635 (package
1636 (name "you-get")
1637 (version "0.4.1355")
1638 (source (origin
1639 (method git-fetch)
1640 (uri (git-reference
1641 (url "https://github.com/soimort/you-get.git")
1642 (commit (string-append "v" version))))
1643 (file-name (git-file-name name version))
1644 (sha256
1645 (base32
1646 "0xq7z04hvw3b3npiahlpzhbxsjvam9n9dynplyrkn84dx6k9ajbj"))))
1647 (build-system python-build-system)
1648 (inputs
1649 `(("ffmpeg" ,ffmpeg))) ; for multi-part and >=1080p videos
1650 (arguments
1651 `(#:phases
1652 (modify-phases %standard-phases
1653 (add-after 'unpack 'qualify-input-references
1654 ;; Explicitly invoke the input ffmpeg, instead of whichever one
1655 ;; happens to be in the user's $PATH at run time.
1656 (lambda* (#:key inputs #:allow-other-keys)
1657 (let ((ffmpeg (string-append (assoc-ref inputs "ffmpeg")
1658 "/bin/ffmpeg")))
1659 (substitute* "src/you_get/processor/ffmpeg.py"
1660 ;; Don't blindly replace all occurrences of ‘'ffmpeg'’: the
1661 ;; same string is also used when sniffing ffmpeg's output.
1662 (("(FFMPEG == |\\()'ffmpeg'" _ prefix)
1663 (string-append prefix "'" ffmpeg "'")))
1664 #t))))
1665 #:tests? #f)) ; XXX some tests need Internet access
1666 (synopsis "Download videos, audio, or images from Web sites")
1667 (description
1668 "You-Get is a command-line utility to download media contents (videos,
1669 audio, images) from the Web. It can use either mpv or vlc for playback.")
1670 (home-page "https://you-get.org/")
1671 (license license:expat)))
1672
1673 (define-public youtube-viewer
1674 (package
1675 (name "youtube-viewer")
1676 (version "3.5.8")
1677 (source (origin
1678 (method git-fetch)
1679 (uri (git-reference
1680 (url "https://github.com/trizen/youtube-viewer.git")
1681 (commit version)))
1682 (file-name (git-file-name name version))
1683 (sha256
1684 (base32
1685 "0zz0r3vd2pg9zzykhrq0vnvqp5842dbgsg8cfygw9vzb9j8mlq0a"))))
1686 (build-system perl-build-system)
1687 (native-inputs
1688 `(("perl-module-build" ,perl-module-build)))
1689 ;; FIXME: Add optional dependencies once available:
1690 ;; perl-lwp-useragent-cached and perl-term-readline-gnu
1691 (inputs
1692 `(("perl-data-dump" ,perl-data-dump)
1693 ("perl-file-sharedir" ,perl-file-sharedir)
1694 ("perl-gtk2" ,perl-gtk2)
1695 ("perl-json" ,perl-json)
1696 ("perl-libwww" ,perl-libwww)
1697 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1698 ("perl-mozilla-ca" ,perl-mozilla-ca)
1699 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1700
1701 ;; Some videos play without youtube-dl, but others silently fail to.
1702 ("youtube-dl" ,youtube-dl)))
1703 (arguments
1704 `(#:modules ((guix build perl-build-system)
1705 (guix build utils)
1706 (srfi srfi-26))
1707 #:module-build-flags '("--gtk")
1708 #:phases
1709 (modify-phases %standard-phases
1710 (add-after 'unpack 'refer-to-inputs
1711 (lambda* (#:key inputs #:allow-other-keys)
1712 (substitute* "lib/WWW/YoutubeViewer.pm"
1713 (("'youtube-dl'")
1714 (format #f "'~a/bin/youtube-dl'"
1715 (assoc-ref inputs "youtube-dl"))))
1716 #t))
1717 (add-after 'install 'install-desktop
1718 (lambda* (#:key outputs #:allow-other-keys)
1719 (let* ((out (assoc-ref outputs "out"))
1720 (sharedir (string-append out "/share")))
1721 (install-file "share/gtk-youtube-viewer.desktop"
1722 (string-append sharedir "/applications"))
1723 (install-file "share/icons/gtk-youtube-viewer.png"
1724 (string-append sharedir "/pixmaps"))
1725 #t)))
1726 (add-after 'install 'wrap-program
1727 (lambda* (#:key outputs #:allow-other-keys)
1728 (let* ((out (assoc-ref outputs "out"))
1729 (bin-dir (string-append out "/bin/"))
1730 (site-dir (string-append out "/lib/perl5/site_perl/"))
1731 (lib-path (getenv "PERL5LIB")))
1732 (for-each (cut wrap-program <>
1733 `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
1734 (find-files bin-dir))
1735 #t))))))
1736 (synopsis
1737 "Lightweight application for searching and streaming videos from YouTube")
1738 (description
1739 "Youtube-viewer searches and plays YouTube videos in a native player.
1740 It comes with various search options; it can search for videos, playlists
1741 and/or channels. The videos are streamed directly in a selected video player
1742 at the best resolution (customizable) and with closed-captions (if available).
1743 Both command-line and GTK2 interface are available.")
1744 (home-page "https://github.com/trizen/youtube-viewer")
1745 (license license:perl-license)))
1746
1747 (define-public libbluray
1748 (package
1749 (name "libbluray")
1750 (version "1.0.2")
1751 (source (origin
1752 (method url-fetch)
1753 (uri (string-append "https://download.videolan.org/videolan/"
1754 name "/" version "/"
1755 name "-" version ".tar.bz2"))
1756 (sha256
1757 (base32
1758 "1zxfnw1xbghcj7b3zz5djndv6gwssxda19cz1lrlqrkg8577r7kd"))))
1759 (build-system gnu-build-system)
1760 (arguments
1761 `(#:configure-flags '("--disable-bdjava-jar")
1762 #:phases
1763 (modify-phases %standard-phases
1764 (add-after 'unpack 'refer-to-libxml2-in-.pc-file
1765 ;; Avoid the need to propagate libxml2 by referring to it
1766 ;; directly, as is already done for fontconfig & freetype.
1767 (lambda* (#:key inputs #:allow-other-keys)
1768 (let ((libxml2 (assoc-ref inputs "libxml2")))
1769 (substitute* "configure"
1770 ((" libxml-2.0") ""))
1771 (substitute* "src/libbluray.pc.in"
1772 (("^Libs.private:" field)
1773 (string-append field " -L" libxml2 "/lib -lxml2")))
1774 #t)))
1775 (add-before 'build 'fix-dlopen-paths
1776 (lambda* (#:key inputs #:allow-other-keys)
1777 (let ((libaacs (assoc-ref inputs "libaacs"))
1778 (libbdplus (assoc-ref inputs "libbdplus")))
1779 (substitute* "src/libbluray/disc/aacs.c"
1780 (("\"libaacs\"")
1781 (string-append "\"" libaacs "/lib/libaacs\"")))
1782 (substitute* "src/libbluray/disc/bdplus.c"
1783 (("\"libbdplus\"")
1784 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1785 #t))))))
1786 (native-inputs `(("pkg-config" ,pkg-config)))
1787 (inputs
1788 `(("fontconfig" ,fontconfig)
1789 ("freetype" ,freetype)
1790 ("libaacs" ,libaacs)
1791 ("libbdplus" ,libbdplus)
1792 ("libxml2" ,libxml2)))
1793 (home-page "https://www.videolan.org/developers/libbluray.html")
1794 (synopsis "Blu-Ray Disc playback library")
1795 (description
1796 "libbluray is a library designed for Blu-Ray Disc playback for media
1797 players, like VLC or MPlayer.")
1798 (license license:lgpl2.1+)))
1799
1800 (define-public libdvdread
1801 (package
1802 (name "libdvdread")
1803 (version "6.0.1")
1804 (source (origin
1805 (method url-fetch)
1806 (uri (string-append "https://download.videolan.org/videolan/"
1807 "libdvdread/" version "/"
1808 "libdvdread-" version ".tar.bz2"))
1809 (sha256
1810 (base32
1811 "1gfmh8ii3s2fw1c8vn57piwxc0smd3va4h7xgp9s8g48cc04zki8"))))
1812 (build-system gnu-build-system)
1813 (arguments
1814 `(#:configure-flags '("--with-libdvdcss=yes")))
1815 (native-inputs
1816 `(("pkg-config" ,pkg-config)))
1817 (propagated-inputs
1818 `(("libdvdcss" ,libdvdcss)))
1819 (home-page "http://dvdnav.mplayerhq.hu/")
1820 (synopsis "Library for reading video DVDs")
1821 (description
1822 "Libdvdread provides a simple foundation for reading DVD video
1823 disks. It provides the functionality that is required to access many
1824 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1825 authentication and descrambling (if an external libdvdcss library is
1826 installed).")
1827 (license license:gpl2+)))
1828
1829 (define-public dvdauthor
1830 (package
1831 (name "dvdauthor")
1832 (version "0.7.2")
1833 (source
1834 (origin
1835 (method url-fetch)
1836 (uri (string-append "mirror://sourceforge/dvdauthor/dvdauthor-"
1837 version ".tar.gz"))
1838 (sha256
1839 (base32
1840 "1drfc47hikfzc9d7hjk34rw10iqw01d2vwmn91pv73ppx4nsj81h"))))
1841 (build-system gnu-build-system)
1842 (inputs
1843 `(("libdvdread" ,libdvdread)
1844 ("libpng" ,libpng)
1845 ("imagemagick" ,imagemagick)
1846 ("libxml2" ,libxml2)
1847 ("freetype" ,freetype)))
1848 (native-inputs
1849 `(("pkg-config" ,pkg-config)))
1850 (synopsis "Generates a DVD-Video movie from a MPEG-2 stream")
1851 (description "@command{dvdauthor} will generate a DVD-Video movie from a
1852 MPEG-2 stream containing VOB packets.")
1853 (home-page "http://dvdauthor.sourceforge.net")
1854 (license license:gpl3+)))
1855
1856 (define-public libdvdnav
1857 (package
1858 (name "libdvdnav")
1859 (version "6.0.0")
1860 (source (origin
1861 (method url-fetch)
1862 (uri (string-append "https://download.videolan.org/videolan/"
1863 name "/" version "/"
1864 name "-" version ".tar.bz2"))
1865 (sha256
1866 (base32
1867 "062njcksmpgw9yv3737qkf93r2pzhaxi9szqjabpa8d010dp38ph"))))
1868 (build-system gnu-build-system)
1869 (native-inputs
1870 `(("pkg-config" ,pkg-config)))
1871 (inputs
1872 `(("libdvdread" ,libdvdread)))
1873 (home-page "http://dvdnav.mplayerhq.hu/")
1874 (synopsis "Library for video DVD navigation features")
1875 (description
1876 "Libdvdnav is a library for developers of multimedia
1877 applications. It allows easy use of sophisticated DVD navigation features
1878 such as DVD menus, multiangle playback and even interactive DVD games. All
1879 this functionality is provided through a simple API which provides the DVD
1880 playback as a single logical stream of blocks, intermitted by special
1881 dvdnav events to report certain conditions. The main usage of libdvdnav is
1882 a loop regularly calling a function to get the next block, surrounded by
1883 additional calls to tell the library of user interaction. The whole
1884 DVD virtual machine and internal playback states are completely
1885 encapsulated.")
1886 (license license:gpl2+)))
1887
1888 (define-public libdvdcss
1889 (package
1890 (name "libdvdcss")
1891 (version "1.4.2")
1892 (source (origin
1893 (method url-fetch)
1894 (uri (string-append "https://download.videolan.org/pub/"
1895 name "/" version "/"
1896 name "-" version ".tar.bz2"))
1897 (sha256
1898 (base32
1899 "0x957zzpf4w2cp8zlk29prj8i2q6hay3lzdzsyz8y3cwxivyvhkq"))))
1900 (build-system gnu-build-system)
1901 (home-page "https://www.videolan.org/developers/libdvdcss.html")
1902 (synopsis "Library for accessing DVDs as block devices")
1903 (description
1904 "libdvdcss is a simple library designed for accessing DVDs like a block
1905 device without having to bother about the decryption.")
1906 (license license:gpl2+)))
1907
1908 (define-public srt2vtt
1909 (package
1910 (name "srt2vtt")
1911 (version "0.1")
1912 (source (origin
1913 (method url-fetch)
1914 (uri (string-append
1915 "https://files.dthompson.us/srt2vtt/srt2vtt-"
1916 version ".tar.gz"))
1917 (sha256
1918 (base32
1919 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1920 (build-system gnu-build-system)
1921 (inputs
1922 `(("guile" ,guile-2.0)))
1923 (synopsis "SubRip to WebVTT subtitle converter")
1924 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1925 for use with HTML5 video.")
1926 (home-page "https://dthompson.us/projects/srt2vtt.html")
1927 (license license:gpl3+)))
1928
1929 (define-public avidemux
1930 (package
1931 (name "avidemux")
1932 (version "2.7.3")
1933 (source (origin
1934 (method url-fetch)
1935 (uri (string-append
1936 "mirror://sourceforge/avidemux/avidemux/" version "/"
1937 "avidemux_" version ".tar.gz"))
1938 (sha256
1939 (base32
1940 "17x2mnnr5h8pp764p55l1xcn2ljnzhbj8cykajlllvk4rc4qwxld"))
1941 (patches (search-patches "avidemux-install-to-lib.patch"))))
1942 (build-system cmake-build-system)
1943 (native-inputs
1944 `(("pkg-config" ,pkg-config)))
1945 ;; FIXME: Once packaged, add libraries not found during the build.
1946 (inputs
1947 `(("alsa-lib" ,alsa-lib)
1948 ("fontconfig" ,fontconfig)
1949 ("freetype" ,freetype)
1950 ("fribidi" ,fribidi)
1951 ("glu" ,glu)
1952 ("jack" ,jack-1)
1953 ("lame" ,lame)
1954 ("libva" ,libva)
1955 ("libvdpau" ,libvdpau)
1956 ("libvorbis" ,libvorbis)
1957 ("libvpx" ,libvpx)
1958 ("libxv" ,libxv)
1959 ("perl" ,perl)
1960 ("pulseaudio" ,pulseaudio)
1961 ("python" ,python-wrapper)
1962 ("qtbase" ,qtbase)
1963 ("qttools" ,qttools)
1964 ("sdl" ,sdl)
1965 ("sqlite" ,sqlite)
1966 ("yasm" ,yasm)
1967 ("zlib" ,zlib)))
1968 (arguments
1969 `(#:tests? #f ; no check target
1970 #:phases
1971 ;; Make sure files inside the included ffmpeg tarball are
1972 ;; patch-shebanged.
1973 (let ((ffmpeg "ffmpeg-4.1.1"))
1974 (modify-phases %standard-phases
1975 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1976 (lambda _
1977 (with-directory-excursion "avidemux_core/ffmpeg_package"
1978 (invoke "tar" "xf" (string-append ffmpeg ".tar.bz2"))
1979 (delete-file (string-append ffmpeg ".tar.bz2")))
1980 #t))
1981 (add-after 'patch-source-shebangs 'repack-ffmpeg
1982 (lambda _
1983 (with-directory-excursion "avidemux_core/ffmpeg_package"
1984 (substitute* (string-append ffmpeg "/configure")
1985 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1986 (invoke "tar" "cjf" (string-append ffmpeg ".tar.bz2") ffmpeg
1987 ;; avoid non-determinism in the archive
1988 "--sort=name" "--mtime=@0"
1989 "--owner=root:0" "--group=root:0")
1990 (delete-file-recursively ffmpeg))
1991 #t))
1992 (replace 'configure
1993 (lambda _
1994 ;; Copy-paste settings from the cmake build system.
1995 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1996 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
1997 #t))
1998 (replace 'build
1999 (lambda* (#:key inputs outputs #:allow-other-keys)
2000 (let* ((out (assoc-ref outputs "out"))
2001 (lib (string-append out "/lib"))
2002 (top (getcwd))
2003 (sdl (assoc-ref inputs "sdl"))
2004 (build_component
2005 (lambda* (component srcdir #:optional (args '()))
2006 (let ((builddir (string-append "build_" component)))
2007 (mkdir builddir)
2008 (with-directory-excursion builddir
2009 (apply invoke "cmake"
2010 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
2011 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
2012 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
2013 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
2014 "\"-Wl,-rpath=" lib "\"")
2015 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
2016 (string-append "-DSDL_INCLUDE_DIR="
2017 sdl "/include/SDL")
2018 (string-append "../" srcdir)
2019 "-DENABLE_QT5=True"
2020 args)
2021 (invoke "make" "-j"
2022 (number->string (parallel-job-count)))
2023 (invoke "make" "install"))))))
2024 (mkdir out)
2025 (build_component "core" "avidemux_core")
2026 (build_component "cli" "avidemux/cli")
2027 (build_component "qt4" "avidemux/qt4")
2028 (build_component "plugins_common" "avidemux_plugins"
2029 '("-DPLUGIN_UI=COMMON"))
2030 (build_component "plugins_cli" "avidemux_plugins"
2031 '("-DPLUGIN_UI=CLI"))
2032 (build_component "plugins_qt4" "avidemux_plugins"
2033 '("-DPLUGIN_UI=QT4"))
2034 (build_component "plugins_settings" "avidemux_plugins"
2035 '("-DPLUGIN_UI=SETTINGS"))
2036 ;; Remove .exe and .dll file.
2037 (delete-file-recursively
2038 (string-append out "/share/ADM6_addons"))
2039 #t)))
2040 (delete 'install)))))
2041 (home-page "http://fixounet.free.fr/avidemux/")
2042 (synopsis "Video editor")
2043 (description "Avidemux is a video editor designed for simple cutting,
2044 filtering and encoding tasks. It supports many file types, including AVI,
2045 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
2046 can be automated using projects, job queue and powerful scripting
2047 capabilities.")
2048 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
2049 ;; Software with various licenses is included, see License.txt.
2050 (license license:gpl2+)))
2051
2052 (define-public vapoursynth
2053 (package
2054 (name "vapoursynth")
2055 (version "37")
2056 (source (origin
2057 (method git-fetch)
2058 (uri (git-reference
2059 (url "https://github.com/vapoursynth/vapoursynth.git")
2060 (commit (string-append "R" version))))
2061 (file-name (git-file-name name version))
2062 (sha256
2063 (base32
2064 "1ma2s7dxk6y6l04qj1jvgwia4xj7999ny3a1yx2vbk5l83giam2p"))))
2065 (build-system gnu-build-system)
2066 (native-inputs
2067 `(("autoconf" ,autoconf)
2068 ("automake" ,automake)
2069 ("cython" ,python-cython)
2070 ("libtool" ,libtool)
2071 ("pkg-config" ,pkg-config)
2072 ("python" ,python)
2073 ("yasm" ,yasm)))
2074 (inputs
2075 `(("ffmpeg" ,ffmpeg)
2076 ("libass" ,libass)
2077 ("tesseract-ocr" ,tesseract-ocr)
2078 ("zimg" ,zimg)))
2079 (home-page "http://www.vapoursynth.com/")
2080 (synopsis "Video processing framework")
2081 (description "VapourSynth is a C++ library and Python module for video
2082 manipulation. It aims to be a modern rewrite of Avisynth, supporting
2083 multithreading, generalized colorspaces, per frame properties, and videos with
2084 format changes.")
2085 ;; src/core/cpufeatures only allows x86, ARM or PPC
2086 (supported-systems (fold delete %supported-systems
2087 '("mips64el-linux" "aarch64-linux")))
2088 ;; As seen from the source files.
2089 (license license:lgpl2.1+)))
2090
2091 (define-public xvid
2092 (package
2093 (name "xvid")
2094 (version "1.3.5")
2095 (source (origin
2096 (method url-fetch)
2097 (uri (string-append
2098 "http://downloads.xvid.org/downloads/xvidcore-"
2099 version ".tar.bz2"))
2100 (sha256
2101 (base32
2102 "1d0hy1w9sn6491a3vhyf3vmhq4xkn6yd4ralx1191s6qz5wz483w"))))
2103 (build-system gnu-build-system)
2104 (native-inputs `(("yasm" ,yasm)))
2105 (arguments
2106 '(#:phases
2107 (modify-phases %standard-phases
2108 (add-before
2109 'configure 'pre-configure
2110 (lambda _
2111 (chdir "build/generic")
2112 (substitute* "configure"
2113 (("#! /bin/sh") (string-append "#!" (which "sh"))))
2114 #t)))
2115 ;; No 'check' target.
2116 #:tests? #f))
2117 (home-page "https://www.xvid.com/")
2118 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
2119 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
2120 codec library. It uses ASP features such as b-frames, global and quarter
2121 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
2122 and custom quantization matrices.")
2123 (license license:gpl2+)))
2124
2125 (define-public streamlink
2126 (package
2127 (name "streamlink")
2128 (version "0.14.2")
2129 (source
2130 (origin
2131 (method url-fetch)
2132 (uri (pypi-uri "streamlink" version))
2133 (sha256
2134 (base32
2135 "0l2145fd60i76afjisfxd48cwhwyir07i7s3bnimdq5db2kzkix8"))
2136 (patches (search-patches "streamlink-update-test.patch"))))
2137 (build-system python-build-system)
2138 (home-page "https://github.com/streamlink/streamlink")
2139 (native-inputs
2140 `(("python-freezegun" ,python-freezegun)
2141 ("python-pytest" ,python-pytest)
2142 ("python-mock" ,python-mock)
2143 ("python-requests-mock" ,python-requests-mock)))
2144 (propagated-inputs
2145 `(("python-pysocks" ,python-pysocks)
2146 ("python-websocket-client" ,python-websocket-client)
2147 ("python-iso3166" ,python-iso3166)
2148 ("python-iso639" ,python-iso639)
2149 ("python-isodate" ,python-isodate)
2150 ("python-pycryptodome" ,python-pycryptodome)
2151 ("python-requests" ,python-requests)
2152 ("python-urllib3" ,python-urllib3)))
2153 (synopsis "Extract streams from various services")
2154 (description "Streamlink is command-line utility that extracts streams
2155 from sites like Twitch.tv and pipes them into a video player of choice.")
2156 (license license:bsd-2)))
2157
2158 (define-public livestreamer
2159 (deprecated-package "livestreamer" streamlink))
2160
2161 (define-public twitchy
2162 (let ((commit "9beb36d80b16662414129693e74fa3a2fd97554e")) ; 3.4 has no tag
2163 (package
2164 (name "twitchy")
2165 (version (git-version "3.4" "1" commit))
2166 (source
2167 (origin
2168 (method git-fetch)
2169 (uri (git-reference
2170 (url "https://github.com/BasioMeusPuga/twitchy.git")
2171 (commit commit)))
2172 (file-name (git-file-name name version))
2173 (sha256
2174 (base32
2175 "0di03h1j9ipp2bbnxxlxz07v87icyg2hmnsr4s7184z5ql8kpzr7"))))
2176 (build-system python-build-system)
2177 (arguments
2178 '(#:phases
2179 (modify-phases %standard-phases
2180 (add-after 'unpack 'patch-paths
2181 (lambda* (#:key inputs #:allow-other-keys)
2182 (substitute* "twitchy/twitchy_play.py"
2183 (("\"streamlink ")
2184 (string-append "\"" (assoc-ref inputs "streamlink")
2185 "/bin/streamlink ")))
2186 #t))
2187 (add-before 'check 'check-setup
2188 (lambda _
2189 (setenv "HOME" (getcwd)) ;Needs to write to ‘$HOME’.
2190 #t))
2191 (add-after 'install 'install-rofi-plugin
2192 (lambda* (#:key outputs #:allow-other-keys)
2193 (install-file "plugins/rofi-twitchy"
2194 (string-append (assoc-ref outputs "out")
2195 "/bin"))
2196 #t)))))
2197 (inputs
2198 `(("python-requests" ,python-requests)
2199 ("streamlink" ,streamlink)))
2200 (home-page "https://github.com/BasioMeusPuga/twitchy")
2201 (synopsis "Command-line interface for Twitch.tv")
2202 (description
2203 "This package provides a command-line interface for Twitch.tv")
2204 (license license:gpl3+))))
2205
2206 (define-public mlt
2207 (package
2208 (name "mlt")
2209 (version "6.16.0")
2210 (source (origin
2211 (method git-fetch)
2212 (uri (git-reference
2213 (url "https://github.com/mltframework/mlt.git")
2214 (commit (string-append "v" version))))
2215 (file-name (git-file-name name version))
2216 (sha256
2217 (base32
2218 "1362fv63p34kza9v4b71b6wakgvsa2vdx9y0g28x3yh4cp4k97kx"))))
2219 (build-system gnu-build-system)
2220 (arguments
2221 `(#:tests? #f ; no tests
2222 #:make-flags '("CC=gcc" "CXX=g++ -std=gnu++11")
2223 #:configure-flags
2224 (list "--enable-gpl3"
2225 "--enable-gpl")
2226 #:phases
2227 (modify-phases %standard-phases
2228 (add-after
2229 'configure 'override-LDFLAGS
2230 (lambda* (#:key outputs #:allow-other-keys)
2231 (substitute* "config.mak"
2232 (("LDFLAGS\\+=")
2233 (string-append "LDFLAGS+=-Wl,-rpath="
2234 (assoc-ref outputs "out")
2235 "/lib ")))
2236 #t)))))
2237 (inputs
2238 `(("alsa-lib" ,alsa-lib)
2239 ("ffmpeg" ,ffmpeg-3.4)
2240 ("fftw" ,fftw)
2241 ("frei0r-plugins" ,frei0r-plugins)
2242 ("gdk-pixbuf" ,gdk-pixbuf)
2243 ("gtk+" ,gtk+-2)
2244 ("libxml2" ,libxml2)
2245 ("jack" ,jack-1)
2246 ("ladspa" ,ladspa)
2247 ("libsamplerate" ,libsamplerate)
2248 ("pulseaudio" ,pulseaudio)
2249 ("qtbase" ,qtbase)
2250 ("qtsvg" ,qtsvg)
2251 ("sdl" ,sdl)
2252 ("sox" ,sox)))
2253 (native-inputs
2254 `(("pkg-config" ,pkg-config)))
2255 (home-page "https://www.mltframework.org/")
2256 (synopsis "Author, manage, and run multitrack audio/video compositions")
2257 (description
2258 "MLT is a multimedia framework, designed and developed for television
2259 broadcasting. It provides a toolkit for broadcasters, video editors, media
2260 players, transcoders, web streamers and many more types of applications. The
2261 functionality of the system is provided via an assortment of ready to use
2262 tools, XML authoring components, and an extensible plug-in based API.")
2263 (license license:gpl3)))
2264
2265 (define-public v4l-utils
2266 (package
2267 (name "v4l-utils")
2268 (version "1.16.6")
2269 (source (origin
2270 (method url-fetch)
2271 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
2272 "/v4l-utils-" version ".tar.bz2"))
2273 (sha256
2274 (base32
2275 "1bkqlrizx0j2rd6ybam2x17bjrpwzl4v4szmnzm3cmixis3w3npr"))))
2276 (build-system gnu-build-system)
2277 (arguments
2278 '(#:configure-flags
2279 (list (string-append "--with-udevdir="
2280 (assoc-ref %outputs "out")
2281 "/lib/udev")
2282 "CXXFLAGS=-std=gnu++11")))
2283 (native-inputs
2284 `(("perl" ,perl)
2285 ("pkg-config" ,pkg-config)))
2286 (inputs
2287 `(("alsa-lib" ,alsa-lib)
2288 ("glu" ,glu)
2289 ("libjpeg" ,libjpeg)
2290 ("libx11" ,libx11)
2291 ("qtbase" ,qtbase)
2292 ("eudev" ,eudev)))
2293 (synopsis "Realtime video capture utilities for Linux")
2294 (description "The v4l-utils provide a series of libraries and utilities to
2295 be used for realtime video capture via Linux-specific APIs.")
2296 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
2297 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
2298 (license (list license:lgpl2.1+ license:gpl2))))
2299
2300 (define-public obs
2301 (package
2302 (name "obs")
2303 (version "24.0.1")
2304 (source (origin
2305 (method git-fetch)
2306 (uri (git-reference
2307 (url "https://github.com/obsproject/obs-studio.git")
2308 (commit version)))
2309 (file-name (git-file-name name version))
2310 (sha256
2311 (base32
2312 "056s0hs1ds3c57sc0gy39dxaxvwlakl3w25jxgawh0fs99211ar5"))))
2313 (build-system cmake-build-system)
2314 (arguments
2315 `(#:tests? #f)) ; no tests
2316 (native-inputs
2317 `(("pkg-config" ,pkg-config)))
2318 (inputs
2319 `(("alsa-lib" ,alsa-lib)
2320 ("curl" ,curl)
2321 ("eudev" ,eudev)
2322 ("ffmpeg" ,ffmpeg)
2323 ("fontconfig" ,fontconfig)
2324 ("freetype" ,freetype)
2325 ("jack" ,jack-1)
2326 ("jansson" ,jansson)
2327 ("libx264" ,libx264)
2328 ("libxcomposite" ,libxcomposite)
2329 ("mesa" ,mesa)
2330 ("pulseaudio" ,pulseaudio)
2331 ("qtbase" ,qtbase)
2332 ("qtsvg" ,qtsvg)
2333 ("qtx11extras" ,qtx11extras)
2334 ("speex" ,speex)
2335 ("v4l-utils" ,v4l-utils)
2336 ("zlib" ,zlib)))
2337 (synopsis "Live streaming software")
2338 (description "Open Broadcaster Software provides a graphical interface for
2339 video recording and live streaming. OBS supports capturing audio and video
2340 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
2341 and JACK.")
2342 (home-page "https://obsproject.com")
2343 (supported-systems '("x86_64-linux" "i686-linux"))
2344 (license license:gpl2+)))
2345
2346 (define-public libvdpau
2347 (package
2348 (name "libvdpau")
2349 (version "1.2")
2350 (source
2351 (origin
2352 (method url-fetch)
2353 (uri (string-append "https://gitlab.freedesktop.org/vdpau/libvdpau"
2354 "/uploads/14b620084c027d546fa0b3f083b800c6/"
2355 "libvdpau-" version ".tar.bz2"))
2356 (sha256
2357 (base32
2358 "01ps6g6p6q7j2mjm9vn44pmzq3g75mm7mdgmnhb1qkjjdwc9njba"))))
2359 (build-system gnu-build-system)
2360 (native-inputs
2361 `(("pkg-config" ,pkg-config)))
2362 (inputs
2363 `(("libx11" ,libx11 "out")
2364 ("libxext" ,libxext)
2365 ("xorgproto" ,xorgproto)))
2366 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
2367 (synopsis "Video Decode and Presentation API")
2368 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
2369 provides an interface to video decode acceleration and presentation hardware
2370 present in modern GPUs.")
2371 (license (license:x11-style "file://COPYING"))))
2372
2373 (define-public vdpauinfo
2374 (package
2375 (name "vdpauinfo")
2376 (version "1.0")
2377 (source
2378 (origin
2379 (method url-fetch)
2380 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
2381 name "-" version ".tar.gz"))
2382 (sha256
2383 (base32
2384 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
2385 (build-system gnu-build-system)
2386 (native-inputs
2387 `(("pkg-config" ,pkg-config)
2388 ("libx11" ,libx11)))
2389 (propagated-inputs
2390 `(("libvdpau" ,libvdpau)))
2391 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
2392 (synopsis "Tool to query the capabilities of a VDPAU implementation")
2393 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
2394 implementation.")
2395 (license (license:x11-style "file://COPYING"))))
2396
2397 (define-public libvdpau-va-gl
2398 (package
2399 (name "libvdpau-va-gl")
2400 (version "0.4.2")
2401 (source
2402 (origin
2403 (method url-fetch)
2404 (uri (string-append "https://github.com/i-rinat/libvdpau-va-gl/"
2405 "releases/download/v" version "/libvdpau-va-gl-"
2406 version ".tar.gz"))
2407 (sha256
2408 (base32
2409 "1x2ag1f2fwa4yh1g5spv99w9x1m33hbxlqwyhm205ssq0ra234bx"))
2410 (patches (search-patches "libvdpau-va-gl-unbundle.patch"))
2411 (modules '((guix build utils)))
2412 (snippet '(begin (delete-file-recursively "3rdparty")
2413 #t))))
2414 (build-system cmake-build-system)
2415 (arguments
2416 '(#:tests? #f)) ; Tests require a running X11 server, with VA-API support.
2417 (native-inputs
2418 `(("libvdpau" ,libvdpau)
2419 ("pkg-config" ,pkg-config)))
2420 (inputs
2421 `(("libva" ,libva)
2422 ("mesa" ,mesa)))
2423 (home-page "https://github.com/i-rinat/libvdpau-va-gl")
2424 (synopsis "VDPAU driver with VA-API/OpenGL backend")
2425 (description
2426 "Many applications can use VDPAU to accelerate portions of the video
2427 decoding process and video post-processing to the GPU video hardware. Since
2428 there is no VDPAU available on Intel chips, they fall back to different drawing
2429 techniques. This driver uses OpenGL under the hood to accelerate drawing and
2430 scaling and VA-API (if available) to accelerate video decoding.")
2431 (license license:expat)))
2432
2433 (define-public recordmydesktop
2434 (package
2435 (name "recordmydesktop")
2436 (version "0.3.8.1")
2437 (source (origin
2438 (method url-fetch)
2439 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2440 version "/recordmydesktop-" version ".tar.gz"))
2441 (sha256
2442 (base32
2443 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
2444 (build-system gnu-build-system)
2445 (inputs `(("popt" ,popt)
2446 ("zlib" ,zlib)
2447 ("libx11" ,libx11)
2448 ("libice" ,libice)
2449 ("libsm" ,libsm)
2450 ("libxfixes" ,libxfixes)
2451 ("libxdamage" ,libxdamage)
2452 ("libxext" ,libxext)
2453 ("alsa-lib" ,alsa-lib)
2454 ("libvorbis" ,libvorbis)
2455 ("libtheora" ,libtheora)))
2456 (home-page "http://recordmydesktop.sourceforge.net/")
2457 (synopsis "Desktop session video recorder")
2458 (description
2459 "recordMyDesktop is a command-line tool that captures the activity in
2460 your graphical desktop and encodes it as a video. This is a useful tool for
2461 making @dfn{screencasts}.")
2462 (license license:gpl2+)))
2463
2464 (define-public simplescreenrecorder
2465 (package
2466 (name "simplescreenrecorder")
2467 (version "0.3.11")
2468 (source
2469 (origin
2470 (method git-fetch)
2471 (uri (git-reference
2472 (url "https://github.com/MaartenBaert/ssr.git")
2473 (commit version)))
2474 (file-name (git-file-name name version))
2475 (sha256
2476 (base32
2477 "0n702dnv4qshgn3b90ixvplfafjhgz6040yir5vy8khjdpciysq4"))))
2478 (build-system cmake-build-system)
2479 ;; Although libx11, libxfixes, libxext are listed as build dependencies in
2480 ;; README.md, the program builds and functions properly without them.
2481 ;; As a result, they are omitted. Please add them back if problems appear.
2482 (inputs
2483 `(("alsa-lib" ,alsa-lib)
2484 ("ffmpeg" ,ffmpeg)
2485 ("glu" ,glu)
2486 ("jack" ,jack-1)
2487 ("libxi" ,libxi)
2488 ("pulseaudio" ,pulseaudio)
2489 ("qtbase" ,qtbase)
2490 ("qtx11extras" ,qtx11extras)))
2491 (native-inputs `(("pkg-config" ,pkg-config)))
2492 (arguments
2493 `(#:configure-flags
2494 (list "-DWITH_QT5=TRUE")
2495 #:tests? #f)) ; no test suite
2496 ;; Using HTTPS causes part of the page to be displayed improperly.
2497 (home-page "http://www.maartenbaert.be/simplescreenrecorder/")
2498 (synopsis "Screen recorder")
2499 (description "SimpleScreenRecorder is an easy to use screen recorder with
2500 a graphical user interface. It supports recording the entire screen, or a
2501 part of it, and allows encoding in many different codecs and file formats.
2502 Other features include a live preview and live streaming.")
2503 (license (list license:gpl3+ ; most files
2504 license:zlib ; glinject/elfhacks.*
2505 license:isc ; glinject/*
2506 license:x11)))) ; build-aux/install-sh
2507
2508 (define-public libsmpeg
2509 (package
2510 (name "libsmpeg")
2511 (version "0.4.5-401")
2512 (source (origin
2513 (method svn-fetch)
2514 (uri (svn-reference
2515 (url "svn://svn.icculus.org/smpeg/trunk/")
2516 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
2517 (file-name (string-append name "-" version "-checkout"))
2518 (sha256
2519 (base32
2520 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
2521 (build-system gnu-build-system)
2522 (arguments
2523 ;; libsmpeg fails to build with -std=c++11, which is the default with
2524 ;; GCC 7. Also, 'configure' does CXXFLAGS=$CFLAGS, hence this hack.
2525 '(#:configure-flags '("CFLAGS=-O2 -g -std=c++03")))
2526 (native-inputs
2527 `(("autoconf" ,autoconf)
2528 ("automake" ,automake)))
2529 (inputs
2530 `(("sdl" ,sdl2)))
2531 (home-page "http://icculus.org/smpeg/")
2532 (synopsis "SDL MPEG decoding library")
2533 (description
2534 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
2535 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
2536 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
2537 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
2538 and MPEG system streams.")
2539 (license (list license:expat
2540 license:lgpl2.1
2541 license:lgpl2.1+
2542 license:gpl2))))
2543
2544 ;; for btanks
2545 (define-public libsmpeg-with-sdl1
2546 (package (inherit libsmpeg)
2547 (name "libsmpeg")
2548 (version "0.4.5-399")
2549 (source (origin
2550 (method svn-fetch)
2551 (uri (svn-reference
2552 (url "svn://svn.icculus.org/smpeg/trunk/")
2553 (revision 399))) ; tagged release 0.4.5
2554 (file-name (string-append name "-" version "-checkout"))
2555 (sha256
2556 (base32
2557 "0jfi085rf3fa5xsn0vd3nqf32my8ph9c6a9445y7a8lrlz4dms64"))))
2558 (inputs
2559 `(("sdl" ,sdl)))))
2560
2561 (define-public libbdplus
2562 (package
2563 (name "libbdplus")
2564 (version "0.1.2")
2565 (source
2566 (origin
2567 (method url-fetch)
2568 (uri (string-append "https://ftp.videolan.org/pub/videolan/libbdplus/"
2569 version "/" name "-" version ".tar.bz2"))
2570 (sha256
2571 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
2572 (inputs
2573 `(("libgcrypt" ,libgcrypt)))
2574 (build-system gnu-build-system)
2575 (home-page "https://www.videolan.org/developers/libbdplus.html")
2576 (synopsis "Library for decrypting certain Blu-Ray discs")
2577 (description "libbdplus is a library which implements the BD+ System
2578 specifications.")
2579 (license license:lgpl2.1+)))
2580
2581 (define-public libaacs
2582 (package
2583 (name "libaacs")
2584 (version "0.9.0")
2585 (source
2586 (origin
2587 (method url-fetch)
2588 (uri (string-append "https://ftp.videolan.org/pub/videolan/libaacs/"
2589 version "/" name "-" version ".tar.bz2"))
2590 (sha256
2591 (base32 "1kms92i0c7i1yl659kqjf19lm8172pnpik5lsxp19xphr74vvq27"))))
2592 (inputs
2593 `(("libgcrypt" ,libgcrypt)))
2594 (native-inputs
2595 `(("bison" ,bison)
2596 ("flex" ,flex)))
2597 (build-system gnu-build-system)
2598 (home-page "https://www.videolan.org/developers/libaacs.html")
2599 (synopsis "Library for decrypting certain Blu-Ray discs")
2600 (description "libaacs is a library which implements the Advanced Access
2601 Content System specification.")
2602 (license license:lgpl2.1+)))
2603
2604 (define-public mps-youtube
2605 (package
2606 (name "mps-youtube")
2607 (version "0.2.8")
2608 (source
2609 (origin
2610 (method git-fetch)
2611 (uri (git-reference
2612 (url "https://github.com/mps-youtube/mps-youtube.git")
2613 (commit (string-append "v" version))))
2614 (file-name (git-file-name name version))
2615 (sha256
2616 (base32
2617 "1w1jhw9rg3dx7vp97cwrk5fymipkcy2wrbl1jaa38ivcjhqg596y"))))
2618 (build-system python-build-system)
2619 (arguments
2620 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
2621 ;; test suite results differ depending on the country and also introduce
2622 ;; non-determinism in the tests.
2623 ;; https://github.com/mps-youtube/mps-youtube/issues/556
2624 `(#:tests? #f))
2625 (propagated-inputs
2626 `(("python-pafy" ,python-pafy)
2627 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
2628 (home-page "https://github.com/mps-youtube/mps-youtube")
2629 (synopsis "Terminal based YouTube player and downloader")
2630 (description
2631 "@code{mps-youtube} is based on mps, a terminal based program to
2632 search, stream and download music. This implementation uses YouTube as
2633 a source of content and can play and download video as well as audio.
2634 It can use either mpv or mplayer for playback, and for conversion of
2635 formats ffmpeg or libav is used. Users should install one of the
2636 supported players in addition to this package.")
2637 (license license:gpl3+)))
2638
2639 (define-public handbrake
2640 (package
2641 (name "handbrake")
2642 (version "1.2.2")
2643 (source (origin
2644 (method url-fetch)
2645 (uri (string-append "https://download.handbrake.fr/releases/"
2646 version "/HandBrake-" version "-source.tar.bz2"))
2647 (sha256
2648 (base32
2649 "0k2yaqy7zi06k8mkp9az2mn9dlgj3a1339vacakfh2nn2zsics6z"))
2650 (modules '((guix build utils)))
2651 (snippet
2652 ;; Remove "contrib" and source not necessary for
2653 ;; building/running under a GNU environment.
2654 '(begin
2655 (for-each delete-file-recursively
2656 '("contrib" "macosx" "win"))
2657 (substitute* "make/include/main.defs"
2658 ;; Disable unconditional inclusion of "contrib" libraries
2659 ;; (ffmpeg, libvpx, libdvdread, libdvdnav, and libbluray),
2660 ;; which would lead to fetching and building of these
2661 ;; libraries. Use our own instead.
2662 (("MODULES \\+= contrib") "# MODULES += contrib"))
2663 #t))
2664 (patches (search-patches "handbrake-opt-in-nvenc.patch"))))
2665 (build-system glib-or-gtk-build-system)
2666 (native-inputs
2667 `(("automake" ,automake) ;gui subpackage must be bootstrapped
2668 ("autoconf" ,autoconf)
2669 ("cmake" ,cmake-minimal) ;TODO: could probably strip check from make/configure.py
2670 ("curl" ,curl) ;not actually used, but tested for
2671 ("intltool" ,intltool)
2672 ("libtool" ,libtool)
2673 ("pkg-config" ,pkg-config)
2674 ("python" ,python-2))) ;for configuration
2675 (inputs
2676 `(("bzip2" ,bzip2)
2677 ("dbus-glib" ,dbus-glib)
2678 ("ffmpeg" ,ffmpeg)
2679 ("fontconfig" ,fontconfig)
2680 ("freetype" ,freetype)
2681 ("glib" ,glib)
2682 ("gstreamer" ,gstreamer)
2683 ("gst-plugins-base" ,gst-plugins-base)
2684 ("gtk+" ,gtk+)
2685 ("jansson" ,jansson)
2686 ("lame" ,lame)
2687 ("libass" ,libass)
2688 ("libbluray" ,libbluray)
2689 ("libdvdnav" ,libdvdnav)
2690 ("libdvdread" ,libdvdread)
2691 ("libgudev" ,libgudev)
2692 ("libmpeg2" ,libmpeg2)
2693 ("libnotify" ,libnotify)
2694 ("libogg" ,libogg)
2695 ("libopus" ,opus)
2696 ("libsamplerate" ,libsamplerate)
2697 ("libtheora" ,libtheora)
2698 ("libvorbis" ,libvorbis)
2699 ("libvpx" ,libvpx)
2700 ("libxml2" ,libxml2)
2701 ("libx264" ,libx264)
2702 ("speex" ,speex)
2703 ("x265" ,x265)
2704 ("zlib" ,zlib)))
2705 (arguments
2706 `(#:tests? #f ;tests require Ruby and claim to be unsupported
2707 #:configure-flags
2708 (list "--disable-gtk-update-checks"
2709 (string-append "CPPFLAGS=-I"
2710 (assoc-ref %build-inputs "libxml2")
2711 "/include/libxml2")
2712 "LDFLAGS=-lx265")
2713 #:phases
2714 (modify-phases %standard-phases
2715 (replace 'bootstrap
2716 ;; Run bootstrap ahead of time so that shebangs get patched.
2717 (lambda _
2718 (setenv "CONFIG_SHELL" (which "sh"))
2719 (setenv "NOCONFIGURE" "1")
2720 ;; Patch the Makefile so that it doesn't bootstrap again.
2721 (substitute* "gtk/module.rules"
2722 ((".*autogen\\.sh.*") ""))
2723 (invoke "sh" "./gtk/autogen.sh")))
2724 (replace 'configure
2725 (lambda* (#:key outputs configure-flags #:allow-other-keys)
2726 ;; 'configure' is not an autoconf-generated script, and
2727 ;; errors on unrecognized arguments,
2728 ;; e.g. --enable-fast-install
2729 (let ((out (assoc-ref outputs "out")))
2730 (apply invoke "./configure"
2731 (string-append "--prefix=" out)
2732 (or configure-flags '())))))
2733 (add-after 'configure 'chdir-build
2734 (lambda _ (chdir "./build") #t)))))
2735 (home-page "https://handbrake.fr")
2736 (synopsis "Video transcoder")
2737 (description
2738 "HandBrake is a tool for converting video from any format to a selection
2739 of modern, widely supported codecs.")
2740 ;; Some under GPLv2+, some under LGPLv2.1+, and portions under BSD3.
2741 ;; Combination under GPLv2. See LICENSE.
2742 (license license:gpl2)))
2743
2744 (define-public intel-vaapi-driver
2745 (package
2746 (name "intel-vaapi-driver")
2747 (version "2.3.0")
2748 (source
2749 (origin
2750 (method url-fetch)
2751 (uri (string-append "https://github.com/intel/intel-vaapi-driver/"
2752 "releases/download/" version "/intel-vaapi-driver-"
2753 version ".tar.bz2"))
2754 (sha256
2755 (base32 "1qyzxh3p8cw4fv8bz9zd4kc8hajlaps7xryzh6pad814n3m5sbjw"))))
2756 (build-system gnu-build-system)
2757 (native-inputs
2758 `(("pkg-config" ,pkg-config)))
2759 (inputs
2760 `(("libdrm" ,libdrm)
2761 ("libva" ,libva)
2762 ("libx11" ,libx11)))
2763 (arguments
2764 `(#:phases
2765 (modify-phases %standard-phases
2766 (add-before 'configure 'set-target-directory
2767 (lambda* (#:key outputs #:allow-other-keys)
2768 (let ((out (assoc-ref outputs "out")))
2769 (setenv "LIBVA_DRIVERS_PATH" (string-append out "/lib/dri"))
2770 #t))))))
2771 ;; XXX Because of <https://issues.guix.gnu.org/issue/22138>, we need to add
2772 ;; this to all VA-API back ends instead of once to libva.
2773 (native-search-paths
2774 (list (search-path-specification
2775 (variable "LIBVA_DRIVERS_PATH")
2776 (files '("lib/dri")))))
2777 (supported-systems '("i686-linux" "x86_64-linux"))
2778 (home-page "https://01.org/linuxmedia/vaapi")
2779 (synopsis "VA-API video acceleration driver for Intel GEN Graphics devices")
2780 (description
2781 "This is the @acronym{VA-API, Video Acceleration API} back end required for
2782 hardware-accelerated video processing on Intel GEN Graphics devices supported by
2783 the i915 driver, such as integrated Intel HD Graphics. It provides access to
2784 both hardware and shader functionality for faster encoding, decoding, and
2785 post-processing of video formats like MPEG2, H.264/AVC, and VC-1.")
2786 (license (list license:bsd-2 ; src/gen9_vp9_const_def.c
2787 license:expat)))) ; the rest, excluding the test suite
2788
2789 (define-public openh264
2790 (package
2791 (name "openh264")
2792 (version "2.0.0")
2793 (source (origin
2794 (method url-fetch)
2795 (uri (string-append "https://github.com/cisco/"
2796 name "/releases/download/v"
2797 version "/Source.Code.tar.gz"))
2798 (file-name (string-append name "-" version ".tar.gz"))
2799 (sha256
2800 (base32
2801 "0iq802xfsfkskg6q1j0kg90xh04vv1sxf61mrmahgynz5d7hx2ii"))))
2802 (build-system gnu-build-system)
2803 (native-inputs
2804 `(("nasm" ,nasm)
2805 ("python" ,python)))
2806 (arguments
2807 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2808 "CC=gcc")
2809 #:test-target "test"
2810 #:phases (modify-phases %standard-phases
2811 ;; no configure script
2812 (delete 'configure))))
2813 (home-page "http://www.openh264.org/")
2814 (synopsis "H264 decoder library")
2815 (description
2816 "Openh264 is a library which can decode H264 video streams.")
2817 (license license:bsd-2)))
2818
2819 (define-public libmp4v2
2820 (package
2821 (name "libmp4v2")
2822 (version "2.0.0")
2823 (source
2824 (origin
2825 (method url-fetch)
2826 ;; XXX: The new location of upstream is uncertain and will become relevant the
2827 ;; moment when the googlecode archive shuts down. It is past the date it
2828 ;; should've been turned off. I tried to communicate with upstream, but this
2829 ;; wasn't very responsive and not very helpful. The short summary is, it is
2830 ;; chaos when it comes to the amount of forks and only time will tell where
2831 ;; the new upstream location is.
2832 (uri (string-append "https://storage.googleapis.com/google-"
2833 "code-archive-downloads/v2/"
2834 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
2835 (file-name (string-append name "-" version ".tar.bz2"))
2836 (patches (search-patches "libmp4v2-c++11.patch"))
2837 (sha256
2838 (base32
2839 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
2840 (build-system gnu-build-system)
2841 (outputs '("out"
2842 "static")) ; 3.7MiB .a file
2843 (arguments
2844 `(#:phases
2845 (modify-phases %standard-phases
2846 (add-after 'unpack 'remove-dates
2847 (lambda _
2848 ;; Make the build reproducible.
2849 (substitute* "configure"
2850 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
2851 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
2852 #t))
2853 (add-after 'install 'move-static-libraries
2854 (lambda* (#:key outputs #:allow-other-keys)
2855 ;; Move static libraries to the "static" output.
2856 (let* ((out (assoc-ref outputs "out"))
2857 (lib (string-append out "/lib"))
2858 (static (assoc-ref outputs "static"))
2859 (slib (string-append static "/lib")))
2860 (mkdir-p slib)
2861 (for-each (lambda (file)
2862 (install-file file slib)
2863 (delete-file file))
2864 (find-files lib "\\.a$"))
2865 #t))))))
2866 (native-inputs
2867 `(("help2man" ,help2man)
2868 ("dejagnu" ,dejagnu)))
2869 (home-page "https://code.google.com/archive/p/mp4v2/")
2870 (synopsis "API to create and modify mp4 files")
2871 (description
2872 "The MP4v2 library provides an API to create and modify mp4 files as defined by
2873 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
2874 file format that has been used as a multimedia file format in a variety of platforms and
2875 applications. It is a very powerful and extensible format that can accommodate
2876 practically any type of media.")
2877 (license license:mpl1.1)))
2878
2879 (define-public libmediainfo
2880 (package
2881 (name "libmediainfo")
2882 (version "0.7.95")
2883 (source (origin
2884 (method url-fetch)
2885 (uri (string-append "https://mediaarea.net/download/source/"
2886 name "/" version"/"
2887 name "_" version ".tar.bz2"))
2888 (sha256
2889 (base32
2890 "1kchh6285b07z5nixv619hc9gml2ysdayicdiv30frrlqiyxqw4b"))))
2891 ;; TODO add a Big Buck Bunny webm for tests.
2892 (native-inputs
2893 `(("autoconf" ,autoconf)
2894 ("automake" ,automake)
2895 ("libtool" ,libtool)
2896 ("pkg-config" ,pkg-config)
2897 ("zlib" ,zlib)
2898 ("tinyxml2" ,tinyxml2)
2899 ("curl" ,curl)
2900 ("libzen" ,libzen)))
2901 (build-system gnu-build-system)
2902 (arguments
2903 '(#:tests? #f ; see above TODO
2904 #:phases
2905 ;; build scripts not in root of archive
2906 (modify-phases %standard-phases
2907 (add-after 'unpack 'change-to-build-dir
2908 (lambda _
2909 (chdir "Project/GNU/Library")
2910 #t)))))
2911 (home-page "https://mediaarea.net/en/MediaInfo")
2912 (synopsis "Library for retrieving media metadata")
2913 (description "MediaInfo is a library used for retrieving technical
2914 information and other metadata about audio or video files. A non-exhaustive
2915 list of the information MediaInfo can retrieve from media files include:
2916
2917 @itemize
2918 @item General: title, author, director, album, track number, date, duration...
2919 @item Video: codec, aspect, fps, bitrate...
2920 @item Audio: codec, sample rate, channels, language, bitrate...
2921 @item Text: language of subtitle
2922 @item Chapters: number of chapters, list of chapters
2923 @end itemize
2924
2925 MediaInfo supports the following formats:
2926
2927 @itemize
2928 @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
2929 MPEG-2, MPEG-4, DVD (VOB)...
2930 @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
2931 @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
2932 @item Subtitles: SRT, SSA, ASS, SAMI...
2933 @end itemize\n")
2934 (license license:bsd-2)))
2935
2936 ;; TODO also have a GUI version available
2937 (define-public mediainfo
2938 (package
2939 (name "mediainfo")
2940 (version "18.12")
2941 (source (origin
2942 (method url-fetch)
2943 ;; Warning: This source has proved unreliable 1 time at least.
2944 ;; Consider an alternate source or report upstream if this
2945 ;; happens again.
2946 (uri (string-append "https://mediaarea.net/download/source/"
2947 name "/" version "/"
2948 name "_" version ".tar.bz2"))
2949 (sha256
2950 (base32
2951 "1ix95ilcjlawcq6phh25cgplm3riqa2ii7ql82g8yagqs4ldqp6a"))))
2952 (native-inputs
2953 `(("autoconf" ,autoconf)
2954 ("automake" ,automake)
2955 ("libtool" ,libtool)
2956 ("pkg-config" ,pkg-config)
2957 ("zlib" ,zlib)
2958 ("libmediainfo" ,libmediainfo)
2959 ("libzen" ,libzen)))
2960 (build-system gnu-build-system)
2961 (arguments
2962 '(#:tests? #f ; lacks tests
2963 #:phases
2964 ;; build scripts not in root of archive
2965 (modify-phases %standard-phases
2966 (add-after 'unpack 'change-to-build-dir
2967 (lambda _
2968 (chdir "Project/GNU/CLI")
2969 #t)))))
2970 (home-page "https://mediaarea.net/en/MediaInfo")
2971 (synopsis "Utility for reading media metadata")
2972 (description "MediaInfo is a utility used for retrieving technical
2973 information and other metadata about audio or video files. It supports the
2974 many codecs and formats supported by libmediainfo.")
2975 (license license:bsd-2)))
2976
2977 (define-public livemedia-utils
2978 (package
2979 (name "livemedia-utils")
2980 (version "2019.05.29")
2981 (source (origin
2982 (method url-fetch)
2983 (uri (string-append
2984 "https://download.videolan.org/contrib/live555/live."
2985 version ".tar.gz"))
2986 (sha256
2987 (base32
2988 "08i63jr8ihn1xiq5z5n3yls3yz6li5sg0s454l56p5bcvbrw81my"))))
2989 (build-system gnu-build-system)
2990 (arguments
2991 '(#:tests? #f ; no tests
2992 #:make-flags (list "CC=gcc"
2993 (string-append "LDFLAGS=-Wl,-rpath="
2994 (assoc-ref %outputs "out") "/lib")
2995 (string-append "PREFIX="
2996 (assoc-ref %outputs "out")))
2997 #:phases (modify-phases %standard-phases
2998 (add-before 'configure 'fix-makefiles-generation
2999 (lambda _
3000 (substitute* "genMakefiles"
3001 (("/bin/rm") "rm"))
3002 #t))
3003 (replace 'configure
3004 (lambda _
3005 (invoke "./genMakefiles"
3006 "linux-with-shared-libraries"))))))
3007 (home-page "http://www.live555.com/liveMedia/")
3008 (synopsis "Set of C++ libraries for multimedia streaming")
3009 (description "This code forms a set of C++ libraries for multimedia
3010 streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). The libraries
3011 can be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or
3012 JPEG video, and several audio codecs. They can easily be extended to support
3013 additional (audio and/or video) codecs, and can also be used to build basic
3014 RTSP or SIP clients and servers.")
3015 (license license:lgpl3+)))
3016
3017 (define-public libdvbpsi
3018 (package
3019 (name "libdvbpsi")
3020 (version "1.3.2")
3021 (source (origin
3022 (method url-fetch)
3023 (uri (string-append
3024 "https://download.videolan.org/pub/libdvbpsi/"
3025 version "/libdvbpsi-" version ".tar.bz2"))
3026 (sha256
3027 (base32
3028 "1zn5hfv4qbahmydbwh59a3b480s3m5ss27r6ml35gqdip7r3jkmc"))))
3029 (build-system gnu-build-system)
3030 (home-page "https://www.videolan.org/developers/libdvbpsi.html")
3031 (synopsis "Library for decoding and generation of MPEG TS and DVB PSI
3032 tables")
3033 (description "libdvbpsi is a simple library designed for decoding and
3034 generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818s
3035 and ITU-T H.222.0.")
3036 (license license:lgpl2.1)))
3037
3038 (define-public ffms2
3039 (package
3040 (name "ffms2")
3041 (version "2.23")
3042 (home-page "https://github.com/FFMS/ffms2")
3043 (source (origin
3044 (method git-fetch)
3045 (uri (git-reference
3046 (url "https://github.com/FFMS/ffms2.git")
3047 (commit version)))
3048 (file-name (git-file-name name version))
3049 (sha256
3050 (base32
3051 "0dkz5b3gxq5p4xz0qqg6l2sigszrlsinz3skyf0ln4wf3zrvf8m5"))))
3052 (build-system gnu-build-system)
3053 (arguments
3054 '(#:configure-flags
3055 (list "--enable-avresample")))
3056 (inputs
3057 `(("zlib" ,zlib)))
3058 (propagated-inputs
3059 `(("ffmpeg" ,ffmpeg)))
3060 (native-inputs
3061 `(("pkg-config" ,pkg-config)))
3062 (synopsis "Cross-platform wrapper around ffmpeg/libav")
3063 (description
3064 "FFMpegSource is a wrapper library around ffmpeg/libav that allows
3065 programmers to access a standard API to open and decompress media files.")
3066 ;; sources are distributed under a different license that the binary.
3067 ;; see https://github.com/FFMS/ffms2/blob/master/COPYING
3068 (license license:gpl2+))); inherits from ffmpeg
3069
3070 (define-public aegisub
3071 (package
3072 (name "aegisub")
3073 (version "3.2.2")
3074 (source (origin
3075 (method url-fetch)
3076 (uri (string-append
3077 "http://ftp.aegisub.org/pub/archives/releases/source/"
3078 name "-" version ".tar.xz"))
3079 (sha256
3080 (base32
3081 "11b83qazc8h0iidyj1rprnnjdivj1lpphvpa08y53n42bfa36pn5"))
3082 (patches (search-patches "aegisub-icu59-include-unistr.patch"
3083 "aegisub-boost68.patch"))))
3084 (build-system gnu-build-system)
3085 (arguments
3086 `(#:configure-flags
3087 (list "--disable-update-checker"
3088 "--without-portaudio"
3089 "--without-openal"
3090 "--without-oss"
3091 "CXXFLAGS=-DU_USING_ICU_NAMESPACE=1")
3092 ;; tests require busted, a lua package we don't have yet
3093 #:tests? #f
3094 #:phases
3095 (modify-phases %standard-phases
3096 (add-before 'configure 'fix-ldflags
3097 (lambda _
3098 (setenv "LDFLAGS" "-pthread")
3099 #t))
3100 (add-after 'unpack 'fix-boost-headers
3101 (lambda _
3102 (substitute*
3103 '("src/subtitles_provider_libass.cpp"
3104 "src/colour_button.cpp"
3105 "src/video_provider_dummy.cpp"
3106 "./src/video_frame.cpp")
3107 (("#include <boost/gil/gil_all.hpp>")
3108 "#include <boost/gil.hpp>"))
3109 #t)))))
3110 (inputs
3111 `(("boost" ,boost)
3112 ("desktop-file-utils" ,desktop-file-utils)
3113 ("ffms2" ,ffms2)
3114 ("fftw" ,fftw)
3115 ("hunspell" ,hunspell)
3116 ("mesa" ,mesa)
3117 ("libass" ,libass)
3118 ("alsa-lib" ,alsa-lib)
3119 ("pulseaudio" ,pulseaudio)
3120 ("libx11" ,libx11)
3121 ("freetype" ,freetype)
3122 ("wxwidgets-gtk2" ,wxwidgets-gtk2)))
3123 (native-inputs
3124 `(("intltool" ,intltool)
3125 ("pkg-config" ,pkg-config)))
3126 (home-page "http://www.aegisub.org/")
3127 (synopsis "Subtitle engine")
3128 (description
3129 "Aegisub is a tool for creating and modifying subtitles. Aegisub makes
3130 it quick and easy to time subtitles to audio, and features many powerful
3131 tools for styling them, including a built-in real-time video preview.")
3132 (license (list license:bsd-3 ; the package is licensed under the bsd-3, except
3133 license:mpl1.1 ; for vendor/universalchardet under the mpl1.1
3134 license:expat)))) ; and src/gl that is under a license similar
3135 ; the the Expat license, with a rewording (Software -> Materials). (called MIT
3136 ; by upstream). See https://github.com/Aegisub/Aegisub/blob/master/LICENCE
3137 ; src/MatroskaParser.(c|h) is under bsd-3 with permission from the author
3138
3139 (define-public gst-transcoder
3140 (package
3141 (name "gst-transcoder")
3142 (version "1.12.2")
3143 (source
3144 (origin
3145 (method git-fetch)
3146 (uri (git-reference
3147 (url "https://github.com/pitivi/gst-transcoder.git")
3148 (commit version)))
3149 (file-name (git-file-name name version))
3150 (sha256
3151 (base32
3152 "0nw1zykqc6c8xs3ri55pm00pwyz93z4y4nd880apfiwj7yv5p3az"))))
3153 (build-system meson-build-system)
3154 (inputs
3155 `(("gobject-introspection" ,gobject-introspection)
3156 ("glib" ,glib)
3157 ("gstreamer" ,gstreamer)
3158 ("gst-plugins-base" ,gst-plugins-base)))
3159 (native-inputs
3160 `(("python" ,python)
3161 ("pkg-config" ,pkg-config)))
3162 (home-page "https://github.com/pitivi/gst-transcoder/")
3163 (synopsis "GStreamer Transcoding API")
3164 (description "GStreamer Transcoding API")
3165 (license license:lgpl2.1)))
3166
3167 (define-public gavl
3168 (package
3169 (name "gavl")
3170 (version "1.4.0")
3171 (source
3172 (origin
3173 (method url-fetch)
3174 (uri (string-append "mirror://sourceforge/gmerlin/"
3175 name "/" version "/"
3176 name "-" version ".tar.gz"))
3177 (file-name (string-append name "-" version ".tar.gz"))
3178 (sha256
3179 (base32
3180 "1kikkn971a14zzm7svi7190ldc14fjai0xyhpbcmp48s750sraji"))))
3181 (build-system gnu-build-system)
3182 (arguments
3183 '(#:configure-flags '("LIBS=-lm")))
3184 (native-inputs
3185 `(("pkg-config" ,pkg-config)
3186 ("doxygen" ,doxygen)))
3187 (home-page "http://gmerlin.sourceforge.net")
3188 (synopsis "Low level library for multimedia API building")
3189 (description
3190 "Gavl is short for Gmerlin Audio Video Library. It is a low level
3191 library, upon which multimedia APIs can be built. Gavl handles all the
3192 details of audio and video formats like colorspaces, sample rates,
3193 multichannel configurations, etc. It provides standardized definitions for
3194 those formats as well as container structures for carrying audio samples or
3195 video images inside an application.
3196
3197 In addition, it handles the sometimes ugly task of converting between all
3198 these formats and provides some elementary operations (copying, scaling,
3199 alpha blending etc).")
3200 (license license:gpl3)))
3201
3202 (define-public frei0r-plugins
3203 (package
3204 (name "frei0r-plugins")
3205 (version "1.6.1")
3206 (source
3207 (origin
3208 (method url-fetch)
3209 (uri (string-append "https://files.dyne.org/frei0r/"
3210 "frei0r-plugins-" version ".tar.gz"))
3211 (sha256
3212 (base32
3213 "0pji26fpd0dqrx1akyhqi6729s394irl73dacnyxk58ijqq4dhp0"))))
3214 (build-system gnu-build-system)
3215 (arguments
3216 `(#:phases
3217 (modify-phases %standard-phases
3218 (add-after 'unpack 'autotools
3219 (lambda _
3220 (invoke "sh" "autogen.sh"))))))
3221 ;; TODO: opencv for additional face detection filters.
3222 (inputs
3223 `(("gavl" ,gavl)
3224 ("cairo" ,cairo)))
3225 (native-inputs
3226 `(("pkg-config" ,pkg-config)
3227 ("libtool" ,libtool)
3228 ("automake" ,automake)
3229 ("autoconf" ,autoconf)))
3230 (home-page "https://www.dyne.org/software/frei0r/")
3231 (synopsis "Minimalistic plugin API for video effects")
3232 (description
3233 "Frei0r is a minimalistic plugin API for video effects.
3234 The main emphasis is on simplicity for an API that will round up
3235 the most common video effects into simple filters, sources and
3236 mixers that can be controlled by parameters. Frei0r wants to
3237 provide a way to share these simple effects between many
3238 applications, avoiding their reimplementation by different projects.
3239 It counts more than 100 plugins.")
3240 (license (list license:gpl2+
3241 ;; The following files are licensed as LGPL2.1+:
3242 ;; src/generator/ising0r/ising0r.c
3243 ;; src/generator/onecol0r/onecol0r.cpp
3244 ;; src/generator/nois0r/nois0r.cpp
3245 ;; src/generator/lissajous0r/lissajous0r.cpp
3246 ;; src/filter/ndvi/gradientlut.hpp
3247 ;; src/filter/ndvi/ndvi.cpp
3248 ;; src/filter/facedetect/facedetect.cpp
3249 license:lgpl2.1+))))
3250
3251 (define-public motion
3252 (package
3253 (name "motion")
3254 (version "4.2.2")
3255 (home-page "https://motion-project.github.io/")
3256 (source (origin
3257 (method git-fetch)
3258 (uri (git-reference
3259 (url "https://github.com/Motion-Project/motion.git")
3260 (commit (string-append "release-" version))))
3261 (sha256
3262 (base32
3263 "05c1gx75xy2hw49x6vkydvwxbr80kipsc3nr906k3hq8735svx6f"))
3264 (file-name (git-file-name name version))))
3265 (build-system gnu-build-system)
3266 (native-inputs
3267 `(("autoconf" ,autoconf-wrapper)
3268 ("automake" ,automake)
3269 ("gettext" ,gettext-minimal)
3270 ("pkg-config" ,pkg-config)))
3271 (inputs
3272 `(("libjpeg" ,libjpeg)
3273 ("ffmpeg" ,ffmpeg-3.4)
3274 ("libmicrohttpd" ,libmicrohttpd)
3275 ("sqlite" ,sqlite)))
3276 (arguments
3277 '(#:phases (modify-phases %standard-phases
3278 (replace 'bootstrap
3279 (lambda _
3280 (patch-shebang "version.sh")
3281 (invoke "autoreconf" "-vfi"))))
3282 #:configure-flags '("--sysconfdir=/etc")
3283 #:make-flags (list (string-append "sysconfdir="
3284 (assoc-ref %outputs "out")
3285 "/etc"))
3286
3287 #:tests? #f)) ; no 'check' target
3288 (synopsis "Detect motion from video signals")
3289 (description
3290 "Motion is a program that monitors the video signal from one or more
3291 cameras and is able to detect if a significant part of the picture has
3292 changed. Or in other words, it can detect motion.")
3293
3294 ;; Some files say "version 2" and others "version 2 or later".
3295 (license license:gpl2)))
3296
3297 (define-public subdl
3298 (let ((commit "4cf5789b11f0ff3f863b704b336190bf968cd471")
3299 (revision "1"))
3300 (package
3301 (name "subdl")
3302 (version (git-version "1.0.3" revision commit))
3303 (source (origin
3304 (method git-fetch)
3305 (uri (git-reference
3306 (url "https://github.com/alexanderwink/subdl.git")
3307 (commit commit)))
3308 (file-name (git-file-name name version))
3309 (sha256
3310 (base32
3311 "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8"))))
3312 (build-system trivial-build-system)
3313 (arguments
3314 `(#:modules ((guix build utils))
3315 #:builder (begin
3316 (use-modules (guix build utils))
3317 (let* ((out (assoc-ref %outputs "out"))
3318 (bin (string-append out "/bin"))
3319 (source (assoc-ref %build-inputs "source"))
3320 (python (assoc-ref %build-inputs "python")))
3321 (install-file (string-append source "/subdl") bin)
3322 (patch-shebang (string-append bin "/subdl")
3323 (list (string-append python "/bin")))))))
3324 (inputs `(("python" ,python)))
3325 (synopsis "Command-line tool for downloading subtitles from opensubtitles.org")
3326 (description "Subdl is a command-line tool for downloading subtitles from
3327 opensubtitles.org. By default, it will search for English subtitles, display
3328 the results, download the highest-rated result in the requested language and
3329 save it to the appropriate filename.")
3330 (license license:gpl3+)
3331 (home-page "https://github.com/alexanderwink/subdl"))))
3332
3333 (define-public l-smash
3334 (package
3335 (name "l-smash")
3336 (version "2.14.5")
3337 (source (origin
3338 (method git-fetch)
3339 (uri (git-reference
3340 (url "https://github.com/l-smash/l-smash.git")
3341 (commit (string-append "v" version))))
3342 (file-name (git-file-name name version))
3343 (sha256
3344 (base32
3345 "0rcq9727im6kd8da8b7kzzbzxdldvmh5nsljj9pvr4m3lj484b02"))))
3346 (build-system gnu-build-system)
3347 (arguments
3348 `(#:tests? #f ;no tests
3349 #:make-flags
3350 (list (string-append "LDFLAGS=-Wl,-L.,-rpath="
3351 (assoc-ref %outputs "out") "/lib"))
3352 #:phases
3353 (modify-phases %standard-phases
3354 ;; configure fails if it is followed by CONFIG_SHELL
3355 (replace 'configure
3356 (lambda* (#:key outputs #:allow-other-keys)
3357 (let ((out (assoc-ref outputs "out")))
3358 (invoke "./configure" (string-append "--prefix=" out)
3359 "--disable-static")))))))
3360 (native-inputs
3361 `(("which" ,which)))
3362 (home-page "https://l-smash.github.io/l-smash/")
3363 (synopsis "MP4 multiplexer and demultiplexer library")
3364 (description
3365 "L-SMASH is a cross-platform library that handles the ISO base media file
3366 format and some of its derived file formats, including MP4. It operates as a
3367 multiplexer and demultiplexer, and can mux video and audio in several formats
3368 using standalone executable files.")
3369 (license license:isc)))
3370
3371 (define-public qtfaststart
3372 (package
3373 (name "qtfaststart")
3374 (version "1.8")
3375 (source (origin
3376 (method url-fetch)
3377 (uri (pypi-uri "qtfaststart" version))
3378 (sha256
3379 (base32
3380 "0hcjfik8hhb1syqvyh5c6aillpvzal26nkjflcq1270z64aj6i5h"))))
3381 (build-system python-build-system)
3382 (arguments
3383 '(#:tests? #f)) ; no test suite
3384 (synopsis "Move QuickTime and MP4 metadata to the beginning of the file")
3385 (description "qtfaststart enables streaming and pseudo-streaming of
3386 QuickTime and MP4 files by moving metadata and offset information to the
3387 beginning of the file. It can also print some useful information about the
3388 structure of the file. This program is based on qt-faststart.c from the FFmpeg
3389 project, which is released into the public domain, as well as ISO 14496-12:2005
3390 (the official spec for MP4), which can be obtained from the ISO or found
3391 online.")
3392 (home-page "https://github.com/danielgtaylor/qtfaststart")
3393 (license license:expat)))
3394
3395 (define-public vidstab
3396 (let ((commit "aeabc8daa7904f9edf7441a11f293965a5ef53b8")
3397 (revision "0"))
3398 (package
3399 (name "vidstab")
3400 (version (git-version "1.1.0" revision commit))
3401 (source (origin
3402 (method git-fetch)
3403 (uri (git-reference
3404 (url "https://github.com/georgmartius/vid.stab.git")
3405 (commit commit)))
3406 (file-name (git-file-name name version))
3407 (sha256
3408 (base32
3409 "042iy0f3khwzr68djzvqgn301sy21ljvkf52rnc2c73q7ircnzzn"))))
3410 (build-system cmake-build-system)
3411 (arguments
3412 '(#:tests? #f)) ; tests are not run as part of standard build process
3413 (home-page "http://public.hronopik.de/vid.stab/")
3414 (synopsis "Video stabilization library")
3415 (description "Vidstab is a video stabilization library which can be used
3416 with FFmpeg. A video acquired using a hand-held camera or a camera mounted on a
3417 vehicle typically suffers from undesirable shakes and jitters. Activities such
3418 as surfing, skiing, riding and walking while shooting videos are especially
3419 prone to erratic camera shakes. Vidstab targets these video contents to help
3420 create smoother and stable videos.")
3421 (license license:gpl2+))))
3422
3423 (define-public libopenshot
3424 (package
3425 (name "libopenshot")
3426 (version "0.2.3")
3427 (source (origin
3428 (method git-fetch)
3429 (uri (git-reference
3430 (url "https://github.com/OpenShot/libopenshot")
3431 (commit (string-append "v" version))))
3432 (file-name (git-file-name name version))
3433 (sha256
3434 (base32
3435 "0r1qmr8ar5n72603xkj9h065vbpznrqsq88kxxmn9n8djyyvk03k"))
3436 (modules '((guix build utils)))
3437 (snippet '(begin
3438 ;; Allow overriding of the python installation dir
3439 (substitute* "src/bindings/python/CMakeLists.txt"
3440 (("(SET\\(PYTHON_MODULE_PATH.*)\\)" _ set)
3441 (string-append set " CACHE PATH "
3442 "\"Python bindings directory\")")))
3443 (delete-file-recursively "thirdparty")
3444 #t))))
3445 (build-system cmake-build-system)
3446 (native-inputs
3447 `(("pkg-config" ,pkg-config)
3448 ("python" ,python)
3449 ("swig" ,swig)
3450 ("unittest++" ,unittest-cpp)))
3451 (propagated-inputs ;all referenced in installed headers
3452 `(("cppzmq" ,cppzmq)
3453 ("ffmpeg" ,ffmpeg)
3454 ("imagemagick" ,imagemagick)
3455 ("jsoncpp" ,jsoncpp)
3456 ("libopenshot-audio" ,libopenshot-audio)
3457 ("qtbase" ,qtbase)
3458 ("qtmultimedia" ,qtmultimedia)
3459 ("zeromq" ,zeromq)))
3460 (arguments
3461 `(#:configure-flags
3462 (list (string-append "-DPYTHON_MODULE_PATH:PATH=" %output "/lib/python"
3463 ,(version-major+minor (package-version python))
3464 "/site-packages")
3465 "-DUSE_SYSTEM_JSONCPP:BOOL=ON")
3466 #:phases
3467 (modify-phases %standard-phases
3468 (add-before 'configure 'set-vars
3469 (lambda* (#:key inputs #:allow-other-keys)
3470 (setenv "LIBOPENSHOT_AUDIO_DIR"
3471 (assoc-ref inputs "libopenshot-audio"))
3472 (setenv "ZMQDIR"
3473 (assoc-ref inputs "zeromq"))
3474 (setenv "UNITTEST_DIR"
3475 (string-append (assoc-ref inputs "unittest++")
3476 "/include/UnitTest++"))
3477 #t)))))
3478 (home-page "https://openshot.org")
3479 (synopsis "Video-editing, animation, and playback library")
3480 (description "OpenShot Library (libopenshot) is a powerful C++ video
3481 editing library with a multi-threaded and feature rich video editing
3482 API. It includes bindings for Python, Ruby, and other languages.")
3483 (license license:lgpl3+)))
3484
3485 (define-public openshot
3486 (package
3487 (name "openshot")
3488 (version "2.4.4")
3489 (source (origin
3490 (method git-fetch)
3491 (uri (git-reference
3492 (url "https://github.com/OpenShot/openshot-qt")
3493 (commit (string-append "v" version))))
3494 (file-name (git-file-name name version))
3495 (sha256
3496 (base32
3497 "0mg63v36h7l8kv2sgf6x8c1n3ygddkqqwlciz7ccxpbm4x1idqba"))
3498 (modules '((guix build utils)))
3499 (snippet
3500 '(begin
3501 (delete-file-recursively "src/images/fonts") #t))))
3502 (build-system python-build-system)
3503 (inputs
3504 `(("ffmpeg" ,ffmpeg)
3505 ("font-ubuntu" ,font-ubuntu)
3506 ("libopenshot" ,libopenshot)
3507 ("python" ,python)
3508 ("python-pyqt" ,python-pyqt)
3509 ("python-pyzmq" ,python-pyzmq)
3510 ("python-requests" ,python-requests)
3511 ("qtsvg" ,qtsvg)))
3512 (arguments
3513 `(#:tests? #f ;no tests
3514 #:modules ((guix build python-build-system)
3515 (guix build qt-utils)
3516 (guix build utils))
3517 #:imported-modules (,@%python-build-system-modules
3518 (guix build qt-utils))
3519 #:phases (modify-phases %standard-phases
3520 (delete 'build) ;install phase does all the work
3521 (add-after 'unpack 'patch-font-location
3522 (lambda* (#:key inputs #:allow-other-keys)
3523 (let ((font (assoc-ref inputs "font-ubuntu")))
3524 (substitute* "src/classes/app.py"
3525 (("info.IMAGES_PATH") (string-append "\"" font "\""))
3526 (("fonts") "share/fonts/truetype")))
3527 #t))
3528 (add-before 'install 'set-tmp-home
3529 (lambda _
3530 ;; src/classes/info.py "needs" to create several
3531 ;; directories in $HOME when loaded during build
3532 (setenv "HOME" "/tmp")
3533 #t))
3534 (add-after 'install 'wrap-program
3535 (lambda* (#:key outputs #:allow-other-keys)
3536 (let ((out (assoc-ref outputs "out")))
3537 (wrap-qt-program out "openshot-qt"))
3538 #t)))))
3539 (home-page "https://openshot.org")
3540 (synopsis "Video editor")
3541 (description "OpenShot takes your videos, photos, and music files and
3542 helps you create the film you have always dreamed of. Easily add sub-titles,
3543 transitions, and effects and then export your film to many common formats.")
3544 (license license:gpl3+)))
3545
3546 (define-public dav1d
3547 (package
3548 (name "dav1d")
3549 (version "0.5.0")
3550 (source
3551 (origin
3552 (method url-fetch)
3553 (uri (string-append "https://downloads.videolan.org/pub/videolan"
3554 "/dav1d/" version "/dav1d-" version ".tar.xz"))
3555 (sha256
3556 (base32
3557 "1586k439fm8db9lsxxywm34iqibj5mw4xrppr4g2wqr0hjlhcbxn"))))
3558 (build-system meson-build-system)
3559 (native-inputs `(("nasm" ,nasm)))
3560 (home-page "https://code.videolan.org/videolan/dav1d")
3561 (synopsis "AV1 decoder")
3562 (description "dav1d is a new AV1 cross-platform decoder, and focused on
3563 speed and correctness.")
3564 (license license:bsd-2)))
3565
3566 (define-public wlstream
3567 (let ((commit "182076a94562b128c3a97ecc53cc68905ea86838")
3568 (revision "1"))
3569 (package
3570 (name "wlstream")
3571 (version (git-version "0.0" revision commit))
3572 (source
3573 (origin
3574 (method git-fetch)
3575 (uri (git-reference
3576 (url "https://github.com/atomnuker/wlstream.git")
3577 (commit commit)))
3578 (file-name (git-file-name name version))
3579 (sha256
3580 (base32
3581 "01qbcgfl3g9kfwn1jf1z9pdj3bvf5lmg71d1vwkcllc2az24bjqp"))))
3582 (build-system meson-build-system)
3583 (native-inputs `(("libdrm" ,libdrm)
3584 ("pkg-config" ,pkg-config)))
3585 (inputs `(("ffmpeg" ,ffmpeg)
3586 ("pulseaudio" ,pulseaudio)
3587 ("wayland" ,wayland)
3588 ("wayland-protocols" ,wayland-protocols)))
3589 (home-page "https://github.com/atomnuker/wlstream")
3590 (synopsis "Screen capture tool for Wayland sessions")
3591 (description "Wlstream is a screen capture tool for recording audio and
3592 video from a Wayland session.")
3593 (license license:lgpl2.1+))))
3594
3595 (define-public gaupol
3596 (package
3597 (name "gaupol")
3598 (version "1.6")
3599 (source (origin
3600 (method git-fetch)
3601 (uri (git-reference
3602 (url "https://github.com/otsaloma/gaupol/")
3603 (commit version)))
3604 (file-name (git-file-name name version))
3605 (sha256
3606 (base32
3607 "164wlxxjiqvkzbqjzvqvz2zkn0kgqmhn52294xx4vc9b9ngdnn0m"))))
3608 (build-system python-build-system)
3609 (native-inputs
3610 `(("gettext" ,gettext-minimal)
3611 ("pkg-config" ,pkg-config)))
3612 (inputs
3613 `(("python-pygobject" ,python-pygobject)
3614 ("gtk+" ,gtk+)
3615 ("python-pycairo" ,python-pycairo) ; Required or else clicking on a subtitle line fails.
3616 ("python-chardet" ,python-chardet) ; Optional: Character encoding detection.
3617 ("gtkspell3" ,gtkspell3) ; Optional: Inline spell-checking.
3618 ("iso-codes" ,iso-codes) ; Optional: Translations.
3619 ("gstreamer" ,gstreamer)
3620 ("gst-libav" ,gst-libav)
3621 ("gst-plugins-base" ,gst-plugins-base)
3622 ("gst-plugins-good" ,gst-plugins-good)
3623 ("gst-plugins-bad" ,gst-plugins-bad)
3624 ("gst-plugins-ugly" ,gst-plugins-ugly)))
3625 (arguments
3626 `(#:tests? #f ; Tests seem to require networking.
3627 #:phases
3628 (modify-phases %standard-phases
3629 ;; gaupol's setup.py script does not support one of the Python build
3630 ;; system's default flags, "--single-version-externally-managed".
3631 (replace 'install
3632 (lambda* (#:key outputs #:allow-other-keys)
3633 (invoke "python" "setup.py" "install"
3634 (string-append "--prefix=" (assoc-ref outputs "out"))
3635 "--root=/")))
3636 (add-after 'install 'wrap-gaupol
3637 (lambda* (#:key outputs #:allow-other-keys)
3638 (let ((out (assoc-ref outputs "out"))
3639 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
3640 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
3641 (wrap-program (string-append out "/bin/gaupol")
3642 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
3643 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
3644 #t))
3645 (add-after 'unpack 'patch-data-dir
3646 ;; Fix some path variables that setup.py seems to garble.
3647 (lambda* (#:key outputs #:allow-other-keys)
3648 (let ((out (assoc-ref outputs "out")))
3649 (substitute* "setup.py"
3650 (("DATA_DIR = \\{!r\\}\"\\.format\\(data_dir\\)")
3651 (string-append "DATA_DIR = '" out "/share/gaupol'\""))
3652 (("LOCALE_DIR = \\{!r\\}\"\\.format\\(locale_dir\\)")
3653 (string-append "LOCALE_DIR = '" out "/share/locale'\"")))
3654 #t))))))
3655 (synopsis "Editor for text-based subtitles")
3656 (description
3657 "Gaupol supports multiple subtitle file formats and provides means of
3658 creating subtitles, editing texts and timing subtitles to match video. The
3659 user interface features a builtin video player and is designed with attention
3660 to convenience of translating and batch processing of multiple documents.")
3661 (home-page "https://otsaloma.io/gaupol/")
3662 (license license:gpl3+)))