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