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