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