c394c654424d0f188ab4c338e31242a8b610e8df
[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, 2020 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2015, 2016 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2015, 2018, 2019, 2020, 2021 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, 2017 Nikita <nikita@n0.is>
14 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
15 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
16 ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
17 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
18 ;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
19 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
20 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
21 ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
22 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
23 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
24 ;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
25 ;;; Copyright © 2018-2022 Marius Bakke <marius@gnu.org>
26 ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
27 ;;; Copyright © 2018, 2019, 2020, 2022 Leo Famulari <leo@famulari.name>
28 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
29 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
30 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
31 ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
32 ;;; Copyright © 2018 Gábor Boskovit <boskovits@gmail.com>
33 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
34 ;;; Copyright © 2019 Timo Eisenmann <eisenmann@fn.de>
35 ;;; Copyright © 2019 Arne Babenhauserheide <arne_bab@web.de>
36 ;;; Copyright © 2019 Riku Viitanen <riku.viitanen@protonmail.com>
37 ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
38 ;;; Copyright © 2020 Josh Holland <josh@inv.alid.pw>
39 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
41 ;;; Copyright © 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
42 ;;; Copyright © 2020 Alex McGrath <amk@amk.ie>
43 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
44 ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
45 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
46 ;;; Copyright © 2020 Alexandru-Sergiu Marton <brown121407@posteo.ro>
47 ;;; Copyright © 2020 Ivan Kozlov <kanichos@yandex.ru>
48 ;;; Copyright © 2020 Antoine Côté <antoine.cote@posteo.net>
49 ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
50 ;;; Copyright © 2021 Alexey Abramov <levenson@mmer.org>
51 ;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
52 ;;; Copyright © 2021 David Wilson <david@daviwil.com>
53 ;;; Copyright © 2021,2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
54 ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
55 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
56 ;;; Copyright © 2021 Thiago Jung Bauermann <bauermann@kolabnow.com>
57 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
58 ;;; Copyright © 2021 Robin Templeton <robin@terpri.org>
59 ;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
60 ;;; Copyright © 2021 Pradana Aumars <paumars@courrier.dev>
61 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
62 ;;; Copyright © 2022 Bird <birdsite@airmail.cc>
63 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
64 ;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com>
65 ;;;
66 ;;; This file is part of GNU Guix.
67 ;;;
68 ;;; GNU Guix is free software; you can redistribute it and/or modify it
69 ;;; under the terms of the GNU General Public License as published by
70 ;;; the Free Software Foundation; either version 3 of the License, or (at
71 ;;; your option) any later version.
72 ;;;
73 ;;; GNU Guix is distributed in the hope that it will be useful, but
74 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
75 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76 ;;; GNU General Public License for more details.
77 ;;;
78 ;;; You should have received a copy of the GNU General Public License
79 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
80
81 (define-module (gnu packages video)
82 #:use-module (ice-9 match)
83 #:use-module ((srfi srfi-1) #:hide (zip))
84 #:use-module (srfi srfi-26)
85 #:use-module ((guix licenses) #:prefix license:)
86 #:use-module (guix utils)
87 #:use-module (guix packages)
88 #:use-module (guix download)
89 #:use-module (guix gexp)
90 #:use-module (guix git-download)
91 #:use-module (guix svn-download)
92 #:use-module (guix hg-download)
93 #:use-module (guix build-system cargo)
94 #:use-module (guix build-system cmake)
95 #:use-module (guix build-system copy)
96 #:use-module (guix build-system gnu)
97 #:use-module (guix build-system glib-or-gtk)
98 #:use-module (guix build-system meson)
99 #:use-module (guix build-system perl)
100 #:use-module (guix build-system python)
101 #:use-module (guix build-system qt)
102 #:use-module (guix build-system waf)
103 #:use-module (guix build-system trivial)
104 #:use-module (gnu packages)
105 #:use-module (gnu packages algebra)
106 #:use-module (gnu packages assembly)
107 #:use-module (gnu packages audio)
108 #:use-module (gnu packages autotools)
109 #:use-module (gnu packages avahi)
110 #:use-module (gnu packages backup)
111 #:use-module (gnu packages base)
112 #:use-module (gnu packages bash)
113 #:use-module (gnu packages bison)
114 #:use-module (gnu packages boost)
115 #:use-module (gnu packages build-tools)
116 #:use-module (gnu packages cdrom)
117 #:use-module (gnu packages check)
118 #:use-module (gnu packages cmake)
119 #:use-module (gnu packages compression)
120 #:use-module (gnu packages cpp)
121 #:use-module (gnu packages crates-io)
122 #:use-module (gnu packages crates-graphics)
123 #:use-module (gnu packages curl)
124 #:use-module (gnu packages dbm)
125 #:use-module (gnu packages dejagnu)
126 #:use-module (gnu packages dns)
127 #:use-module (gnu packages docbook)
128 #:use-module (gnu packages documentation)
129 #:use-module (gnu packages elf)
130 #:use-module (gnu packages file)
131 #:use-module (gnu packages flex)
132 #:use-module (gnu packages fonts)
133 #:use-module (gnu packages fontutils)
134 #:use-module (gnu packages freedesktop)
135 #:use-module (gnu packages fribidi)
136 #:use-module (gnu packages gettext)
137 #:use-module (gnu packages ghostscript)
138 #:use-module (gnu packages gl)
139 #:use-module (gnu packages glib)
140 #:use-module (gnu packages guile)
141 #:use-module (gnu packages gnome)
142 #:use-module (gnu packages gnunet)
143 #:use-module (gnu packages gnupg)
144 #:use-module (gnu packages gstreamer)
145 #:use-module (gnu packages gtk)
146 #:use-module (gnu packages haskell-xyz)
147 #:use-module (gnu packages image)
148 #:use-module (gnu packages imagemagick)
149 #:use-module (gnu packages iso-codes)
150 #:use-module (gnu packages libidn)
151 #:use-module (gnu packages libreoffice)
152 #:use-module (gnu packages libusb)
153 #:use-module (gnu packages linux)
154 #:use-module (gnu packages llvm)
155 #:use-module (gnu packages lua)
156 #:use-module (gnu packages m4)
157 #:use-module (gnu packages man)
158 #:use-module (gnu packages markup)
159 #:use-module (gnu packages maths)
160 #:use-module (gnu packages music)
161 #:use-module (gnu packages mp3)
162 #:use-module (gnu packages ncurses)
163 #:use-module (gnu packages networking)
164 #:use-module (gnu packages ocr)
165 #:use-module (gnu packages pcre)
166 #:use-module (gnu packages pciutils)
167 #:use-module (gnu packages perl)
168 #:use-module (gnu packages perl-check)
169 #:use-module (gnu packages perl-web)
170 #:use-module (gnu packages photo)
171 #:use-module (gnu packages pkg-config)
172 #:use-module (gnu packages popt)
173 #:use-module (gnu packages pretty-print)
174 #:use-module (gnu packages protobuf)
175 #:use-module (gnu packages pulseaudio)
176 #:use-module (gnu packages python)
177 #:use-module (gnu packages python-crypto)
178 #:use-module (gnu packages python-web)
179 #:use-module (gnu packages python-xyz)
180 #:use-module (gnu packages qt)
181 #:use-module (gnu packages rdesktop)
182 #:use-module (gnu packages re2c)
183 #:use-module (gnu packages ruby)
184 #:use-module (gnu packages rust-apps)
185 #:use-module (gnu packages samba)
186 #:use-module (gnu packages sdl)
187 #:use-module (gnu packages serialization)
188 #:use-module (gnu packages shells)
189 #:use-module (gnu packages sqlite)
190 #:use-module (gnu packages ssh)
191 #:use-module (gnu packages swig)
192 #:use-module (gnu packages texinfo)
193 #:use-module (gnu packages textutils)
194 #:use-module (gnu packages tls)
195 #:use-module (gnu packages time)
196 #:use-module (gnu packages upnp)
197 #:use-module (gnu packages vulkan)
198 #:use-module (gnu packages web)
199 #:use-module (gnu packages webkit)
200 #:use-module (gnu packages wget)
201 #:use-module (gnu packages wxwidgets)
202 #:use-module (gnu packages xdisorg)
203 #:use-module (gnu packages xiph)
204 #:use-module (gnu packages xml)
205 #:use-module (gnu packages xorg))
206
207 (define-public transcode
208 (package
209 (name "transcode")
210 (version "1.1.7")
211 (source
212 (origin
213 (method url-fetch)
214 (uri
215 (string-append "https://sources.archlinux.org/other/community/"
216 name "/" name "-" version ".tar.bz2"))
217 (sha256
218 (base32 "14ha9xjsjrj131f35jd56z5v1jb4rbsrj1nril5shqnxw3c74khy"))
219 (patches
220 (search-patches "transcode-ffmpeg.patch"))))
221 (build-system gnu-build-system)
222 (arguments
223 `(#:configure-flags
224 (list
225 "CFLAGS=-O2 -g -fcommon"
226 ;; XXX: Broken API.
227 ;; Undeclared variables 'sys_nerr' and 'sys_errlist'.
228 ;; "--enable-libv4l2"
229 "--enable-libmpeg2"
230 "--enable-libmpeg2convert"
231 ;; XXX: Broken API.
232 ;; Undeclared variables 'sys_nerr' and 'sys_errlist'.
233 ;; "--enable-v4l"
234 ;;; XXX: Not available.
235 ;"--enable-bktr"
236 ;"--enable-sunau"
237 "--enable-oss"
238 "--enable-alsa"
239 ;;; XXX: Not available.
240 ;"--enable-libpostproc"
241 "--enable-freetype2"
242 "--enable-xvid"
243 "--enable-x264"
244 "--enable-ogg"
245 "--enable-vorbis"
246 "--enable-theora"
247 ;;; XXX: Not available.
248 ;"--enable-pvm3"
249 "--enable-libdv"
250 "--enable-libquicktime"
251 "--enable-lzo"
252 "--enable-a52"
253 "--enable-libxml2"
254 ;;; XXX: Not available.
255 ;"--enable-ibp"
256 ;;"--enable-mjpegtools"
257 "--enable-sdl"
258 "--enable-imagemagick"
259 ;;; XXX: Not available.
260 ;"--enable-libjpegmmx"
261 "--enable-libjpeg")))
262 ;;; XXX: Not available.
263 ;"--enable-bsdav"
264 ;"--enable-pv3"
265 ;"--enable-nuv"
266 (native-inputs
267 (list autoconf
268 automake
269 libtool
270 libxml2
271 perl
272 pkg-config
273 python-wrapper))
274 (inputs
275 (list alsa-lib
276 ffmpeg
277 freetype
278 imagemagick
279 lame
280 liba52
281 libdv
282 libdvdread
283 libjpeg-turbo
284 libmpeg2
285 libogg
286 libquicktime
287 libtheora
288 libvorbis
289 lzo
290 mjpegtools
291 sdl
292 ;; ("v4l-utils" ,v4l-utils)
293 libx11
294 libx264
295 libxaw
296 libxext
297 libxpm
298 libxv
299 xvid
300 zlib))
301 (synopsis "Audio/Video Transcoder")
302 (description "Transcode is a fast, versatile and command-line based
303 audio/video everything to everything converter primarily focused on producing
304 AVI video files with MP3 audio, but also including a program to read all the
305 video and audio streams from a DVD.")
306 (home-page
307 "http://linuxfromscratch.org/blfs/view/svn/multimedia/transcode.html")
308 (license license:gpl2+)))
309
310 (define-public svt-hevc
311 (package
312 (name "svt-hevc")
313 (version "1.5.1")
314 (source
315 (origin
316 (method git-fetch)
317 (uri
318 (git-reference
319 (url "https://github.com/OpenVisualCloud/SVT-HEVC")
320 (commit (string-append "v" version))))
321 (file-name (git-file-name name version))
322 (sha256
323 (base32 "1cv6vcf5yxcwdvj5yqcckbixqrvvdxk7ibincnnv80pz6wh527sv"))))
324 (build-system cmake-build-system)
325 (arguments
326 `(#:tests? #f)) ; Test script is stand-alone
327 (native-inputs
328 (list yasm))
329 (synopsis "SVT HEVC encoder")
330 (description "Scalable Video Technology (SVT) is a software-based video
331 coding technology that is highly optimized for Intel's Xeon processors. Using
332 the SVT-HEVC encoder, it is possible to spread video encoding processing across
333 multiple Intel's Xeon processors to achieve a real advantage of processing
334 efficiency.")
335 (home-page "https://01.org/svt")
336 ;; Specifically targets x86_64 Intel hardware.
337 (supported-systems '("x86_64-linux"))
338 (license (license:non-copyleft "file:///LICENSE.md"))))
339
340 (define-public mediasdk
341 (package
342 (name "mediasdk")
343 (version "22.4.4")
344 (source
345 (origin
346 (method git-fetch)
347 (uri
348 (git-reference
349 (url "https://github.com/Intel-Media-SDK/MediaSDK")
350 (commit (string-append "intel-" name "-" version))))
351 (file-name (git-file-name name version))
352 (sha256
353 (base32 "18mrqringyv1drswm4m8ppw7sks6x4jzp6s0ag0h9hrpd15kn5rx"))))
354 (build-system cmake-build-system)
355 (arguments
356 (list
357 #:configure-flags
358 #~(list
359 "-DENABLE_X11=ON"
360 "-DENABLE_X11_DRI3=ON"
361 "-DENABLE_WAYLAND=ON"
362 "-DENABLE_TEXTLOG=ON"
363 "-DENABLE_STAT=ON"
364 "-DBUILD_TESTS=ON"
365 "-DBUILD_TOOLS=ON"
366 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
367 #$output "/lib"))
368 #:phases
369 #~(modify-phases %standard-phases
370 (add-after 'unpack 'do-not-embed-kernel-version
371 (lambda _
372 (substitute* "builder/FindGlobals.cmake"
373 (("set\\([[:blank:]]+?BUILD_INFO \"\\$\\{CMAKE_SYSTEM\\}\
374 \\$\\{CMAKE_SYSTEM_VERSION\\}")
375 "set( BUILD_INFO \"Linux")))))))
376 (native-inputs
377 (list pkg-config python-wrapper))
378 (inputs
379 (list libdrm libva libpciaccess wayland libx11))
380 (synopsis "Intel Media SDK")
381 (description "MediaSDK provides a plain C API to access hardware-accelerated
382 video decode, encode and filtering on Intel's Gen graphics hardware platforms.")
383 (home-page "http://mediasdk.intel.com/")
384 (supported-systems '("x86_64-linux" "i686-linux"))
385 (license (license:non-copyleft "file:///LICENSE"))))
386
387 (define-public schroedinger
388 (package
389 (name "schroedinger")
390 (version "1.0.11")
391 (source
392 (origin
393 (method url-fetch)
394 (uri
395 (string-append "https://launchpad.net/" name "/trunk/" version
396 "/+download/" name "-" version ".tar.gz"))
397 (sha256
398 (base32 "04prr667l4sn4zx256v1z36a0nnkxfdqyln48rbwlamr6l3jlmqy"))))
399 (build-system gnu-build-system)
400 (outputs '("out" "doc"))
401 (arguments
402 `(#:phases
403 (modify-phases %standard-phases
404 (add-after 'install 'move-docs
405 (lambda* (#:key outputs #:allow-other-keys)
406 (let* ((out (assoc-ref outputs "out"))
407 (doc (assoc-ref outputs "doc")))
408 (mkdir-p (string-append doc "/share"))
409 (rename-file
410 (string-append out "/share/gtk-doc")
411 (string-append doc "/share/gtk-doc"))
412 #t))))))
413 (native-inputs
414 (list dash gtk-doc/stable pkg-config))
415 (inputs
416 `(("glew" ,glew)
417 ("opengl" ,mesa)))
418 (propagated-inputs
419 (list orc))
420 (synopsis "Dirac video codec")
421 (description "Schroedinger is a project implementing the Dirac video codec in
422 ANSI C code. It is meant to be highly optimized and portable. It is developed
423 as a joint effort between the BBC and Fluendo.")
424 (home-page "https://launchpad.net/schroedinger")
425 (license
426 ;; This library is licensed under 4 different licenses,
427 ;; and you can choose to use it under the terms of any one of them.
428 (list
429 license:gpl2+
430 license:lgpl2.0+
431 license:expat
432 license:mpl1.1))))
433
434 (define-public libquicktime
435 (package
436 (name "libquicktime")
437 (version "1.2.4")
438 (source
439 (origin
440 (method url-fetch)
441 (uri
442 (string-append "https://sourceforge.net/projects/" name "/files/"
443 name "/" version "/" name "-" version ".tar.gz"))
444 (sha256
445 (base32 "0s3kshzl3zfjw3phzv73r91fkr9z8q8kc3dhsys4f4xk6ff3alqw"))
446 (patches
447 (search-patches "libquicktime-ffmpeg.patch"))))
448 (build-system gnu-build-system)
449 (native-inputs
450 (list gettext-minimal doxygen pkg-config))
451 (inputs
452 (list alsa-lib
453 ffmpeg
454 gtk+-2
455 lame
456 libdv
457 libjpeg-turbo
458 libpng
459 libvorbis
460 mesa
461 schroedinger
462 libx11
463 libx264
464 libxaw
465 libxv))
466 (synopsis "Quick Time Library")
467 (description "The goal of this project is to enhance the quicktime4linux
468 library.")
469 (home-page "http://libquicktime.sourceforge.net/")
470 (license license:lgpl2.1+)))
471
472 (define-public mjpg-streamer
473 (package
474 (name "mjpg-streamer")
475 (version "1.0.0")
476 (source (origin
477 (method git-fetch)
478 (uri (git-reference
479 (url "https://github.com/jacksonliam/mjpg-streamer")
480 (commit (string-append "v" version))))
481 (file-name (git-file-name name version))
482 (sha256
483 (base32
484 "0w81pg228154blzbzr590xwhcll9baxyqxl6wxrgqsi9cd7pzq23"))
485 (modules '((guix build utils)))
486 (snippet
487 '(begin
488 (with-directory-excursion "mjpg-streamer-experimental/www"
489 (for-each delete-file-recursively
490 '("cambozola.jar"
491 "JQuerySpinBtn.css"
492 "JQuerySpinBtn.js"
493 "jquery.js"
494 "jquery.rotate.js"
495 "jquery.ui.core.min.js"
496 "jquery.ui.custom.css"
497 "jquery.ui.tabs.min.js"
498 "jquery.ui.widget.min.js")))))))
499 (build-system cmake-build-system)
500 (arguments
501 '(#:tests? #f ; no test suite
502 #:phases
503 (modify-phases %standard-phases
504 (add-after 'unpack 'chdir
505 (lambda* _
506 (chdir "mjpg-streamer-experimental"))))))
507 (inputs (list libjpeg-turbo))
508 (synopsis "Stream JPEG over IP network")
509 (description "Command line application that copies JPEG frames from one or
510 more input plugins to multiple output plugins. It can be used to stream JPEG
511 files over an IP-based network from a webcam to various types of viewers such
512 as Chrome, Firefox, Cambozola, VLC, mplayer, and other software capable of
513 receiving MJPG streams.")
514 (home-page "https://github.com/jacksonliam/mjpg-streamer")
515 (license license:gpl2+)))
516
517 (define-public mjpegtools
518 (package
519 (name "mjpegtools")
520 (version "2.2.1")
521 (source
522 (origin
523 (method url-fetch)
524 (uri
525 (string-append "https://sourceforge.net/projects/mjpeg/files/"
526 name "/" version "/" name "-" version ".tar.gz"))
527 (sha256
528 (base32 "16pl22ra3x2mkp8p3awslhlhj46b1nq9g89301gb0q4rgmnm705i"))))
529 (build-system gnu-build-system)
530 (inputs
531 (list gtk+-2 libdv libjpeg-turbo libpng libquicktime sdl))
532 (native-inputs
533 (list pkg-config))
534 (synopsis "Tools for handling MPEG")
535 (description "Mjpeg tools is a suite of programs which support video capture,
536 editing, playback, and compression to MPEG of MJPEG video. Edit, play and
537 compression software is hardware independent.")
538 (home-page "http://mjpeg.sourceforge.net/")
539 (license license:gpl2+)))
540
541 (define-public libmms
542 (package
543 (name "libmms")
544 (version "0.6.4")
545 (source
546 (origin
547 (method url-fetch)
548 (uri
549 (string-append "https://sourceforge.net/projects/" name "/files/"
550 name "/" version "/" name "-" version ".tar.gz"))
551 (sha256
552 (base32 "0kvhxr5hkabj9v7ah2rzkbirndfqdijd9hp8v52c1z6bxddf019w"))))
553 (build-system gnu-build-system)
554 (synopsis "MMS stream protocol library")
555 (description "Libmms is a library for streaming media files using the mmst
556 and mmsh protocols.")
557 (home-page "https://sourceforge.net/projects/libmms/")
558 (license license:lgpl2.1+)))
559
560 (define-public libvideogfx
561 (package
562 (name "libvideogfx")
563 (version "1.0.9")
564 (source
565 (origin
566 (method git-fetch)
567 (uri
568 (git-reference
569 (url "https://github.com/farindk/libvideogfx")
570 (commit (string-append "v" version))))
571 (file-name (git-file-name name version))
572 (sha256
573 (base32 "154b0j8cfg879pg08xcbwvbz8z9nrfnyj31i48vxir1psas70ynq"))))
574 (build-system gnu-build-system)
575 (arguments
576 `(#:phases
577 (modify-phases %standard-phases
578 (add-after 'unpack 'fix-build-errors
579 (lambda _
580 (substitute* "libvideogfx/graphics/fileio/ffmpeg.cc"
581 (("av_close_input_file\\(")
582 "avformat_close_input(&"))
583 (substitute* "libvideogfx/graphics/fileio/png.cc"
584 (("is != NULL") "is.good()"))
585 #t)))))
586 (native-inputs
587 (list autoconf automake libtool pkg-config))
588 (inputs
589 `(("ffmpeg" ,ffmpeg-2.8)
590 ("jpeg" ,libjpeg-turbo)
591 ("png" ,libpng)
592 ("x11" ,libx11)
593 ("xext" ,libxext)))
594 (synopsis "Video processing library")
595 (description "LibVideoGfx is a C++ library for low-level video processing.
596 It aims at speeding up the development process for image and video processing
597 applications by providing high-level classes for commonly required tasks.")
598 (home-page "https://dirk-farin.net/software/libvideogfx/index.html")
599 (license license:lgpl2.1+)))
600
601 (define-public libde265
602 (package
603 (name "libde265")
604 (version "1.0.8")
605 (source
606 (origin
607 (method git-fetch)
608 (uri
609 (git-reference
610 (url "https://github.com/strukturag/libde265")
611 (commit (string-append "v" version))))
612 (file-name (git-file-name name version))
613 (sha256
614 (base32 "1dzflqbk248lz5ws0ni5acmf32b3rmnq5gsfaz7691qqjxkl1zml"))))
615 (build-system gnu-build-system)
616 (arguments
617 `(#:configure-flags
618 (list "--disable-static")))
619 (native-inputs
620 `(("autoconf" ,autoconf)
621 ("automake" ,automake)
622 ("libtool" ,libtool)
623 ("pkg-config" ,pkg-config)
624 ("python" ,python-wrapper)))
625 (inputs
626 `(;; XXX: Build fails with libvideogfx.
627 ;; ("libvideogfx" ,libvideogfx)
628 ("qt" ,qtbase-5)
629 ("sdl" ,sdl)))
630 (synopsis "H.265 video codec implementation")
631 (description "Libde265 is an implementation of the h.265 video codec. It is
632 written from scratch and has a plain C API to enable a simple integration into
633 other software.")
634 (home-page "https://www.libde265.org/")
635 (license
636 (list
637 ;; Applications.
638 license:expat
639 ;; Library.
640 license:lgpl3+))))
641
642 (define-public tslib
643 (package
644 (name "tslib")
645 (version "1.22")
646 (source
647 (origin
648 (method git-fetch)
649 (uri
650 (git-reference
651 (url "https://github.com/libts/tslib")
652 (commit version)))
653 (file-name (git-file-name name version))
654 (sha256
655 (base32 "197p6vy539wvfrv23agbvmay4rjya1jnisi46llm0nx4cvqh48by"))))
656 (build-system gnu-build-system)
657 (arguments
658 `(#:test-target "tests"
659 #:configure-flags
660 (list "--with-sdl2")))
661 (native-inputs
662 (list autoconf automake libtool pkg-config))
663 (inputs
664 `(("sdl2" ,sdl2)))
665 (synopsis "Touchscreen access library")
666 (description "TSLib is a cross-platform library that provides access to
667 touchscreen devices and the ability to apply filters to their input events.")
668 (home-page "http://www.tslib.org/")
669 (license license:lgpl2.1+)))
670
671 (define-public libmpeg3
672 (package
673 (name "libmpeg3")
674 (version "1.8")
675 (source
676 (origin
677 (method url-fetch)
678 (uri
679 (string-append "https://sourceforge.net/projects/heroines/files/"
680 "releases/081108/" name "-" version "-src.tar.bz2"))
681 (sha256
682 (base32 "1i53vv0wm5qfwgg1z7j9g14s6c7gxxkiy4vbdkq3lijjyyz50vv5"))))
683 (build-system gnu-build-system)
684 (arguments
685 `(#:test-target "test"
686 #:make-flags
687 (list
688 (string-append "A52DIR=" (assoc-ref %build-inputs "liba52"))
689 (string-append "DST=" (assoc-ref %outputs "out") "/bin"))
690 #:phases
691 (modify-phases %standard-phases
692 (add-after 'unpack 'delete-bundled-a52dec
693 (lambda _
694 (delete-file-recursively "a52dec-0.7.3")
695 (substitute* "Makefile"
696 (("include Makefile\\.a52")
697 "")
698 (("\\(A52DIR\\)/include")
699 "(A52DIR)/include/a52dec")
700 (("LIBS = " match)
701 (string-append match "-la52 ")))))
702 (add-after 'unpack 'preseed-cflags
703 (lambda _
704 (setenv "CFLAGS"
705 (string-append "-D_FILE_OFFSET_BITS=64 "
706 "-D_LARGEFILE_SOURCE "
707 "-D_LARGEFILE64_SOURCE"))))
708 (add-before 'install 'create-destination-directory
709 (lambda* (#:key outputs #:allow-other-keys)
710 (let* ((out (string-append (assoc-ref outputs "out"))))
711 (mkdir-p (string-append out "/bin"))))))))
712 (native-inputs
713 (list nasm))
714 (inputs
715 (list liba52))
716 (synopsis "Advanced MPEG editing and manipulation library")
717 (description "Libmpeg3 decodes MP2, MP3, AC3, MPEG-1 video, MPEG-2 video,
718 and DVD footage in a single library. It supports many esoteric features like
719 parallel video decoding, frame-accurate editing, YUV 4:2:2, and ATSC transport
720 stream decoding")
721 (home-page "http://heroinewarrior.com/libmpeg3.php")
722 (license license:gpl2+)))
723
724 (define-public aalib
725 (package
726 (name "aalib")
727 (version "1.4rc5")
728 (source (origin
729 (method url-fetch)
730 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
731 version "/" name "-" version ".tar.gz"))
732 (sha256
733 (base32
734 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
735 (build-system gnu-build-system)
736 (native-inputs
737 `(("config" ,config)
738 ("makeinfo" ,texinfo)))
739 (inputs
740 (list ncurses))
741 (arguments
742 `(#:phases
743 (modify-phases %standard-phases
744 (add-after 'unpack 'update-config-scripts
745 (lambda* (#:key inputs native-inputs #:allow-other-keys)
746 ;; Replace outdated config.guess and config.sub.
747 (for-each (lambda (file)
748 (install-file
749 (search-input-file
750 (or native-inputs inputs)
751 (string-append "/bin/" file)) "."))
752 '("config.guess" "config.sub"))))
753 (replace 'configure
754 (lambda* (#:key build inputs outputs #:allow-other-keys)
755 ;; This old `configure' script doesn't support
756 ;; variables passed as arguments.
757 (let ((out (assoc-ref outputs "out"))
758 (ncurses (assoc-ref inputs "ncurses")))
759 (setenv "CONFIG_SHELL" (which "bash"))
760 (invoke "./configure"
761 "--disable-static"
762 (string-append "--prefix=" out)
763 (string-append "--build=" build)
764 (string-append "--with-ncurses="
765 ncurses))))))))
766 (home-page "http://aa-project.sourceforge.net/aalib/")
767 (synopsis "ASCII-art library")
768 (description
769 "AA-lib is a low level gfx library which does not require graphics device.
770 In fact, there is no graphical output possible. AA-lib replaces those
771 old-fashioned output methods with powerful ascii-art renderer.")
772 (license license:lgpl2.0+)))
773
774 (define-public celluloid
775 (package
776 (name "celluloid")
777 (version "0.24")
778 (source
779 (origin
780 (method url-fetch)
781 (uri (string-append "https://github.com/celluloid-player/celluloid"
782 "/releases/download/v" version
783 "/celluloid-" version ".tar.xz"))
784 (sha256
785 (base32 "0ns9xh582c8kajw4v2x5ap5jfiba3gxywqc2klc0v6fc3id1gqii"))))
786 (build-system meson-build-system)
787 (arguments
788 (list
789 #:glib-or-gtk? #t
790 #:phases
791 #~(modify-phases %standard-phases
792 (add-after 'unpack 'disable-postinstall-script
793 (lambda _
794 (setenv "DESTDIR" "/"))))))
795 (native-inputs
796 (list
797 intltool
798 `(,glib "bin") ; for glib-compile-resources
799 pkg-config
800 python-wrapper)) ; for generate-authors.py
801 (inputs
802 (list gtk libadwaita libepoxy mpv))
803 (home-page "https://github.com/celluloid-player/celluloid")
804 (synopsis "GTK+ frontend for the mpv media player")
805 (description "Celluloid is a simple GTK+ frontend for the mpv media player.
806 It interacts with mpv via the client API exported by libmpv, allowing access to
807 mpv's powerful playback capabilities.")
808 (license license:gpl3+)))
809
810 (define-public liba52
811 (package
812 (name "liba52")
813 (version "0.7.4")
814 (source (origin
815 (method url-fetch)
816 (uri (string-append
817 ;; A mirror://sourceforge URI doesn't work, presumably
818 ;; because the SourceForge project is misconfigured.
819 "http://liba52.sourceforge.net/files/a52dec-" version
820 ".tar.gz"))
821 (sha256
822 (base32
823 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
824 (patches (search-patches "liba52-enable-pic.patch"
825 "liba52-set-soname.patch"
826 "liba52-use-mtune-not-mcpu.patch"
827 "liba52-link-with-libm.patch"))))
828 (build-system gnu-build-system)
829 ;; XXX We need to run ./bootstrap because of the build system fixes above.
830 (native-inputs
831 (list autoconf automake libtool))
832 (arguments `(#:configure-flags '("--enable-shared")
833 #:phases
834 (modify-phases %standard-phases
835 ;; XXX We need to run ./bootstrap because of the build
836 ;; system fixes above.
837 (replace 'bootstrap
838 (lambda _ (invoke "sh" "bootstrap"))))))
839 (home-page "http://liba52.sourceforge.net/")
840 (synopsis "ATSC A/52 audio stream decoder")
841 (description "liba52 is a library for decoding ATSC A/52 audio streams.
842 The A/52 standard is used in a variety of applications, including digital
843 television and DVD. It is also known as AC-3.")
844 (license license:gpl2+)))
845
846 (define-public libaom
847 (package
848 (name "libaom")
849 (version "3.3.0")
850 (source (origin
851 (method git-fetch)
852 (uri (git-reference
853 (url "https://aomedia.googlesource.com/aom/")
854 (commit (string-append "v" version))))
855 (file-name (git-file-name name version))
856 (sha256
857 (base32
858 "024vhsx7bw9kajk65hhh5vmqrja0h33rmlcpngsj3yg4p8l29943"))))
859 (build-system cmake-build-system)
860 (native-inputs
861 (list perl pkg-config python)) ; to detect the version
862 (arguments
863 `(#:tests? #f ; downloads many video clips
864 #:configure-flags
865 (list "-DBUILD_SHARED_LIBS=YES"
866 "-DENABLE_PIC=TRUE"
867 "-DAOM_TARGET_CPU=generic"
868 (string-append "-DCMAKE_INSTALL_PREFIX="
869 (assoc-ref %outputs "out")))
870 #:phases
871 (modify-phases %standard-phases
872 (add-after 'install 'delete-static-libraries
873 (lambda* (#:key outputs #:allow-other-keys)
874 (let* ((out (assoc-ref outputs "out"))
875 (lib (string-append out "/lib")))
876 (for-each delete-file
877 (find-files lib "\\.a$"))))))))
878 (home-page "https://aomedia.googlesource.com/aom/")
879 (synopsis "AV1 video codec")
880 (description "Libaom is the reference implementation of AV1. It includes a
881 shared library and encoder and decoder command-line executables.")
882 (license license:bsd-2)))
883
884 (define-public libmpeg2
885 (package
886 (name "libmpeg2")
887 (version "0.5.1")
888 (source (origin
889 (method url-fetch)
890 ;; A mirror://sourceforge URI doesn't work, presumably
891 ;; because the SourceForge project is misconfigured.
892 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
893 name "-" version ".tar.gz"))
894 (patches (search-patches "libmpeg2-arm-private-symbols.patch"
895 "libmpeg2-global-symbol-test.patch"))
896 (sha256
897 (base32
898 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
899 (inputs
900 (list libx11
901 libxext
902 libxv
903 libsm
904 libice
905 sdl))
906 (build-system gnu-build-system)
907 (home-page "http://libmpeg2.sourceforge.net/")
908 (synopsis "MPEG1 and MPEG2 video decoder library")
909 (description
910 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
911 (license license:gpl2+)))
912
913 (define-public libx264
914 ;; There are no tags in the repository, so we take the version number from
915 ;; the X264_BUILD variable defined in x264.h.
916 (let ((version "161")
917 (commit "4c2aafd864dd201832ec2be0fef4484925146650")
918 (revision "0"))
919 (package
920 (name "libx264")
921 (version (git-version version revision commit))
922 (source (origin
923 (method git-fetch)
924 (uri (git-reference
925 (url "https://code.videolan.org/videolan/x264.git")
926 (commit commit)))
927 (file-name (git-file-name name version))
928 (sha256
929 (base32
930 "1i6v9h3xx9pi0zmlj3anwwjxqa63sbhy9crrif8dphipwfn9hyg5"))))
931 (build-system gnu-build-system)
932 (native-inputs
933 (list pkg-config nasm))
934 (inputs
935 (list config))
936 ;; TODO: Add gpac input
937 (arguments
938 `(#:tests? #f ;no check target
939 #:configure-flags '("--enable-shared"
940 ;; Don't build the command-line program. If we
941 ;; want it later, we should do so in a different
942 ;; package to avoid a circular dependency (the x264
943 ;; program depends on ffmpeg and ffmpeg depends on
944 ;; libx264).
945 "--disable-cli"
946 "--enable-pic"
947
948 ;; On MIPS, we must pass "--disable-asm" or else
949 ;; configure fails after printing: "You specified a
950 ;; pre-MSA CPU in your CFLAGS. If you really want
951 ;; to run on such a CPU, configure with
952 ;; --disable-asm."
953 ,@(if (string-prefix? "mips"
954 (or (%current-target-system)
955 (%current-system)))
956 '("--disable-asm")
957 '()))
958 #:phases
959 (modify-phases %standard-phases
960 (add-after 'unpack 'update-config-scripts
961 (lambda* (#:key native-inputs inputs #:allow-other-keys)
962 (for-each (lambda (file)
963 (install-file
964 (search-input-file
965 (or native-inputs inputs)
966 (string-append "/bin/" file)) "."))
967 '("config.guess" "config.sub")))))))
968 (home-page "https://www.videolan.org/developers/x264.html")
969 (synopsis "H.264 video coding library")
970 (description "libx264 is an advanced encoding library for creating
971 H.264 (MPEG-4 AVC) video streams.")
972 (license (list license:gpl2+ ;most files
973 license:isc ;common/x86/x86inc.asm
974 license:lgpl2.1+ ;extras/getopt.c
975 license:bsd-3 ;extras/inttypes.h
976 (license:non-copyleft ;extras/cl*.h
977 "file://extras/cl.h"
978 "See extras/cl.h in the distribution."))))))
979
980 ;;; TODO: Merge into libx264 on staging.
981 (define-public libx264-next
982 ;; There are no tags in the repository, so we take the version number from
983 ;; the X264_BUILD variable defined in x264.h.
984 (let ((version "164")
985 (commit "b093bbe7d9bc642c8f24067cbdcc73bb43562eab")
986 (revision "0"))
987 (package
988 (inherit libx264)
989 (name "libx264")
990 (version (git-version version revision commit))
991 (source (origin
992 (method git-fetch)
993 (uri (git-reference
994 (url "https://code.videolan.org/videolan/x264.git")
995 (commit commit)))
996 (file-name (git-file-name name version))
997 (sha256
998 (base32
999 "095pv8y6fqjg8mdvsfk12d0jqgyhip536a6vxhzm7qz8hfp96qhq")))))))
1000
1001 (define-public mkvtoolnix
1002 (package
1003 (name "mkvtoolnix")
1004 (version "52.0.0")
1005 (source
1006 (origin
1007 (method url-fetch)
1008 (uri (string-append "https://mkvtoolnix.download/sources/"
1009 "mkvtoolnix-" version ".tar.xz"))
1010 (sha256
1011 (base32 "15y7ahlifsclnkl70wn5w34dil8nwcwcjnw3k2ydqc6dz4vb0j5s"))
1012 (modules '((guix build utils)))
1013 (snippet '(begin
1014 ;; Delete bundled libraries.
1015 (for-each delete-file-recursively
1016 '("lib/fmt"
1017 "lib/libebml"
1018 "lib/libmatroska"
1019 "lib/nlohmann-json"
1020 "lib/pugixml"
1021 "lib/utf8-cpp"))
1022 #t))))
1023 (build-system gnu-build-system)
1024 (outputs '("out" "gui")) ; "mkvtoolnix-gui" brings the closure size from ~300 MB to 1.5+ GB.
1025 (inputs
1026 (list boost
1027 bzip2
1028 cmark
1029 libebml
1030 file
1031 flac
1032 fmt-8
1033 libdvdread
1034 libmatroska
1035 libogg
1036 libvorbis
1037 lzo
1038 pcre2
1039 pugixml
1040 qtbase-5
1041 qtmultimedia-5
1042 utfcpp
1043 zlib))
1044 (native-inputs
1045 `(("docbook-xsl" ,docbook-xsl)
1046 ("gettext" ,gettext-minimal)
1047 ("googletest" ,googletest)
1048 ("libxslt" ,libxslt)
1049 ("json-modern-cxx" ,json-modern-cxx)
1050 ("perl" ,perl)
1051 ("pkg-config" ,pkg-config)
1052 ("po4a" ,po4a)
1053 ("qttools-5" ,qttools-5)
1054 ("ruby" ,ruby)))
1055 (arguments
1056 `(#:configure-flags
1057 (list (string-append "--with-boost="
1058 (assoc-ref %build-inputs "boost"))
1059 (string-append "--with-docbook-xsl-root="
1060 (assoc-ref %build-inputs "docbook-xsl")
1061 "/xml/xsl/docbook-xsl-"
1062 ,(package-version docbook-xsl))
1063 "--enable-update-check=no"
1064 "--enable-precompiled-headers=no")
1065 #:phases
1066 (modify-phases %standard-phases
1067 (add-after 'unpack 'patch-relative-file-names
1068 (lambda* (#:key outputs #:allow-other-keys)
1069 (let ((out (assoc-ref outputs "out")))
1070 (substitute* "src/mkvtoolnix-gui/util/settings.cpp"
1071 (("mkvmerge" match)
1072 (string-append out "/bin/" match)))
1073 #t)))
1074 (add-before 'configure 'add-googletest
1075 (lambda* (#:key inputs #:allow-other-keys)
1076 (symlink (search-input-directory inputs "/include/gtest")
1077 "lib/gtest")))
1078 (replace 'build
1079 (lambda _
1080 (let ((-j (list "-j" (number->string (parallel-job-count)))))
1081 (apply invoke "rake" -j))))
1082 (replace 'check
1083 (lambda _
1084 (invoke "rake" "tests/unit")))
1085 (replace 'install
1086 (lambda _
1087 (invoke "rake" "install")))
1088 (add-after 'install 'post-install
1089 (lambda* (#:key outputs #:allow-other-keys)
1090 ;; Move the Qt interface to "gui".
1091 (let* ((out (assoc-ref outputs "out"))
1092 (gui (assoc-ref outputs "gui"))
1093 (strip-store-dir (lambda (path)
1094 (substring path (string-prefix-length out path)))))
1095 (for-each
1096 (lambda (file)
1097 (mkdir-p (string-append gui (dirname file)))
1098 (rename-file (string-append out file)
1099 (string-append gui file)))
1100 (append '("/bin/mkvtoolnix-gui"
1101 "/share/applications/org.bunkus.mkvtoolnix-gui.desktop"
1102 "/share/metainfo/org.bunkus.mkvtoolnix-gui.appdata.xml"
1103 "/share/mime/packages/org.bunkus.mkvtoolnix-gui.xml")
1104 (map strip-store-dir (find-files out "\\.ogg$"))
1105 (map strip-store-dir (find-files out "mkvtoolnix-gui\\.png$"))
1106 (map strip-store-dir (find-files out "mkvtoolnix-gui\\.1"))))
1107 (for-each
1108 (lambda (file)
1109 (delete-file-recursively (string-append out file)))
1110 '("/share/applications"
1111 "/share/metainfo"
1112 "/share/mime"
1113 "/share/mkvtoolnix")))
1114 #t)))))
1115 (home-page "https://mkvtoolnix.download")
1116 (synopsis "Tools to create, alter and inspect Matroska files")
1117 (description
1118 "MKVToolNix provides tools for getting information about Matroska files
1119 (@command{mkvinfo}), extracting tracks/data from Matroska files
1120 (@command{mkvextract}), and creating Matroska files from other media files
1121 (@command{mkvmerge}).")
1122 (license license:gpl2)))
1123
1124 (define-public pipe-viewer
1125 (package
1126 (name "pipe-viewer")
1127 (version "0.2.3")
1128 (source
1129 (origin
1130 (method git-fetch)
1131 (uri
1132 (git-reference
1133 (url "https://github.com/trizen/pipe-viewer")
1134 (commit version)))
1135 (file-name (git-file-name name version))
1136 (sha256
1137 (base32 "0c2v4pj86442sp71ndjmvd2bl1grp6g9ya2ywdaihq1f2djk6jxl"))))
1138 (build-system perl-build-system)
1139 (arguments
1140 `(#:imported-modules
1141 ((guix build copy-build-system)
1142 ,@%perl-build-system-modules)
1143 #:modules
1144 (((guix build copy-build-system)
1145 #:prefix copy:)
1146 (guix build perl-build-system)
1147 (guix build utils)
1148 (srfi srfi-26))
1149 #:module-build-flags
1150 (list
1151 "--gtk3")
1152 #:phases
1153 (modify-phases %standard-phases
1154 (add-after 'unpack 'patch-source
1155 (lambda* (#:key inputs #:allow-other-keys)
1156 (substitute* (find-files "lib" "\\.pm$")
1157 (("\"yt-dlp\"")
1158 (format #f "\"~a/bin/yt-dlp\""
1159 (assoc-ref inputs "yt-dlp"))))
1160 (substitute* (find-files "bin" ".*-viewer$")
1161 (("'ffmpeg'")
1162 (format #f "'~a/bin/ffmpeg'"
1163 (assoc-ref inputs "ffmpeg")))
1164 (("'wget'")
1165 (format #f "'~a/bin/wget'"
1166 (assoc-ref inputs "wget")))
1167 (("'xdg-open'")
1168 (format #f "'~a/bin/xdg-open'"
1169 (assoc-ref inputs "xdg-utils")))
1170 (("'yt-dlp'")
1171 (format #f "'~a/bin/yt-dlp'"
1172 (assoc-ref inputs "yt-dlp"))))))
1173 (add-after 'install 'install-xdg
1174 (lambda args
1175 (apply (assoc-ref copy:%standard-phases 'install)
1176 #:install-plan
1177 '(("share/icons" "share/pixmaps")
1178 ("share" "share/applications"
1179 #:include-regexp ("\\.desktop$")))
1180 args)))
1181 (add-after 'install-xdg 'wrap-programs
1182 (lambda* (#:key outputs #:allow-other-keys)
1183 (let* ((out (assoc-ref outputs "out"))
1184 (bin-dir (string-append out "/bin/"))
1185 (site-dir (string-append out "/lib/perl5/site_perl/"))
1186 (perl-lib (getenv "PERL5LIB"))
1187 (gi-typelib (getenv "GI_TYPELIB_PATH")))
1188 (for-each
1189 (cut wrap-program <>
1190 `("PERL5LIB" ":" prefix (,perl-lib ,site-dir))
1191 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib)))
1192 (find-files bin-dir))))))))
1193 (native-inputs
1194 (list perl-module-build perl-test-pod perl-test-simple))
1195 (inputs
1196 (list perl-data-dump
1197 perl-digest-md5
1198 perl-encode
1199 ffmpeg
1200 perl-file-path
1201 perl-file-sharedir
1202 perl-getopt-long
1203 perl-gtk3
1204 perl-http-message
1205 perl-json
1206 perl-json-xs
1207 perl-libwww
1208 perl-lwp-protocol-https
1209 perl-lwp-useragent-cached
1210 perl-memoize
1211 perl-mime-base64
1212 perl-pathtools
1213 perl-scalar-list-utils
1214 perl-storable
1215 perl-term-ansicolor
1216 perl-term-readline-gnu
1217 perl-text-parsewords
1218 perl-text-tabs+wrap
1219 perl-unicode-linebreak
1220 perl-uri-escape
1221 wget
1222 xdg-utils
1223 yt-dlp))
1224 (propagated-inputs
1225 (list dconf))
1226 (home-page "https://github.com/trizen/pipe-viewer")
1227 (synopsis "CLI+GUI YouTube Client")
1228 (description "Pipe-Viewer is a lightweight application for searching and
1229 playing videos from YouTube. It parses the YouTube website directly and relies
1230 on the Invidious instances only as a fallback method.")
1231 (license license:artistic2.0)))
1232
1233 (define-public straw-viewer
1234 (deprecated-package "straw-viewer" pipe-viewer))
1235
1236 (define-public x265
1237 (package
1238 (name "x265")
1239 (version "3.5")
1240 (outputs '("out" "static"))
1241 (source
1242 (origin
1243 (method url-fetch)
1244 (uri (string-append "https://bitbucket.org/multicoreware/x265_git"
1245 "/downloads/x265_" version ".tar.gz"))
1246 (sha256
1247 (base32 "1s6afxj61jdwfjnn70dwiql34fbqsvn6zv10785vmjyar8sk62p7"))
1248 (patches (search-patches "x265-arm-flags.patch"))
1249 (modules '((guix build utils)))
1250 (snippet '(begin
1251 (delete-file-recursively "source/compat/getopt")))))
1252 (build-system cmake-build-system)
1253 (native-inputs
1254 ;; XXX: ASM optimization fails on i686-linux, see <https://bugs.gnu.org/41768>.
1255 (if (string-prefix? "i686" (%current-system))
1256 '()
1257 `(("nasm" ,nasm))))
1258 (arguments
1259 `(#:tests? #f ; tests are skipped if ENABLE_ASSEMBLY is TRUE.
1260 #:configure-flags
1261 ;; Ensure position independent code for everyone.
1262 (list "-DENABLE_PIC=TRUE"
1263 (string-append "-DCMAKE_INSTALL_PREFIX="
1264 (assoc-ref %outputs "out")))
1265 #:phases
1266 (modify-phases %standard-phases
1267 (add-after 'unpack 'prepare-build
1268 (lambda _
1269 (delete-file-recursively "build")
1270 (chdir "source")
1271 ;; We're not building from a git or mercurial repository,
1272 ;; so help cmake find the version number.
1273 (substitute* "cmake/Version.cmake"
1274 (("if\\(X265_TAG_DISTANCE STREQUAL \"0\"\\)")
1275 (string-append "if(TRUE)\n"
1276 " set(X265_LATEST_TAG \"" ,version "\")\n")))))
1277 (add-before 'configure 'build-12-bit
1278 (lambda* (#:key (configure-flags '()) #:allow-other-keys #:rest args)
1279 (mkdir "../build-12bit")
1280 (with-directory-excursion "../build-12bit"
1281 (apply invoke
1282 "cmake" "../source"
1283 ,@(if (target-aarch64?)
1284 '("-DENABLE_ASSEMBLY=OFF")
1285 '())
1286 ;; Altivec code produces many build errors.
1287 ,@(if (target-ppc64le?)
1288 '("-DENABLE_ALTIVEC=OFF")
1289 '())
1290 "-DHIGH_BIT_DEPTH=ON"
1291 "-DEXPORT_C_API=OFF"
1292 "-DENABLE_CLI=OFF"
1293 "-DMAIN12=ON"
1294 configure-flags)
1295 (substitute* (cons "cmake_install.cmake"
1296 (append
1297 (find-files "CMakeFiles/x265-shared.dir")
1298 (find-files "CMakeFiles/x265-static.dir")))
1299 (("libx265") "libx265_main12"))
1300 ((assoc-ref %standard-phases 'build)))))
1301 (add-before 'configure 'build-10-bit
1302 (lambda* (#:key (configure-flags '()) #:allow-other-keys #:rest args)
1303 (mkdir "../build-10bit")
1304 (with-directory-excursion "../build-10bit"
1305 (apply invoke
1306 "cmake" "../source"
1307 ,@(if (target-aarch64?)
1308 '("-DENABLE_ASSEMBLY=OFF")
1309 '())
1310 ;; Altivec code produces many build errors.
1311 ,@(if (target-ppc64le?)
1312 '("-DENABLE_ALTIVEC=OFF")
1313 '())
1314 "-DHIGH_BIT_DEPTH=ON"
1315 "-DEXPORT_C_API=OFF"
1316 "-DENABLE_CLI=OFF"
1317 configure-flags)
1318 (substitute* (cons "cmake_install.cmake"
1319 (append
1320 (find-files "CMakeFiles/x265-shared.dir")
1321 (find-files "CMakeFiles/x265-static.dir")))
1322 (("libx265") "libx265_main10"))
1323 ((assoc-ref %standard-phases 'build)))))
1324 (add-after 'install 'install-more-libs
1325 (lambda args
1326 (with-directory-excursion "../build-12bit"
1327 ((assoc-ref %standard-phases 'install)))
1328 (with-directory-excursion "../build-10bit"
1329 ((assoc-ref %standard-phases 'install)))))
1330 (add-before 'strip 'move-static-libs
1331 (lambda* (#:key outputs #:allow-other-keys)
1332 (let ((out (assoc-ref outputs "out"))
1333 (static (assoc-ref outputs "static")))
1334 (mkdir-p (string-append static "/lib"))
1335 (with-directory-excursion
1336 (string-append out "/lib")
1337 (for-each
1338 (lambda (file)
1339 (rename-file file
1340 (string-append static "/lib/" file)))
1341 (find-files "." "\\.a$")))))))))
1342 (home-page "http://x265.org/")
1343 (synopsis "Library for encoding h.265/HEVC video streams")
1344 (description "x265 is a H.265 / HEVC video encoder application library,
1345 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
1346 (license license:gpl2+)))
1347
1348 (define-public libass
1349 (package
1350 (name "libass")
1351 (version "0.15.1")
1352 (source (origin
1353 (method url-fetch)
1354 (uri (string-append
1355 "https://github.com/libass/libass/releases/download/"
1356 version "/libass-" version ".tar.xz"))
1357 (sha256
1358 (base32
1359 "0lwfmdizzrr4gcq3fgw4j8g9pkrqgx6h0f3pgrrnxc07s34kkp8w"))))
1360 (build-system gnu-build-system)
1361 (arguments
1362 '(#:configure-flags '("--disable-static")))
1363 (native-inputs
1364 (list pkg-config nasm))
1365 (propagated-inputs
1366 `(("freetype" ,freetype)
1367 ("fribidi" ,fribidi)
1368 ("fontconfig" ,fontconfig)
1369 ("harfbuzz" ,harfbuzz)))
1370 (home-page "https://github.com/libass/libass")
1371 (synopsis "Subtitle rendering library for the ASS/SSA format")
1372 (description "libass is a subtitle rendering library for the
1373 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
1374 (license license:isc)))
1375
1376 (define-public libcaca
1377 (package
1378 (name "libcaca")
1379 (version "0.99.beta19")
1380 (source (origin
1381 (method url-fetch)
1382 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
1383 version ".tar.gz"))
1384 (sha256
1385 (base32
1386 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))
1387 (patches (search-patches "libcaca-CVE-2021-3410-pt1.patch"
1388 "libcaca-CVE-2021-3410-pt2.patch"))))
1389 (build-system gnu-build-system)
1390 (arguments
1391 '(#:configure-flags '("--disable-static")))
1392 (native-inputs (list pkg-config))
1393 (inputs
1394 (list freeglut
1395 ftgl
1396 imlib2
1397 libx11
1398 mesa
1399 ncurses
1400 zlib))
1401 (home-page "http://caca.zoy.org/wiki/libcaca")
1402 (synopsis "Colour ASCII-art library")
1403 (description "libcaca is a graphics library that outputs text instead of
1404 pixels, so that it can work on older video cards or text terminals. It
1405 supports Unicode, 2048 colors, dithering of color images, and advanced text
1406 canvas operations.")
1407 (license license:wtfpl2)))
1408
1409 (define-public libdca
1410 (package
1411 (name "libdca")
1412 (version "0.0.7")
1413 (source (origin
1414 (method url-fetch)
1415 (uri (string-append
1416 "https://download.videolan.org/pub/videolan/libdca/"
1417 version "/libdca-" version ".tar.bz2"))
1418 (sha256
1419 (base32
1420 "0sjz0s0nrv7jcpvh1i432x3jza0y5yycmzw84cfncb2qby0i62rs"))))
1421 (build-system gnu-build-system)
1422 (native-inputs
1423 (list autoconf automake libtool))
1424 (home-page "https://www.videolan.org/developers/libdca.html")
1425 (synopsis "DTS Coherent Acoustics decoder")
1426 (description "libdca is a library for decoding DTS Coherent Acoustics
1427 streams.")
1428 (license license:gpl2+)))
1429
1430 (define-public libdv
1431 (package
1432 (name "libdv")
1433 (version "1.0.0")
1434 (source (origin
1435 (method url-fetch)
1436 (uri (string-append
1437 "mirror://sourceforge/libdv/libdv/"
1438 version "/libdv-" version ".tar.gz"))
1439 (sha256
1440 (base32
1441 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
1442 (build-system gnu-build-system)
1443 (native-inputs (list pkg-config))
1444 (inputs (list libxv))
1445 (home-page "http://libdv.sourceforge.net/")
1446 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
1447 (description "The Quasar DV codec (libdv) is a software codec for DV
1448 video, the encoding format used by most digital camcorders, typically those
1449 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
1450 developed according to the official standards for DV video: IEC 61834 and
1451 SMPTE 314M.")
1452 (license license:lgpl2.1+)))
1453
1454 (define-public libmatroska
1455 (package
1456 (name "libmatroska")
1457 (version "1.6.3")
1458 (source
1459 (origin
1460 (method url-fetch)
1461 (uri (string-append "https://dl.matroska.org/downloads/"
1462 "libmatroska/libmatroska-" version ".tar.xz"))
1463 (sha256
1464 (base32 "06h81sxyz2riic0gpzik6ffcnq32wrqphi8c6k55glcdymiimyfs"))))
1465 (build-system cmake-build-system)
1466 (inputs
1467 (list libebml))
1468 (arguments
1469 `(#:configure-flags
1470 (list "-DBUILD_SHARED_LIBS=YES")
1471 #:tests? #f)) ; no test suite
1472 (home-page "https://www.matroska.org")
1473 (synopsis "C++ library to parse Matroska files (.mkv and .mka)")
1474 (description
1475 "Matroska aims to become the standard of multimedia container formats.
1476 It is based on @dfn{EBML} (Extensible Binary Meta Language), a binary derivative
1477 of XML. EBML enables the Matroska Development Team to gain significant
1478 advantages in terms of future format extensibility, without breaking file
1479 support in old parsers.
1480 libebml is a C++ library to read and write EBML files.")
1481 (license license:lgpl2.1)))
1482
1483 (define-public libplacebo
1484 (package
1485 (name "libplacebo")
1486 (version "4.208.0")
1487 (source
1488 (origin
1489 (method git-fetch)
1490 (uri (git-reference
1491 (url "https://code.videolan.org/videolan/libplacebo.git")
1492 (commit (string-append "v" version))))
1493 (file-name (git-file-name name version))
1494 (sha256
1495 (base32 "161dp5781s74ca3gglaxlmchx7glyshf0wg43w98pl22n1jcm5qk"))))
1496 (build-system meson-build-system)
1497 (arguments
1498 `(#:configure-flags
1499 `("-Dopengl=enabled"
1500 ,(string-append "-Dvulkan-registry="
1501 (assoc-ref %build-inputs "vulkan-headers")
1502 "/share/vulkan/registry/vk.xml"))))
1503 (native-inputs
1504 (list python python-mako pkg-config))
1505 (inputs
1506 (list lcms
1507 libepoxy
1508 mesa
1509 shaderc
1510 vulkan-headers
1511 vulkan-loader))
1512 (home-page "https://code.videolan.org/videolan/libplacebo")
1513 (synopsis "GPU-accelerated image/video processing library")
1514 (description "libplacebo is, in a nutshell, the core rendering algorithms
1515 and ideas of mpv rewritten as an independent library. As of today, libplacebo
1516 contains a large assortment of video processing shaders, focusing on both
1517 quality and performance.")
1518 (license license:lgpl2.1+)))
1519
1520 (define-public libva
1521 (package
1522 (name "libva")
1523 (version "2.15.0")
1524 (source
1525 (origin
1526 (method url-fetch)
1527 (uri (string-append "https://github.com/intel/libva/releases/download/"
1528 version "/libva-" version ".tar.bz2"))
1529 (sha256
1530 (base32 "1jhy8qzfp4ydbxs9qd9km7k5wq8r4s2vq20r1q07lgld8l4x93i5"))))
1531 (build-system gnu-build-system)
1532 (native-inputs
1533 (list pkg-config))
1534 (inputs
1535 (list libdrm
1536 libx11
1537 libxext
1538 libxfixes
1539 mesa
1540 wayland))
1541 (arguments
1542 (list
1543 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
1544 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
1545 #:configure-flags
1546 #~(list (string-append "--with-drivers-path="
1547 (search-input-directory %build-inputs "lib/dri")))
1548 ;; However, we can't write to mesa's store directory, so override the
1549 ;; following make variable to install the dummy driver to libva's
1550 ;; $prefix/lib/dri directory.
1551 #:make-flags
1552 #~(list (string-append "dummy_drv_video_ladir=" #$output "/lib/dri"))
1553 #:phases
1554 #~(modify-phases %standard-phases
1555 (add-before 'build 'fix-dlopen-paths
1556 (lambda _
1557 (substitute* "va/drm/va_drm_auth_x11.c"
1558 (("\"libva-x11\\.so\\.%d\"")
1559 (string-append "\"" #$output "/lib/libva-x11.so.%d\""))))))))
1560 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
1561 (synopsis "Video acceleration library")
1562 (description "The main motivation for VA-API (Video Acceleration API) is
1563 to enable hardware accelerated video decode/encode at various
1564 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
1565 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
1566 (license license:expat)))
1567
1568 (define-public libva-utils
1569 (package
1570 (name "libva-utils")
1571 (version "2.5.0")
1572 (source
1573 (origin
1574 (method url-fetch)
1575 (uri (string-append "https://github.com/intel/libva-utils/releases/download/"
1576 version "/libva-utils-" version ".tar.bz2"))
1577 (sha256
1578 (base32 "05rasyqnsg522zqxak1q8rrm1hys7wwbi41kd0szjq0d27awjf4j"))))
1579 (build-system gnu-build-system)
1580 (arguments
1581 `(#:configure-flags
1582 (list "--enable-wayland"
1583 "--enable-x11")))
1584 (native-inputs
1585 (list pkg-config))
1586 (inputs
1587 (list libdrm libva libx11 mesa wayland))
1588 (home-page "https://01.org/linuxmedia/vaapi")
1589 (synopsis "Collection of testing utilities for VA-API")
1590 (description
1591 "This is a collection of utilities to query and test the @acronym{VA-API,
1592 Video Acceleration API} implemented by the libva library.
1593
1594 These tools require a supported graphics chip, driver, and VA-API back end to
1595 operate properly.")
1596 (license license:expat)))
1597
1598 (define-public ffmpeg-5
1599 (package
1600 (name "ffmpeg")
1601 (version "5.1.2")
1602 (source (origin
1603 (method url-fetch)
1604 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
1605 version ".tar.xz"))
1606 (sha256
1607 (base32
1608 "1p7kxr0f9f9d0pyyxq9ciaj9ch2drmcw5p9jk22j111ccrnp17k1"))))
1609 (build-system gnu-build-system)
1610 (inputs
1611 (append
1612 ;; XXX: rav1e depends on rust, which currently only works on x86_64.
1613 ;; See also the related configure flag when changing this.
1614 (if (target-x86-64?) (list rav1e) '())
1615 (list dav1d
1616 fontconfig
1617 freetype
1618 frei0r-plugins
1619 gnutls
1620 opus
1621 ladspa
1622 lame
1623 libaom
1624 libass
1625 libbluray
1626 libcaca
1627 libcdio-paranoia
1628 libdrm
1629 libtheora
1630 libva
1631 libvdpau
1632 libvorbis
1633 libvpx
1634 libx11
1635 libx264
1636 mesa
1637 openal
1638 pulseaudio
1639 sdl2
1640 soxr
1641 speex
1642 srt
1643 twolame
1644 vidstab
1645 x265
1646 xvid
1647 zlib)))
1648 (native-inputs
1649 (list bc
1650 perl
1651 pkg-config
1652 texinfo
1653 speex
1654 yasm))
1655 (arguments
1656 (list
1657 #:test-target "fate"
1658 #:configure-flags
1659 ;; possible additional inputs:
1660 ;; --enable-avisynth enable reading of AviSynth script
1661 ;; files [no]
1662 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
1663 ;; --enable-libcelt enable CELT decoding via libcelt [no]
1664 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
1665 ;; and libraw1394 [no]
1666 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
1667 ;; --enable-libflite enable flite (voice synthesis) support via
1668 ;; libflite [no]
1669 ;; --enable-libgme enable Game Music Emu via libgme [no]
1670 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
1671 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
1672 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
1673 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
1674 ;; --enable-libnut enable NUT (de)muxing via libnut,
1675 ;; native (de)muxer exists [no]
1676 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
1677 ;; libopencore-amrnb [no]
1678 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
1679 ;; libopencore-amrwb [no]
1680 ;; --enable-libopencv enable video filtering via libopencv [no]
1681 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
1682 ;; OpenJPEG [no]
1683 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
1684 ;; --enable-libschroedinger enable Dirac de/encoding via
1685 ;; libschroedinger [no]
1686 ;; --enable-libshine enable fixed-point MP3 encoding via
1687 ;; libshine [no]
1688 ;; --enable-libssh enable SFTP protocol via libssh [no]
1689 ;; (libssh2 does not work)
1690 ;; --enable-libstagefright-h264 enable H.264 decoding via
1691 ;; libstagefright [no]
1692 ;; --enable-libutvideo enable Ut Video encoding and decoding via
1693 ;; libutvideo [no]
1694 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
1695 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
1696 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
1697 ;; libvo-amrwbenc [no]
1698 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
1699 ;; --enable-libxavs enable AVS encoding via xavs [no]
1700 ;; --enable-libzmq enable message passing via libzmq [no]
1701 ;; --enable-libzvbi enable teletext support via libzvbi [no]
1702 ;; --enable-opencl enable OpenCL code
1703 #~(list
1704 "--enable-gpl" ;enable optional gpl licensed parts
1705 "--enable-shared"
1706 "--enable-frei0r"
1707 "--enable-fontconfig"
1708 "--enable-gnutls"
1709 "--enable-ladspa"
1710 "--enable-libaom"
1711 "--enable-libass"
1712 "--enable-libbluray"
1713 "--enable-libcaca"
1714 "--enable-libcdio"
1715 "--enable-libdav1d"
1716 "--enable-libfreetype"
1717 "--enable-libmp3lame"
1718 "--enable-libopus"
1719 "--enable-libpulse"
1720 #$@(if (target-x86-64?)
1721 '("--enable-librav1e")
1722 '())
1723 "--enable-libsoxr"
1724 "--enable-libspeex"
1725 "--enable-libsrt"
1726 "--enable-libtheora"
1727 "--enable-libtwolame"
1728 "--enable-libvidstab"
1729 "--enable-libvorbis"
1730 "--enable-libvpx"
1731 "--enable-libxvid"
1732 "--enable-libx264"
1733 "--enable-libx265"
1734 "--enable-openal"
1735 "--enable-opengl"
1736 "--enable-libdrm"
1737 "--enable-vaapi"
1738
1739 "--enable-runtime-cpudetect"
1740
1741 ;; The HTML pages take 7.2 MiB
1742 "--disable-htmlpages"
1743
1744 ;; The static libraries are 23 MiB
1745 "--disable-static"
1746
1747 #$@(if (target-riscv64?)
1748 '("--extra-cflags=-fPIC")
1749 '())
1750
1751 ;; Runtime cpu detection is not implemented on
1752 ;; MIPS, so we disable some features.
1753 "--disable-mips32r2"
1754 "--disable-mipsdsp"
1755 "--disable-mipsdspr2"
1756 "--disable-mipsfpu")
1757 #:phases
1758 #~(modify-phases %standard-phases
1759 (replace 'configure
1760 ;; configure does not work followed by "SHELL=..." and
1761 ;; "CONFIG_SHELL=..."; set environment variables instead
1762 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1763 (let ((out (assoc-ref outputs "out")))
1764 (substitute* "configure"
1765 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1766 (setenv "SHELL" (which "bash"))
1767 (setenv "CONFIG_SHELL" (which "bash"))
1768 (apply invoke
1769 "./configure"
1770 (string-append "--prefix=" out)
1771 ;; Add $libdir to the RUNPATH of all the binaries.
1772 (string-append "--extra-ldflags=-Wl,-rpath="
1773 out "/lib")
1774 configure-flags))))
1775 (add-before 'check 'set-ld-library-path
1776 (lambda _
1777 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
1778 ;; running tests.
1779 (let* ((dso (find-files "." "\\.so$"))
1780 (path (string-join (map dirname dso) ":")))
1781 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
1782 (setenv "LD_LIBRARY_PATH" path)))))))
1783 (home-page "https://www.ffmpeg.org/")
1784 (synopsis "Audio and video framework")
1785 (description "FFmpeg is a complete, cross-platform solution to record,
1786 convert and stream audio and video. It includes the libavcodec
1787 audio/video codec library.")
1788 (license license:gpl2+)))
1789
1790 (define-public ffmpeg-4
1791 (package
1792 (inherit ffmpeg-5)
1793 (version "4.4.2")
1794 (source (origin
1795 (method url-fetch)
1796 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
1797 version ".tar.xz"))
1798 (sha256
1799 (base32
1800 "14xadxm1yaamp216nq09xwasxg5g133v86dbb33mdg5di1zrlhdg"))))
1801 (inputs (modify-inputs (package-inputs ffmpeg-5)
1802 (replace "sdl2" sdl2-2.0)))
1803 (arguments
1804 (substitute-keyword-arguments (package-arguments ffmpeg-5)
1805 ((#:configure-flags flags ''())
1806 #~(cons "--enable-avresample" #$flags))))))
1807
1808 (define-public ffmpeg-3.4
1809 (package
1810 (inherit ffmpeg-4)
1811 (version "3.4.11")
1812 (source (origin
1813 (method url-fetch)
1814 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
1815 version ".tar.xz"))
1816 (sha256
1817 (base32
1818 "1rijdvcx8xjqwh084qchwz91vcj8wsvb4diax0g8miywpir00ccw"))))
1819 (arguments
1820 (substitute-keyword-arguments (package-arguments ffmpeg-4)
1821 ((#:modules modules %gnu-build-system-modules)
1822 `((srfi srfi-1)
1823 ,@modules))
1824 ((#:configure-flags flags)
1825 #~(fold delete #$flags
1826 '("--enable-libdav1d"
1827 "--enable-libaom"
1828 "--enable-librav1e"
1829 "--enable-libsrt")))))
1830 (inputs (modify-inputs (package-inputs ffmpeg-4)
1831 (delete "dav1d" "libaom" "rav1e" "srt")))))
1832
1833 (define-public ffmpeg-2.8
1834 (package
1835 (inherit ffmpeg-3.4)
1836 (version "2.8.20")
1837 (source (origin
1838 (method url-fetch)
1839 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
1840 version ".tar.xz"))
1841 (sha256
1842 (base32
1843 "1ivnfqmfnp3zmn1q2dxy4p85427y3r6d3jbnl5kprr7lqckf6rl5"))))
1844 (arguments
1845 `(#:tests? #f ; XXX: Enable them later, if required
1846 #:configure-flags
1847 (list
1848 "--disable-static"
1849 "--enable-shared"
1850 "--extra-cflags=-DFF_API_OLD_ENCODE_VIDEO -DFF_API_OLD_ENCODE_AUDIO")
1851 #:phases
1852 (modify-phases %standard-phases
1853 (replace 'configure
1854 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1855 (let ((out (assoc-ref outputs "out")))
1856 (substitute* "configure"
1857 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1858 ;; configure does not work followed by "SHELL=..." and
1859 ;; "CONFIG_SHELL=..."; set environment variables instead.
1860 (setenv "SHELL" (which "bash"))
1861 (setenv "CONFIG_SHELL" (which "bash"))
1862 (apply invoke
1863 "./configure"
1864 (string-append "--prefix=" out)
1865 ;; Add $libdir to the RUNPATH of all the binaries.
1866 (string-append "--extra-ldflags=-Wl,-rpath="
1867 out "/lib")
1868 configure-flags))))
1869 (add-before
1870 'check 'set-ld-library-path
1871 (lambda _
1872 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
1873 ;; running tests.
1874 (let* ((dso (find-files "." "\\.so$"))
1875 (path (string-join (map dirname dso) ":")))
1876 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
1877 (setenv "LD_LIBRARY_PATH" path)))))))))
1878
1879 (define-public ffmpeg ffmpeg-4)
1880
1881 (define-public ffmpeg-for-stepmania
1882 (hidden-package
1883 (package
1884 (inherit ffmpeg-4)
1885 (version "2.1.3")
1886 (source
1887 (origin
1888 (method git-fetch)
1889 (uri (git-reference
1890 (url "https://github.com/stepmania/ffmpeg")
1891 (commit "eda6effcabcf9c238e4635eb058d72371336e09b")))
1892 (sha256
1893 (base32 "1by8rmbva8mfrivdbbkr2gx4kga89zqygkd4cfjl76nr8mdcdamb"))
1894 (file-name (git-file-name "ffmpeg" version))))
1895 (arguments
1896 (substitute-keyword-arguments (package-arguments ffmpeg-4)
1897 ((#:configure-flags flags)
1898 #~(list "--disable-programs"
1899 "--disable-doc"
1900 "--disable-debug"
1901 "--disable-avdevice"
1902 "--disable-swresample"
1903 "--disable-postproc"
1904 "--disable-avfilter"
1905 "--disable-shared"
1906 "--enable-static"))))
1907 (inputs '()))))
1908
1909 (define-public ffmpegthumbnailer
1910 (package
1911 (name "ffmpegthumbnailer")
1912 (version "2.2.2")
1913 (source (origin
1914 (method git-fetch)
1915 (uri (git-reference
1916 (url "https://github.com/dirkvdb/ffmpegthumbnailer")
1917 (commit version)))
1918 (file-name (git-file-name name version))
1919 (sha256
1920 (base32
1921 "1bakbr714j7yxdal1f5iq0gcl4cxggbbgj227ihdh5kvygqlwich"))))
1922 (build-system cmake-build-system)
1923 (native-inputs
1924 (list pkg-config))
1925 (inputs
1926 (list ffmpeg libjpeg-turbo libpng gvfs))
1927 (arguments
1928 `(#:configure-flags (list "-DENABLE_GIO=ON" "-DENABLE_THUMBNAILER=ON")))
1929 (home-page "https://github.com/dirkvdb/ffmpegthumbnailer")
1930 (synopsis "Create thumbnails from video files")
1931 (description "FFmpegthumbnailer is a lightweight video thumbnailer that
1932 can be used by file managers to create thumbnails for your video files. The
1933 thumbnailer uses ffmpeg to decode frames from the video files, so supported
1934 videoformats depend on the configuration flags of ffmpeg.")
1935 (license license:gpl2+)))
1936
1937 (define-public vlc
1938 (package
1939 (name "vlc")
1940 (version "3.0.17.4")
1941 (source (origin
1942 (method url-fetch)
1943 (uri (string-append
1944 "https://download.videolan.org/pub/videolan/vlc/"
1945 (car (string-split version #\-))
1946 "/vlc-" version ".tar.xz"))
1947 (sha256
1948 (base32
1949 "0cs1vnv91mg7p6253v6wms3zlz91xzphpwaw14dmrd2gibc64nlc"))))
1950 (build-system gnu-build-system)
1951 (native-inputs
1952 (list flex bison gettext-minimal pkg-config))
1953 ;; FIXME: Add optional inputs once available.
1954 (inputs
1955 (list alsa-lib
1956 avahi
1957 bash-minimal
1958 dav1d
1959 dbus
1960 eudev
1961 ffmpeg
1962 flac
1963 fontconfig
1964 freetype
1965 fribidi
1966 gnutls
1967 liba52
1968 libarchive
1969 libass
1970 libavc1394
1971 libbluray
1972 libcaca
1973 libcddb
1974 libdca
1975 libdvbpsi
1976 libdvdnav
1977 libdvdread
1978 libebml
1979 libgcrypt
1980 libidn
1981 libkate
1982 libmad
1983 libmatroska
1984 libmicrodns
1985 libmodplug
1986 libmpeg2
1987 libogg
1988 libpng
1989 libraw1394
1990 (librsvg-for-system)
1991 libsamplerate
1992 libsecret
1993 libssh2
1994 libtheora
1995 libupnp
1996 libva
1997 libvdpau
1998 libvorbis
1999 libvpx
2000 libx264
2001 libxext
2002 libxi
2003 libxinerama
2004 libxml2
2005 libxpm
2006 livemedia-utils
2007 lua-5.2
2008 mesa
2009 opus
2010 perl
2011 protobuf
2012 pulseaudio
2013 python-wrapper
2014 qtbase-5
2015 qtsvg-5
2016 qtx11extras
2017 samba
2018 sdl
2019 sdl-image
2020 speex
2021 speexdsp
2022 srt
2023 taglib
2024 twolame
2025 unzip
2026 wayland
2027 wayland-protocols
2028 x265
2029 xcb-util-keysyms))
2030 (arguments
2031 `(#:configure-flags
2032 `("BUILDCC=gcc"
2033 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
2034 (assoc-ref %build-inputs "ffmpeg")
2035 "/lib")) ;needed for the tests
2036
2037 #:phases
2038 (modify-phases %standard-phases
2039 (add-after 'unpack 'patch-source
2040 (lambda* (#:key inputs #:allow-other-keys)
2041 (let ((livemedia-utils (assoc-ref inputs "livemedia-utils")))
2042 (substitute* "configure"
2043 (("LIVE555_PREFIX=\\$\\{LIVE555_PREFIX-\"/usr\"\\}")
2044 (string-append "LIVE555_PREFIX=" livemedia-utils)))
2045 ;; Some of the tests require using the display to test out VLC,
2046 ;; which fails in our sandboxed build system
2047 (substitute* "test/run_vlc.sh"
2048 (("./vlc --ignore-config") "echo"))
2049 #t)))
2050 (add-after 'strip 'regenerate-plugin-cache
2051 (lambda* (#:key outputs #:allow-other-keys)
2052 ;; The 'install-exec-hook' rule in the top-level Makefile.am
2053 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
2054 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
2055 ;; it references. Thus, we first reset the timestamps of all
2056 ;; these files, and then regenerate the cache such that the
2057 ;; mtimes it includes are always zero instead of being dependent
2058 ;; on the build time.
2059 (let* ((out (assoc-ref outputs "out"))
2060 (pkglibdir (string-append out "/lib/vlc"))
2061 (plugindir (string-append pkglibdir "/plugins"))
2062 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
2063 ;; TODO: Factorize 'reset-timestamps'.
2064 (for-each (lambda (file)
2065 (let ((s (lstat file)))
2066 (unless (eq? (stat:type s) 'symlink)
2067 (utime file 1 1))))
2068 (find-files plugindir))
2069 (invoke cachegen plugindir))))
2070 (add-after 'install 'wrap-executable
2071 (lambda* (#:key outputs #:allow-other-keys)
2072 (let ((out (assoc-ref outputs "out"))
2073 (plugin-path (getenv "QT_PLUGIN_PATH")))
2074 (wrap-program (string-append out "/bin/vlc")
2075 `("QT_PLUGIN_PATH" ":" prefix (,plugin-path))))
2076 #t)))))
2077 (home-page "https://www.videolan.org/")
2078 (synopsis "Audio and video framework")
2079 (description "VLC is a cross-platform multimedia player and framework
2080 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
2081 streaming protocols.")
2082 (properties
2083 '((release-monitoring-url . "https://download.videolan.org/pub/videolan/vlc/last")))
2084 (license license:gpl2+)))
2085
2086 (define-public mplayer
2087 (package
2088 (name "mplayer")
2089 (version "1.4")
2090 (source (origin
2091 (method url-fetch)
2092 (uri (string-append
2093 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
2094 version ".tar.xz"))
2095 (sha256
2096 (base32
2097 "0j5mflr0wnklxsvnpmxvk704hscyn2785hvvihj2i3a7b3anwnc2"))))
2098 (build-system gnu-build-system)
2099 ;; FIXME: Add additional inputs once available.
2100 (native-inputs
2101 (list pkg-config yasm))
2102 (inputs
2103 `(("alsa-lib" ,alsa-lib)
2104 ("cdparanoia" ,cdparanoia)
2105 ("ffmpeg" ,ffmpeg)
2106 ("fontconfig" ,fontconfig)
2107 ("freetype" ,freetype)
2108 ("giflib" ,giflib)
2109 ("lame" ,lame)
2110 ("libass" ,libass)
2111 ("libdvdcss" ,libdvdcss)
2112 ("libdvdnav" ,libdvdnav) ; ignored without libdvdread
2113 ("libdvdread" ,libdvdread) ; ignored without libdvdnav
2114 ("libjpeg" ,libjpeg-turbo)
2115 ("libmpeg2" ,libmpeg2)
2116 ("libmpg123" ,mpg123) ; audio codec for MP3
2117 ("libpng" ,libpng)
2118 ("libtheora" ,libtheora)
2119 ("libvdpau" ,libvdpau)
2120 ("libvorbis" ,libvorbis)
2121 ("libx11" ,libx11)
2122 ("libx264" ,libx264)
2123 ("libxinerama" ,libxinerama)
2124 ("libxv" ,libxv)
2125 ("libxxf86dga" ,libxxf86dga)
2126 ("mesa" ,mesa)
2127 ("opus" ,opus)
2128 ("perl" ,perl)
2129 ("pulseaudio" ,pulseaudio)
2130 ("python" ,python-wrapper)
2131 ("sdl" ,sdl)
2132 ("speex" ,speex)
2133 ("zlib" ,zlib)))
2134 (arguments
2135 `(#:tests? #f ; no test target
2136 #:phases
2137 (modify-phases %standard-phases
2138 (replace 'configure
2139 ;; configure does not work followed by "SHELL=..." and
2140 ;; "CONFIG_SHELL=..."; set environment variables instead
2141 (lambda* (#:key inputs outputs #:allow-other-keys)
2142 (let ((out (assoc-ref outputs "out"))
2143 (libx11 (assoc-ref inputs "libx11")))
2144 (substitute* "configure"
2145 (("#! /bin/sh") (string-append "#!" (which "sh"))))
2146 (setenv "SHELL" (which "bash"))
2147 (setenv "CONFIG_SHELL" (which "bash"))
2148 (invoke "./configure"
2149 (string-append "--extra-cflags=-I"
2150 libx11 "/include") ; to detect libx11
2151 "--disable-ffmpeg_a" ; disables bundled ffmpeg
2152 (string-append "--prefix=" out)
2153 ;; Enable runtime cpu detection where supported,
2154 ;; and choose a suitable target.
2155 ,@(match (or (%current-target-system)
2156 (%current-system))
2157 ("x86_64-linux"
2158 '("--enable-runtime-cpudetection"
2159 "--target=x86_64-linux"))
2160 ("i686-linux"
2161 '("--enable-runtime-cpudetection"
2162 "--target=i686-linux"))
2163 ("mips64el-linux"
2164 '("--target=mips3-linux"))
2165 (_ (list (string-append
2166 "--target="
2167 (or (%current-target-system)
2168 (nix-system->gnu-triplet
2169 (%current-system)))))))
2170 "--disable-iwmmxt")))))))
2171 (home-page "https://www.mplayerhq.hu")
2172 (synopsis "Audio and video player")
2173 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
2174 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
2175 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
2176 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
2177 (license license:gpl2)))
2178
2179 (define-public mpv
2180 (package
2181 (name "mpv")
2182 (version "0.35.0")
2183 (source (origin
2184 (method git-fetch)
2185 (uri (git-reference
2186 (url "https://github.com/mpv-player/mpv")
2187 (commit (string-append "v" version))))
2188 (file-name (git-file-name name version))
2189 (sha256
2190 (base32 "1jnk1arwhf82s6q90jp70izk1wy0bkx3lr3il2jgbqsp355l6wsk"))))
2191 (build-system waf-build-system)
2192 (arguments
2193 (list
2194 #:phases
2195 #~(modify-phases %standard-phases
2196 (add-after 'unpack 'patch-file-names
2197 (lambda* (#:key inputs #:allow-other-keys)
2198 (substitute* "player/lua/ytdl_hook.lua"
2199 (("\"yt-dlp\",")
2200 (string-append
2201 "\"" (search-input-file inputs "bin/yt-dlp") "\",")))))
2202 (add-before 'configure 'build-reproducibly
2203 (lambda _
2204 ;; Somewhere in the build system library dependencies are enumerated
2205 ;; and passed as linker flags, but the order in which they are added
2206 ;; varies. See <https://github.com/mpv-player/mpv/issues/7855>.
2207 ;; Set PYTHONHASHSEED as a workaround for deterministic results.
2208 (setenv "PYTHONHASHSEED" "1")))
2209 (add-before 'configure 'set-up-waf
2210 (lambda* (#:key inputs #:allow-other-keys)
2211 (copy-file (search-input-file inputs "bin/waf") "waf")
2212 (setenv "CC" #$(cc-for-target)))))
2213 #:configure-flags
2214 #~(list "--enable-libmpv-shared"
2215 "--enable-cdda"
2216 "--enable-dvdnav"
2217 "--disable-build-date")
2218 ;; No check function defined.
2219 #:tests? #f))
2220 (native-inputs
2221 (list perl ; for zsh completion file
2222 pkg-config python-docutils))
2223 ;; Missing features: libguess, V4L2.
2224 (inputs
2225 (list alsa-lib
2226 enca
2227 ffmpeg
2228 jack-1
2229 ladspa
2230 lcms
2231 libass
2232 libbluray
2233 libcaca
2234 libbs2b
2235 libcdio-paranoia
2236 libdvdread
2237 libdvdnav
2238 libjpeg-turbo
2239 libva
2240 libvdpau
2241 libx11
2242 libxext
2243 libxkbcommon
2244 libxinerama
2245 libxrandr
2246 libxscrnsaver
2247 libxv
2248 ;; XXX: lua > 5.2 is not currently supported; see
2249 ;; waftools/checks/custom.py
2250 lua-5.2
2251 mesa
2252 mpg123
2253 pulseaudio
2254 python-waf
2255 rsound
2256 shaderc
2257 vulkan-headers
2258 vulkan-loader
2259 wayland
2260 wayland-protocols
2261 yt-dlp
2262 zlib))
2263 (home-page "https://mpv.io/")
2264 (synopsis "Audio and video player")
2265 (description "mpv is a general-purpose audio and video player. It is a
2266 fork of mplayer2 and MPlayer. It shares some features with the former
2267 projects while introducing many more.")
2268 (license license:gpl2+)))
2269
2270 (define-public smplayer
2271 (package
2272 (name "smplayer")
2273 (version "21.10.0")
2274 (source (origin
2275 (method url-fetch)
2276 (uri (string-append
2277 "mirror://sourceforge/smplayer/SMPlayer/" version
2278 "/smplayer-" version ".tar.bz2"))
2279 (sha256
2280 (base32
2281 "12nvcl0cfix1xay9hfi7856vg4lpv8y5b0a22212bsjbvl5g22rc"))))
2282 (build-system qt-build-system)
2283 (native-inputs
2284 (list qttools-5))
2285 (inputs
2286 (list bash-minimal qtbase-5 zlib mpv))
2287 (arguments
2288 (list #:tests? #false ; no tests
2289 #:make-flags #~(list (string-append "PREFIX=" #$output)
2290 (string-append "CC=" #+(cc-for-target))
2291 ;; A KLUDGE to turn off invoking lrelease on the
2292 ;; project for now, because it fails consistently
2293 ;; with "WARNING: Could not find qmake spec
2294 ;; 'default'". See below.
2295 "LRELEASE=true")
2296 #:phases
2297 #~(modify-phases %standard-phases
2298 (delete 'configure)
2299 ;; Due to the above, we must run lrelease separately on each .ts file
2300 ;; (as opposed to running `lrelease-pro smplayer.pro` for the entire
2301 ;; project, as the Makefile does normally without the above kludge).
2302 (add-after 'build 'compile-ts-files
2303 (lambda _
2304 (for-each (lambda (file)
2305 (invoke "lrelease" file))
2306 (find-files "./" "\\.ts$"))))
2307 (add-after 'install 'wrap-executable
2308 (lambda* (#:key inputs outputs #:allow-other-keys)
2309 (let* ((out (assoc-ref outputs "out"))
2310 (mpv (assoc-ref inputs "mpv")))
2311 (wrap-program (string-append out "/bin/smplayer")
2312 `("PATH" ":" prefix
2313 ,(list (string-append mpv "/bin"))))))))))
2314 (home-page "https://www.smplayer.info")
2315 (synopsis "Complete front-end for MPlayer, a media player")
2316 (description "SMPlayer is a graphical user interface (GUI) for
2317 MPlayer, which is capable of playing almost all known video and audio
2318 formats. Apart from providing access for the most common and useful
2319 options of MPlayer, SMPlayer adds other interesting features like the
2320 possibility to play Youtube videos, download subtitles, remember
2321 the last played position, etc.")
2322 (license license:gpl2+)))
2323
2324 (define-public gallery-dl
2325 (package
2326 (name "gallery-dl")
2327 (version "1.23.0")
2328 (source (origin
2329 (method url-fetch)
2330 (uri (string-append "https://github.com/mikf/gallery-dl"
2331 "/releases/download/v" version "/gallery_dl-"
2332 version ".tar.gz"))
2333 (sha256
2334 (base32
2335 "12rhzf8cwsvlg0vxzydgc7x04gmccxkjk8ghb5s8lk0gjp7ysqkh"))))
2336 (build-system python-build-system)
2337 (inputs (list python-requests ffmpeg))
2338 (home-page "https://github.com/mikf/gallery-dl")
2339 (synopsis "Command-line program to download images from several sites")
2340 (description "Gallery-dl is a command-line program that downloads image
2341 galleries and collections from several image hosting sites. While this package
2342 can use youtube-dl or yt-dlp packages to download videos, the focus is more on
2343 images and image hosting sites.")
2344 (license license:gpl2)))
2345
2346 (define-public gnome-mpv
2347 (deprecated-package "gnome-mpv" celluloid))
2348
2349 (define-public mpv-mpris
2350 (package
2351 (name "mpv-mpris")
2352 (version "0.9")
2353 (source
2354 (origin
2355 (method git-fetch)
2356 (uri (git-reference
2357 (url "https://github.com/hoyon/mpv-mpris")
2358 (commit version)))
2359 (file-name (git-file-name name version))
2360 (sha256
2361 (base32 "1c7avpzcd3sry3q7g5spcl3ywybpjzl2gjarmnlrp74k4nhbprcm"))))
2362 (build-system copy-build-system)
2363 (arguments
2364 '(#:install-plan
2365 '(("mpris.so" "lib/"))
2366 #:phases
2367 (modify-phases %standard-phases
2368 (add-before 'install 'build
2369 (lambda _
2370 (setenv "CC" (which "gcc"))
2371 (invoke "make"))))))
2372 (native-inputs
2373 (list pkg-config))
2374 (inputs
2375 (list glib mpv))
2376 (home-page "https://github.com/hoyon/mpv-mpris")
2377 (synopsis "MPRIS plugin for mpv")
2378 (description "This package provides an @dfn{MPRIS} (Media Player Remote
2379 Interfacing Specification) plugin for the @code{mpv} media player. It implements
2380 @code{org.mpris.MediaPlayer2} and @code{org.mpris.MediaPlayer2.Player} D-Bus
2381 interfaces.
2382
2383 To load this plugin, specify the following option when starting mpv:
2384 @code{--script $GUIX_PROFILE/lib/mpris.so} or link it into
2385 @file{$HOME/.config/mpv/scripts}.")
2386 (license license:expat)))
2387
2388 (define-public libvpx
2389 (package
2390 (name "libvpx")
2391 (version "1.11.0")
2392 (source (origin
2393 (method git-fetch)
2394 (uri (git-reference
2395 (url "https://chromium.googlesource.com/webm/libvpx")
2396 (commit (string-append "v" version))))
2397 (file-name (git-file-name name version))
2398 (sha256
2399 (base32
2400 "00f1jrclai2b6ys78dpsg6r1mvcyxlna93vxcz8zjyia24c2pjsb"))
2401 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
2402 (build-system gnu-build-system)
2403 (arguments
2404 `(#:configure-flags (list "--enable-shared"
2405 "--disable-static"
2406 "--as=yasm"
2407 ;; Limit size to avoid CVE-2015-1258
2408 "--size-limit=16384x16384"
2409 (string-append "--prefix=" (assoc-ref %outputs "out")))
2410 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2411 (assoc-ref %outputs "out") "/lib"))
2412 #:phases (modify-phases %standard-phases
2413 (replace 'configure
2414 (lambda* (#:key configure-flags #:allow-other-keys)
2415 ;; The configure script does not understand some of the GNU
2416 ;; options, so we only add the flags specified above.
2417 (apply invoke "./configure" configure-flags))))
2418
2419 ;; XXX: The test suite wants to download 871 files from a cloud storage
2420 ;; service (see test/test-data.sha1). It is possible to specify a
2421 ;; custom directory, but there seems to be no tarball with all files.
2422 #:tests? #f))
2423 (native-inputs
2424 (list perl yasm))
2425 (synopsis "VP8/VP9 video codec")
2426 (description "libvpx is a codec for the VP8/VP9 video compression format.")
2427 (license license:bsd-3)
2428 (home-page "https://www.webmproject.org/")))
2429
2430 ;;; TODO: Merge into libvpx on staging.
2431 (define-public libvpx-next
2432 (package
2433 (inherit libvpx)
2434 (name "libvpx")
2435 (version "1.12.0")
2436 (source (origin
2437 (inherit (package-source libvpx))
2438 (uri (git-reference
2439 (url "https://chromium.googlesource.com/webm/libvpx")
2440 (commit (string-append "v" version))))
2441 (file-name (git-file-name name version))
2442 (sha256
2443 (base32
2444 "1x12f2bd4jqd532rnixmwvcx8d29yxiacpcxqqh86qczc49la8gm"))))))
2445
2446 (define-public youtube-dl
2447 (package
2448 (name "youtube-dl")
2449 (version "2021.12.17")
2450 (source (origin
2451 (method url-fetch)
2452 (uri (string-append "https://youtube-dl.org/downloads/latest/"
2453 "youtube-dl-" version ".tar.gz"))
2454 (sha256
2455 (base32
2456 "1prm84ci1n1kjzhikhrsbxbgziw6br822psjnijm2ibqnz49jfwz"))
2457 (snippet
2458 '(begin
2459 ;; Delete the pre-generated files, except for the man page
2460 ;; which requires 'pandoc' to build.
2461 (for-each delete-file '("youtube-dl"
2462 ;;pandoc is needed to generate
2463 ;;"youtube-dl.1"
2464 "youtube-dl.bash-completion"
2465 "youtube-dl.fish"
2466 "youtube-dl.zsh"))))))
2467 (build-system python-build-system)
2468 (arguments
2469 ;; The problem here is that the directory for the man page and completion
2470 ;; files is relative, and for some reason, setup.py uses the
2471 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
2472 ;; So, we need pass the prefix directly. In addition, make sure the Bash
2473 ;; completion file is called 'youtube-dl' rather than
2474 ;; 'youtube-dl.bash-completion'.
2475 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
2476 #:phases (modify-phases %standard-phases
2477 (add-after 'unpack 'default-to-the-ffmpeg-input
2478 (lambda _
2479 ;; See <https://issues.guix.gnu.org/43418#5>.
2480 ;; ffmpeg is big but required to request free formats
2481 ;; from, e.g., YouTube so pull it in unconditionally.
2482 ;; Continue respecting the --ffmpeg-location argument.
2483 (substitute* "youtube_dl/postprocessor/ffmpeg.py"
2484 (("\\.get\\('ffmpeg_location'\\)" match)
2485 (format #f "~a or '~a'" match (which "ffmpeg"))))))
2486 (add-before 'build 'build-generated-files
2487 (lambda _
2488 ;; Avoid the make targets that require pandoc.
2489 (invoke "make"
2490 "PYTHON=python"
2491 "youtube-dl"
2492 ;;"youtube-dl.1" ; needs pandoc
2493 "youtube-dl.bash-completion"
2494 "youtube-dl.zsh"
2495 "youtube-dl.fish")))
2496 (add-before 'install 'fix-the-data-directories
2497 (lambda* (#:key outputs #:allow-other-keys)
2498 (let ((prefix (assoc-ref outputs "out")))
2499 (mkdir "bash-completion")
2500 (rename-file "youtube-dl.bash-completion"
2501 "bash-completion/youtube-dl")
2502 (substitute* "setup.py"
2503 (("youtube-dl\\.bash-completion")
2504 "bash-completion/youtube-dl")
2505 (("'etc/")
2506 (string-append "'" prefix "/etc/"))
2507 (("'share/")
2508 (string-append "'" prefix "/share/"))))))
2509 (add-after 'install 'install-completion
2510 (lambda* (#:key outputs #:allow-other-keys)
2511 (let* ((out (assoc-ref outputs "out"))
2512 (zsh (string-append out
2513 "/share/zsh/site-functions")))
2514 (mkdir-p zsh)
2515 (copy-file "youtube-dl.zsh"
2516 (string-append zsh "/_youtube-dl"))))))))
2517 (native-inputs
2518 (list zip))
2519 (inputs
2520 (list ffmpeg))
2521 (synopsis "Download videos from YouTube.com and other sites")
2522 (description
2523 "Youtube-dl is a small command-line program to download videos from
2524 YouTube.com and many more sites.")
2525 (home-page "https://yt-dl.org")
2526 (properties '((release-monitoring-url . "https://yt-dl.org/downloads/")))
2527 (license license:public-domain)))
2528
2529 (define-public yt-dlp
2530 (package/inherit youtube-dl
2531 (name "yt-dlp")
2532 (version "2022.10.04")
2533 (source
2534 (origin
2535 (method git-fetch)
2536 (uri (git-reference
2537 (url "https://github.com/yt-dlp/yt-dlp/")
2538 (commit version)))
2539 (file-name (git-file-name name version))
2540 (sha256
2541 (base32 "0g2nvslzb9yx2axv6yqxdcdh49ckyipyy9apx1lx6bg6y9rjvx6v"))))
2542 (arguments
2543 (substitute-keyword-arguments (package-arguments youtube-dl)
2544 ((#:tests? _) (not (%current-target-system)))
2545 ((#:phases phases)
2546 #~(modify-phases #$phases
2547 ;; See the comment for the corresponding phase in youtube-dl.
2548 (replace 'default-to-the-ffmpeg-input
2549 (lambda _
2550 (substitute* "yt_dlp/postprocessor/ffmpeg.py"
2551 (("\\.get_param\\('ffmpeg_location'\\)" match)
2552 (format #f "~a or '~a'" match (which "ffmpeg"))))))
2553 (replace 'build-generated-files
2554 (lambda* (#:key inputs #:allow-other-keys)
2555 (if (assoc-ref inputs "pandoc")
2556 (invoke "make"
2557 "PYTHON=python"
2558 "yt-dlp"
2559 "yt-dlp.1"
2560 "completions")
2561 (invoke "make"
2562 "PYTHON=python"
2563 "yt-dlp"
2564 "completions"))))
2565 (replace 'fix-the-data-directories
2566 (lambda* (#:key outputs #:allow-other-keys)
2567 (let ((prefix (assoc-ref outputs "out")))
2568 (substitute* "setup.py"
2569 (("'etc/")
2570 (string-append "'" prefix "/etc/"))
2571 (("'share/")
2572 (string-append "'" prefix "/share/"))))))
2573 (delete 'install-completion)
2574 (replace 'check
2575 (lambda* (#:key tests? #:allow-other-keys)
2576 (when tests?
2577 (invoke "pytest" "-k" "not download"))))))))
2578 (inputs (modify-inputs (package-inputs youtube-dl)
2579 (append python-brotli
2580 python-certifi
2581 python-mutagen
2582 python-pycryptodomex
2583 python-websockets)))
2584 (native-inputs
2585 (append
2586 ;; To generate the manpage.
2587 (if (member (%current-system)
2588 (package-transitive-supported-systems pandoc))
2589 (list pandoc)
2590 '())
2591 (list python-pytest zip)))
2592 (description
2593 "yt-dlp is a small command-line program to download videos from
2594 YouTube.com and many more sites. It is a fork of youtube-dl with a
2595 focus on adding new features while keeping up-to-date with the
2596 original project.")
2597 (properties '((release-monitoring-url . "https://pypi.org/project/yt-dlp/")))
2598 (home-page "https://github.com/yt-dlp/yt-dlp")))
2599
2600 (define-public you-get
2601 (package
2602 (name "you-get")
2603 (version "0.4.1555")
2604 (source (origin
2605 (method git-fetch)
2606 (uri (git-reference
2607 (url "https://github.com/soimort/you-get")
2608 (commit (string-append "v" version))))
2609 (file-name (git-file-name name version))
2610 (sha256
2611 (base32
2612 "0gn86i6nfsw395r9a3i88nv2g08s5bgjps7w4qawb9gvk4h7zqap"))))
2613 (build-system python-build-system)
2614 (inputs
2615 (list ffmpeg)) ; for multi-part and >=1080p videos
2616 (arguments
2617 `(#:phases
2618 (modify-phases %standard-phases
2619 (add-after 'unpack 'qualify-input-references
2620 ;; Explicitly invoke the input ffmpeg, instead of whichever one
2621 ;; happens to be in the user's $PATH at run time.
2622 (lambda* (#:key inputs #:allow-other-keys)
2623 (let ((ffmpeg (search-input-file inputs "/bin/ffmpeg")))
2624 (substitute* "src/you_get/processor/ffmpeg.py"
2625 ;; Don't blindly replace all occurrences of ‘'ffmpeg'’: the
2626 ;; same string is also used when sniffing ffmpeg's output.
2627 (("(FFMPEG == |\\()'ffmpeg'" _ prefix)
2628 (string-append prefix "'" ffmpeg "'")))))))
2629 #:tests? #f)) ; XXX some tests need Internet access
2630 (synopsis "Download videos, audio, or images from Web sites")
2631 (description
2632 "You-Get is a command-line utility to download media contents (videos,
2633 audio, images) from the Web. It can use either mpv or vlc for playback.")
2634 (home-page "https://you-get.org/")
2635 (license license:expat)))
2636
2637 (define-public youtube-viewer
2638 (package
2639 (name "youtube-viewer")
2640 (version "3.8.1")
2641 (source (origin
2642 (method git-fetch)
2643 (uri (git-reference
2644 (url "https://github.com/trizen/youtube-viewer")
2645 (commit version)))
2646 (file-name (git-file-name name version))
2647 (sha256
2648 (base32
2649 "0xdybiihd66b79rbsawjhxs9snm78gld5ziz3gnp8vdcw0bshwz7"))))
2650 (build-system perl-build-system)
2651 (native-inputs
2652 (list perl-module-build))
2653 (inputs
2654 (list perl-data-dump
2655 perl-file-sharedir
2656 perl-gtk2
2657 perl-json
2658 perl-json-xs
2659 perl-libwww
2660 perl-lwp-protocol-https
2661 perl-lwp-useragent-cached
2662 perl-memoize
2663 perl-mozilla-ca
2664 perl-term-readline-gnu
2665 perl-unicode-linebreak
2666 xdg-utils
2667 ;; Some videos play without youtube-dl, but others silently fail to.
2668 youtube-dl))
2669 (arguments
2670 `(#:modules ((guix build perl-build-system)
2671 (guix build utils)
2672 (srfi srfi-26))
2673 ;; gtk-2/3 variants are both installed by default but the gtk3 variant
2674 ;; is broken without perl-gtk3.
2675 #:module-build-flags '("--gtk2")
2676 #:phases
2677 (modify-phases %standard-phases
2678 (add-after 'unpack 'refer-to-inputs
2679 (lambda* (#:key inputs #:allow-other-keys)
2680 (substitute* "lib/WWW/YoutubeViewer.pm"
2681 (("'youtube-dl'")
2682 (format #f "'~a/bin/youtube-dl'"
2683 (assoc-ref inputs "youtube-dl"))))
2684 (substitute* '("bin/gtk2-youtube-viewer"
2685 "bin/gtk3-youtube-viewer")
2686 (("'xdg-open'")
2687 (format #f "'~a/bin/xdg-open'"
2688 (assoc-ref inputs "xdg-utils"))))
2689 #t))
2690 (add-after 'install 'install-desktop
2691 (lambda* (#:key outputs #:allow-other-keys)
2692 (let* ((out (assoc-ref outputs "out"))
2693 (sharedir (string-append out "/share")))
2694 (install-file "share/gtk-youtube-viewer.desktop"
2695 (string-append sharedir "/applications"))
2696 (install-file "share/icons/gtk-youtube-viewer.png"
2697 (string-append sharedir "/pixmaps"))
2698 #t)))
2699 (add-after 'install 'wrap-program
2700 (lambda* (#:key outputs #:allow-other-keys)
2701 (let* ((out (assoc-ref outputs "out"))
2702 (bin-dir (string-append out "/bin/"))
2703 (site-dir (string-append out "/lib/perl5/site_perl/"))
2704 (lib-path (getenv "PERL5LIB")))
2705 (for-each (cut wrap-program <>
2706 `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
2707 (find-files bin-dir))
2708 #t))))))
2709 (synopsis
2710 "Lightweight application for searching and streaming videos from YouTube")
2711 (description
2712 "Youtube-viewer searches and plays YouTube videos in a native player.
2713 It comes with various search options; it can search for videos, playlists
2714 and/or channels. The videos are streamed directly in a selected video player
2715 at the best resolution (customizable) and with closed-captions (if available).
2716 Both command-line and GTK2 interface are available.")
2717 (home-page "https://github.com/trizen/youtube-viewer")
2718 (license license:perl-license)))
2719
2720 (define-public libbluray
2721 (package
2722 (name "libbluray")
2723 (version "1.0.2")
2724 (source (origin
2725 (method url-fetch)
2726 (uri (string-append "https://download.videolan.org/videolan/"
2727 name "/" version "/"
2728 name "-" version ".tar.bz2"))
2729 (sha256
2730 (base32
2731 "1zxfnw1xbghcj7b3zz5djndv6gwssxda19cz1lrlqrkg8577r7kd"))))
2732 (build-system gnu-build-system)
2733 (arguments
2734 `(#:configure-flags '("--disable-bdjava-jar"
2735 "--disable-static")
2736 #:phases
2737 (modify-phases %standard-phases
2738 (add-after 'unpack 'refer-to-libxml2-in-.pc-file
2739 ;; Avoid the need to propagate libxml2 by referring to it
2740 ;; directly, as is already done for fontconfig & freetype.
2741 (lambda* (#:key inputs #:allow-other-keys)
2742 (let ((libxml2 (assoc-ref inputs "libxml2")))
2743 (substitute* "configure"
2744 ((" libxml-2.0") ""))
2745 (substitute* "src/libbluray.pc.in"
2746 (("^Libs.private:" field)
2747 (string-append field " -L" libxml2 "/lib -lxml2")))
2748 #t)))
2749 (add-before 'build 'fix-dlopen-paths
2750 (lambda* (#:key inputs #:allow-other-keys)
2751 (let ((libaacs (assoc-ref inputs "libaacs"))
2752 (libbdplus (assoc-ref inputs "libbdplus")))
2753 (substitute* "src/libbluray/disc/aacs.c"
2754 (("\"libaacs\"")
2755 (string-append "\"" libaacs "/lib/libaacs\"")))
2756 (substitute* "src/libbluray/disc/bdplus.c"
2757 (("\"libbdplus\"")
2758 (string-append "\"" libbdplus "/lib/libbdplus\"")))
2759 #t))))))
2760 (native-inputs (list pkg-config))
2761 (inputs
2762 `(("fontconfig" ,fontconfig)
2763 ("freetype" ,freetype)
2764 ("libaacs" ,libaacs)
2765 ("libbdplus" ,libbdplus)
2766 ("libxml2" ,libxml2)))
2767 (home-page "https://www.videolan.org/developers/libbluray.html")
2768 (synopsis "Blu-Ray Disc playback library")
2769 (description
2770 "libbluray is a library designed for Blu-Ray Disc playback for media
2771 players, like VLC or MPlayer.")
2772 (license license:lgpl2.1+)))
2773
2774 (define-public libdvdread
2775 (package
2776 (name "libdvdread")
2777 (version "6.0.2")
2778 (source (origin
2779 (method url-fetch)
2780 (uri (string-append "https://download.videolan.org/videolan/"
2781 "libdvdread/" version "/"
2782 "libdvdread-" version ".tar.bz2"))
2783 (sha256
2784 (base32
2785 "1c7yqqn67m3y3n7nfrgrnzz034zjaw5caijbwbfrq89v46ph257r"))))
2786 (build-system gnu-build-system)
2787 (arguments
2788 `(#:configure-flags '("--with-libdvdcss=yes")))
2789 (native-inputs
2790 (list pkg-config))
2791 (propagated-inputs
2792 (list libdvdcss))
2793 (home-page "http://dvdnav.mplayerhq.hu/")
2794 (synopsis "Library for reading video DVDs")
2795 (description
2796 "Libdvdread provides a simple foundation for reading DVD video
2797 disks. It provides the functionality that is required to access many
2798 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
2799 authentication and descrambling (if an external libdvdcss library is
2800 installed).")
2801 (license license:gpl2+)))
2802
2803 (define-public dvdauthor
2804 (package
2805 (name "dvdauthor")
2806 (version "0.7.2")
2807 (source
2808 (origin
2809 (method url-fetch)
2810 (uri (string-append "mirror://sourceforge/dvdauthor/dvdauthor-"
2811 version ".tar.gz"))
2812 (sha256
2813 (base32
2814 "1drfc47hikfzc9d7hjk34rw10iqw01d2vwmn91pv73ppx4nsj81h"))))
2815 (build-system gnu-build-system)
2816 (inputs
2817 (list libdvdread libpng imagemagick libxml2 freetype))
2818 (native-inputs
2819 (list pkg-config))
2820 (synopsis "Generates a DVD-Video movie from a MPEG-2 stream")
2821 (description "@command{dvdauthor} will generate a DVD-Video movie from a
2822 MPEG-2 stream containing VOB packets.")
2823 (home-page "http://dvdauthor.sourceforge.net")
2824 (license license:gpl3+)))
2825
2826 (define-public libdvdnav
2827 (package
2828 (name "libdvdnav")
2829 (version "6.0.1")
2830 (source (origin
2831 (method url-fetch)
2832 (uri (string-append "https://download.videolan.org/videolan/"
2833 "libdvdnav/" version "/"
2834 "libdvdnav-" version ".tar.bz2"))
2835 (sha256
2836 (base32
2837 "0cv7j8irsv1n2dadlnhr6i1b8pann2ah6xpxic41f04my6ba6rp5"))))
2838 (build-system gnu-build-system)
2839 (native-inputs
2840 (list pkg-config))
2841 (inputs
2842 (list libdvdread))
2843 (home-page "http://dvdnav.mplayerhq.hu/")
2844 (synopsis "Library for video DVD navigation features")
2845 (description
2846 "Libdvdnav is a library for developers of multimedia
2847 applications. It allows easy use of sophisticated DVD navigation features
2848 such as DVD menus, multiangle playback and even interactive DVD games. All
2849 this functionality is provided through a simple API which provides the DVD
2850 playback as a single logical stream of blocks, intermitted by special
2851 dvdnav events to report certain conditions. The main usage of libdvdnav is
2852 a loop regularly calling a function to get the next block, surrounded by
2853 additional calls to tell the library of user interaction. The whole
2854 DVD virtual machine and internal playback states are completely
2855 encapsulated.")
2856 (license license:gpl2+)))
2857
2858 (define-public libdvdcss
2859 (package
2860 (name "libdvdcss")
2861 (version "1.4.3")
2862 (source (origin
2863 (method url-fetch)
2864 (uri (string-append "https://download.videolan.org/pub/"
2865 name "/" version "/"
2866 name "-" version ".tar.bz2"))
2867 (sha256
2868 (base32
2869 "0y800y33spblb20s1lsjbaiybknmwwmmiczmjqx5s760blpwjg13"))))
2870 (build-system gnu-build-system)
2871 (home-page "https://www.videolan.org/developers/libdvdcss.html")
2872 (synopsis "Library for accessing DVDs as block devices")
2873 (description
2874 "libdvdcss is a simple library designed for accessing DVDs like a block
2875 device without having to bother about the decryption.")
2876 (license license:gpl2+)))
2877
2878 (define-public srt2vtt
2879 (package
2880 (name "srt2vtt")
2881 (version "0.2")
2882 (source (origin
2883 (method url-fetch)
2884 (uri (string-append
2885 "https://files.dthompson.us/srt2vtt/srt2vtt-"
2886 version ".tar.gz"))
2887 (sha256
2888 (base32
2889 "1ravl635x81fcai4h2xnsn926i69pafgr6zkghq6319iprkw8ffv"))))
2890 (build-system gnu-build-system)
2891 (arguments
2892 `(#:phases
2893 (modify-phases %standard-phases
2894 (add-after 'install 'wrap-srt2vtt
2895 (lambda* (#:key outputs #:allow-other-keys)
2896 (let* ((out (assoc-ref outputs "out"))
2897 (bin (string-append out "/bin"))
2898 (version ,(let ((v (package-version guile-3.0)))
2899 (string-append (car (string-split v #\.))
2900 ".0")))
2901 (site (string-append out "/share/guile/site/" version))
2902 (compiled (string-append
2903 out "/lib/guile/" version
2904 "/site-ccache")))
2905 (wrap-program (string-append bin "/srt2vtt")
2906 `("GUILE_LOAD_PATH" ":" prefix (,site))
2907 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,compiled)))))))))
2908 (native-inputs
2909 (list pkg-config))
2910 (inputs
2911 (list guile-3.0))
2912 (synopsis "SubRip to WebVTT subtitle converter")
2913 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
2914 for use with HTML5 video.")
2915 (home-page "https://dthompson.us/projects/srt2vtt.html")
2916 (license license:gpl3+)))
2917
2918 (define-public avidemux
2919 (package
2920 (name "avidemux")
2921 (version "2.7.8")
2922 (source (origin
2923 (method url-fetch)
2924 (uri (string-append
2925 "mirror://sourceforge/avidemux/avidemux/" version "/"
2926 "avidemux_" version ".tar.gz"))
2927 (sha256
2928 (base32
2929 "00blv5455ry3bb86zyzk1xmq3rbqmbif62khc0kq3whza97l12k2"))
2930 (patches (search-patches "avidemux-install-to-lib.patch"))))
2931 (build-system cmake-build-system)
2932 (native-inputs
2933 `(("perl" ,perl)
2934 ("pkg-config" ,pkg-config)
2935 ("python" ,python-wrapper)
2936 ("qttools-5" ,qttools-5)
2937 ("yasm" ,yasm)))
2938 ;; FIXME: Once packaged, add libraries not found during the build.
2939 (inputs
2940 `(("alsa-lib" ,alsa-lib)
2941 ("fontconfig" ,fontconfig)
2942 ("freetype" ,freetype)
2943 ("fribidi" ,fribidi)
2944 ("glu" ,glu)
2945 ("jack" ,jack-1)
2946 ("lame" ,lame)
2947 ("libaom" ,libaom)
2948 ("libva" ,libva)
2949 ("libvdpau" ,libvdpau)
2950 ("libvorbis" ,libvorbis)
2951 ("libvpx" ,libvpx)
2952 ("libxv" ,libxv)
2953 ("pulseaudio" ,pulseaudio)
2954 ("qtbase" ,qtbase-5)
2955 ("sqlite" ,sqlite)
2956 ("zlib" ,zlib)))
2957 (arguments
2958 `(#:tests? #f ; no check target
2959 #:phases
2960 ;; Make sure files inside the included ffmpeg tarball are
2961 ;; patch-shebanged.
2962 (let ((ffmpeg "ffmpeg-4.2.4"))
2963 (modify-phases %standard-phases
2964 (add-before 'patch-source-shebangs 'unpack-ffmpeg
2965 (lambda _
2966 (with-directory-excursion "avidemux_core/ffmpeg_package"
2967 (invoke "tar" "xf" (string-append ffmpeg ".tar.bz2"))
2968 (delete-file (string-append ffmpeg ".tar.bz2")))
2969 #t))
2970 (add-after 'patch-source-shebangs 'repack-ffmpeg
2971 (lambda _
2972 (with-directory-excursion "avidemux_core/ffmpeg_package"
2973 (substitute* (string-append ffmpeg "/configure")
2974 (("#! /bin/sh") (string-append "#!" (which "sh"))))
2975 (invoke "tar" "cjf" (string-append ffmpeg ".tar.bz2") ffmpeg
2976 ;; avoid non-determinism in the archive
2977 "--sort=name" "--mtime=@0"
2978 "--owner=root:0" "--group=root:0")
2979 (delete-file-recursively ffmpeg))
2980 #t))
2981 (replace 'configure
2982 (lambda _
2983 ;; Copy-paste settings from the cmake build system.
2984 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
2985 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
2986 #t))
2987 (replace 'build
2988 (lambda* (#:key inputs outputs #:allow-other-keys)
2989 (let* ((out (assoc-ref outputs "out"))
2990 (lib (string-append out "/lib"))
2991 (top (getcwd))
2992 (build_component
2993 (lambda* (component srcdir #:optional (args '()))
2994 (let ((builddir (string-append "build_" component)))
2995 (mkdir builddir)
2996 (with-directory-excursion builddir
2997 (apply invoke "cmake"
2998 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
2999 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
3000 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
3001 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
3002 "\"-Wl,-rpath=" lib "\"")
3003 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
3004 (string-append "../" srcdir)
3005 "-DENABLE_QT5=True"
3006 args)
3007 (invoke "make" "-j"
3008 (number->string (parallel-job-count)))
3009 (invoke "make" "install"))))))
3010 (mkdir out)
3011 (build_component "core" "avidemux_core")
3012 (build_component "cli" "avidemux/cli")
3013 (build_component "qt4" "avidemux/qt4")
3014 (build_component "plugins_common" "avidemux_plugins"
3015 '("-DPLUGIN_UI=COMMON"))
3016 (build_component "plugins_cli" "avidemux_plugins"
3017 '("-DPLUGIN_UI=CLI"))
3018 (build_component "plugins_qt4" "avidemux_plugins"
3019 '("-DPLUGIN_UI=QT4"))
3020 (build_component "plugins_settings" "avidemux_plugins"
3021 '("-DPLUGIN_UI=SETTINGS"))
3022 ;; Remove .exe and .dll file.
3023 (delete-file-recursively
3024 (string-append out "/share/ADM6_addons"))
3025 #t)))
3026 (delete 'install)))))
3027 (home-page "http://fixounet.free.fr/avidemux/")
3028 (synopsis "Video editor")
3029 (description "Avidemux is a video editor designed for simple cutting,
3030 filtering and encoding tasks. It supports many file types, including AVI,
3031 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
3032 can be automated using projects, job queue and powerful scripting
3033 capabilities.")
3034 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
3035 ;; Software with various licenses is included, see License.txt.
3036 (license license:gpl2+)))
3037
3038 (define-public vapoursynth
3039 (package
3040 (name "vapoursynth")
3041 (version "53")
3042 (source (origin
3043 (method git-fetch)
3044 (uri (git-reference
3045 (url "https://github.com/vapoursynth/vapoursynth")
3046 (commit (string-append "R" version))))
3047 (file-name (git-file-name name version))
3048 (sha256
3049 (base32
3050 "0qcsfkpkry0cmvi60khjwvfz4fqhy23nqmn4pb9qrwll26sn9dcr"))))
3051 (build-system gnu-build-system)
3052 (arguments
3053 `(#:phases
3054 (modify-phases %standard-phases
3055 (add-after 'install 'wrap
3056 (lambda* (#:key outputs #:allow-other-keys)
3057 (let* ((out (assoc-ref outputs "out"))
3058 (site (string-append out "/lib/python"
3059 ,(version-major+minor
3060 (package-version python))
3061 "/site-packages")))
3062 (wrap-program (string-append out "/bin/vspipe")
3063 `("PYTHONPATH" ":" = (,site)))))))))
3064 (native-inputs
3065 `(("autoconf" ,autoconf)
3066 ("automake" ,automake)
3067 ("cython" ,python-cython)
3068 ("libtool" ,libtool)
3069 ("pkg-config" ,pkg-config)
3070 ("yasm" ,yasm)))
3071 (inputs
3072 (list ffmpeg libass python tesseract-ocr zimg))
3073 (home-page "http://www.vapoursynth.com/")
3074 (synopsis "Video processing framework")
3075 (description "VapourSynth is a C++ library and Python module for video
3076 manipulation. It aims to be a modern rewrite of Avisynth, supporting
3077 multithreading, generalized colorspaces, per frame properties, and videos with
3078 format changes.")
3079 ;; src/core/cpufeatures only allows x86, ARM or PPC
3080 (supported-systems (fold delete %supported-systems
3081 '("mips64el-linux" "aarch64-linux")))
3082 ;; As seen from the source files.
3083 (license license:lgpl2.1+)))
3084
3085 (define-public xvid
3086 (package
3087 (name "xvid")
3088 (version "1.3.7")
3089 (source (origin
3090 (method url-fetch)
3091 (uri (string-append
3092 "http://downloads.xvid.com/downloads/xvidcore-"
3093 version ".tar.bz2"))
3094 (sha256
3095 (base32
3096 "1xyg3amgg27zf7188kss7y248s0xhh1vv8rrk0j9bcsd5nasxsmf"))))
3097 (build-system gnu-build-system)
3098 (native-inputs (list yasm))
3099 (arguments
3100 '(#:phases
3101 (modify-phases %standard-phases
3102 (add-before 'configure 'pre-configure
3103 (lambda _
3104 (chdir "build/generic")
3105 (substitute* "configure"
3106 (("#! /bin/sh") (string-append "#!" (which "sh"))))
3107 #t)))
3108 #:tests? #f)) ; no test suite
3109 (home-page "https://www.xvid.com/")
3110 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
3111 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
3112 codec library. It uses ASP features such as b-frames, global and quarter
3113 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
3114 and custom quantization matrices.")
3115 (license license:gpl2+)))
3116
3117 (define-public streamlink
3118 (package
3119 (name "streamlink")
3120 (version "3.2.0")
3121 (source
3122 (origin
3123 (method url-fetch)
3124 (uri (pypi-uri "streamlink" version))
3125 (sha256
3126 (base32
3127 "09nrspga15svzi0hmakcarbciav0nzf30hg1ff53gia473cd4w4p"))))
3128 (build-system python-build-system)
3129 (arguments
3130 `(#:phases (modify-phases %standard-phases
3131 (replace 'check
3132 (lambda* (#:key tests? #:allow-other-keys)
3133 (when tests?
3134 (invoke "python" "-m" "pytest")))))))
3135 (native-inputs
3136 (list python-freezegun python-mock python-pytest
3137 python-requests-mock))
3138 (propagated-inputs
3139 (list python-pysocks
3140 python-websocket-client
3141 python-isodate
3142 python-lxml-4.7
3143 python-pycountry
3144 python-pycryptodome
3145 python-requests
3146 python-urllib3))
3147 (home-page "https://github.com/streamlink/streamlink")
3148 (synopsis "Extract streams from various services")
3149 (description "Streamlink is command-line utility that extracts streams
3150 from sites like Twitch.tv and pipes them into a video player of choice.")
3151 (license license:bsd-2)))
3152
3153 (define-public twitchy
3154 (let ((commit "9beb36d80b16662414129693e74fa3a2fd97554e")) ; 3.4 has no tag
3155 (package
3156 (name "twitchy")
3157 (version (git-version "3.4" "1" commit))
3158 (source
3159 (origin
3160 (method git-fetch)
3161 (uri (git-reference
3162 (url "https://github.com/BasioMeusPuga/twitchy")
3163 (commit commit)))
3164 (file-name (git-file-name name version))
3165 (sha256
3166 (base32
3167 "0di03h1j9ipp2bbnxxlxz07v87icyg2hmnsr4s7184z5ql8kpzr7"))))
3168 (build-system python-build-system)
3169 (arguments
3170 '(#:phases
3171 (modify-phases %standard-phases
3172 (add-after 'unpack 'patch-paths
3173 (lambda* (#:key inputs #:allow-other-keys)
3174 (substitute* "twitchy/twitchy_play.py"
3175 (("\"streamlink ")
3176 (string-append "\"" (assoc-ref inputs "streamlink")
3177 "/bin/streamlink ")))
3178 #t))
3179 (add-before 'check 'check-setup
3180 (lambda _
3181 (setenv "HOME" (getcwd)) ;Needs to write to ‘$HOME’.
3182 #t))
3183 (add-after 'install 'install-rofi-plugin
3184 (lambda* (#:key outputs #:allow-other-keys)
3185 (install-file "plugins/rofi-twitchy"
3186 (string-append (assoc-ref outputs "out")
3187 "/bin"))
3188 #t)))))
3189 (inputs
3190 (list python-requests streamlink))
3191 (home-page "https://github.com/BasioMeusPuga/twitchy")
3192 (synopsis "Command-line interface for Twitch.tv")
3193 (description
3194 "This package provides a command-line interface for Twitch.tv")
3195 (license license:gpl3+))))
3196
3197 (define-public mlt
3198 (package
3199 (name "mlt")
3200 (version "7.8.0")
3201 (source
3202 (origin
3203 (method git-fetch)
3204 (uri (git-reference
3205 (url "https://github.com/mltframework/mlt")
3206 (commit (string-append "v" version))))
3207 (file-name (git-file-name name version))
3208 (sha256
3209 (base32 "01589xpx1vgx1l1zjg553nbjks5wy31rdvyq1sjnbp9w7p7nzjdg"))))
3210 (build-system cmake-build-system)
3211 (arguments
3212 (list
3213 #:tests? #f ;requires "Kwalify"
3214 #:phases
3215 #~(modify-phases %standard-phases
3216 (add-before 'configure 'override-LDFLAGS
3217 (lambda _
3218 (setenv "LDFLAGS"
3219 (string-append "-Wl,-rpath=" #$output "/lib"))))
3220 (add-after 'install 'wrap-executable
3221 (lambda _
3222 (let* ((frei0r #$(this-package-input "frei0r-plugins"))
3223 (ladspa #$(this-package-input "ladspa"))
3224 ;; In MLT 7, 'melt' symlinks to 'melt-7'. Try to keep
3225 ;; compatibility with MLT 6 where it's only 'melt'.
3226 (major #$(version-major version))
3227 (exec (if (file-exists?
3228 (string-append #$output "/bin/melt-" major))
3229 (string-append "melt-" major)
3230 "melt")))
3231 (wrap-program (string-append #$output "/bin/" exec)
3232 `("FREI0R_PATH" ":" =
3233 (,(string-append frei0r "/lib/frei0r-1")))
3234 `("LADSPA_PATH" ":" =
3235 (,(string-append ladspa "/lib/ladspa"))))))))))
3236 (inputs
3237 (list alsa-lib
3238 `(,alsa-plugins "pulseaudio")
3239 bash-minimal
3240 ffmpeg
3241 fftw
3242 frei0r-plugins
3243 gdk-pixbuf
3244 gtk+
3245 libxml2
3246 jack-1
3247 ladspa
3248 libebur128
3249 libexif
3250 libvorbis
3251 rubberband
3252 libsamplerate
3253 pulseaudio
3254 qtbase-5
3255 qtsvg-5
3256 rtaudio
3257 sdl2
3258 sdl2-image
3259 sox
3260 vidstab))
3261 (native-inputs
3262 (list pkg-config))
3263 (home-page "https://www.mltframework.org/")
3264 (synopsis "Author, manage, and run multitrack audio/video compositions")
3265 (description
3266 "MLT is a multimedia framework, designed and developed for television
3267 broadcasting. It provides a toolkit for broadcasters, video editors, media
3268 players, transcoders, web streamers and many more types of applications. The
3269 functionality of the system is provided via an assortment of ready to use
3270 tools, XML authoring components, and an extensible plug-in based API.")
3271 (license license:lgpl2.1+)))
3272
3273 (define-public mlt-6
3274 (package
3275 (inherit mlt)
3276 (name "mlt")
3277 (version "6.26.1")
3278 (source
3279 (origin
3280 (method git-fetch)
3281 (uri (git-reference
3282 (url "https://github.com/mltframework/mlt")
3283 (commit (string-append "v" version))))
3284 (file-name (git-file-name name version))
3285 (sha256
3286 (base32 "1gz79xvs5jrzqhwhfk0dqdd3xiavnjp4q957h7nb02rij32byb39"))))
3287 (arguments
3288 `(#:configure-flags
3289 (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
3290 (assoc-ref %build-inputs "gtk+")
3291 "/lib/gtk-2.0/include")
3292 (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
3293 (assoc-ref %build-inputs "glib")
3294 "/lib/glib-2.0/include"))
3295 ,@(package-arguments mlt)))
3296 (inputs
3297 (modify-inputs (package-inputs mlt)
3298 (replace "gtk+" gtk+-2)))))
3299
3300 (define-public v4l-utils
3301 (package
3302 (name "v4l-utils")
3303 (version "1.22.1")
3304 (source (origin
3305 (method url-fetch)
3306 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
3307 "/v4l-utils-" version ".tar.bz2"))
3308 (sha256
3309 (base32
3310 "0cafp64b7ylxhjnp47hxm59r0b0v5hc2gc23qh2s2k5463lgpik5"))))
3311 (build-system gnu-build-system)
3312 ;; Separate graphical tools in order to save almost 1 GiB on the closure
3313 ;; for the common case.
3314 (outputs '("out" "gui"))
3315 (arguments
3316 '(#:configure-flags
3317 (list "--disable-static"
3318 (string-append "--with-udevdir="
3319 (assoc-ref %outputs "out")
3320 "/lib/udev"))
3321 #:phases
3322 (modify-phases %standard-phases
3323 (add-after 'install 'split
3324 (lambda* (#:key outputs #:allow-other-keys)
3325 (let ((out (assoc-ref outputs "out"))
3326 (gui (assoc-ref outputs "gui")))
3327 (mkdir-p (string-append gui "/bin"))
3328 (mkdir-p (string-append gui "/share/man/man1"))
3329 (mkdir-p (string-append gui "/share/applications"))
3330 (for-each
3331 (lambda (prog)
3332 (for-each
3333 (lambda (file)
3334 (rename-file (string-append out file)
3335 (string-append gui file)))
3336 (list
3337 (string-append "/bin/" prog)
3338 (string-append "/share/man/man1/" prog ".1")
3339 (string-append "/share/applications/" prog ".desktop"))))
3340 '("qv4l2" "qvidcap"))
3341 (copy-recursively (string-append out "/share/icons")
3342 (string-append gui "/share/icons"))
3343 (delete-file-recursively (string-append out "/share/icons"))
3344 (rmdir (string-append out "/share/applications"))
3345 #t))))))
3346 (native-inputs
3347 (list perl pkg-config))
3348 (inputs
3349 (list alsa-lib
3350 glu
3351 libjpeg-turbo
3352 libx11
3353 qtbase-5
3354 eudev))
3355 (synopsis "Realtime video capture utilities for Linux")
3356 (description "The v4l-utils provide a series of libraries and utilities to
3357 be used for realtime video capture via Linux-specific APIs.")
3358 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
3359 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
3360 (license (list license:lgpl2.1+ license:gpl2))))
3361
3362 (define-public obs
3363 (package
3364 (name "obs")
3365 (version "27.2.4")
3366 (source (origin
3367 (method git-fetch)
3368 (uri (git-reference
3369 (url "https://github.com/obsproject/obs-studio")
3370 (commit version)
3371 (recursive? #t)))
3372 (file-name (git-file-name name version))
3373 (sha256
3374 (base32
3375 "13bfzjqmvabli99yr1h0306w5lx72mbl5sxrnr46hjig1a6rw91s"))
3376 (patches
3377 (search-patches "obs-modules-location.patch"))))
3378 (build-system cmake-build-system)
3379 (arguments
3380 (list
3381 #:configure-flags
3382 #~(list (string-append "-DOBS_VERSION_OVERRIDE=" #$version)
3383 "-DENABLE_UNIT_TESTS=ON"
3384 ;; Browser plugin requires cef, but it is not packaged yet.
3385 ;; <https://bitbucket.org/chromiumembedded/cef/src/master/>
3386 "-DBUILD_BROWSER=OFF")
3387 #:phases
3388 #~(modify-phases %standard-phases
3389 (add-after 'install 'wrap-executable
3390 (lambda* _
3391 (let ((plugin-path (getenv "QT_PLUGIN_PATH")))
3392 (wrap-program (string-append #$output "/bin/obs")
3393 `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))))))))
3394 (native-search-paths
3395 (list (search-path-specification
3396 (variable "OBS_PLUGINS_DIRECTORY")
3397 (separator #f) ;single entry
3398 (files '("lib/obs-plugins")))
3399 (search-path-specification
3400 (variable "OBS_PLUGINS_DATA_DIRECTORY")
3401 (separator #f) ;single entry
3402 (files '("share/obs/obs-plugins")))))
3403 (native-inputs
3404 (list cmocka pkg-config swig))
3405 (inputs
3406 (list
3407 alsa-lib
3408 bash-minimal
3409 curl
3410 eudev
3411 ffmpeg
3412 fontconfig
3413 freetype
3414 glib
3415 jack-1
3416 jansson
3417 libx264
3418 libxcomposite
3419 libxkbcommon
3420 luajit
3421 mbedtls-apache
3422 mesa
3423 pciutils
3424 pipewire-0.3
3425 pulseaudio
3426 python
3427 qtbase-5
3428 qtsvg-5
3429 qtx11extras
3430 qtwayland-5
3431 speexdsp
3432 v4l-utils
3433 wayland
3434 wayland-protocols
3435 zlib))
3436 (synopsis "Live streaming software")
3437 (description "Open Broadcaster Software provides a graphical interface for
3438 video recording and live streaming. OBS supports capturing audio and video
3439 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
3440 and JACK.")
3441 (home-page "https://obsproject.com")
3442 (license license:gpl2+)))
3443
3444 (define-public obs-spectralizer
3445 (package
3446 (name "obs-spectralizer")
3447 (version "1.3.3")
3448 (source
3449 (origin
3450 (method git-fetch)
3451 (uri (git-reference
3452 (url "https://github.com/univrsal/spectralizer")
3453 (commit (string-append "v" version))))
3454 (file-name (git-file-name name version))
3455
3456 ;; Remove bundled Windows DLLs.
3457 (snippet '(delete-file-recursively "fftw3"))
3458 (modules '((guix build utils)))
3459
3460 (sha256
3461 (base32
3462 "0q75cnyqydpvfda51zm9gxqj3wqr99ad0lxzjhw0ld67qvj1ag6i"))))
3463 (build-system cmake-build-system)
3464 (arguments
3465 `(#:tests? #f
3466 #:configure-flags
3467 (list "-DGLOBAL_INSTALLATION=ON" "-DUSE_CMAKE_LIBDIR=ON")))
3468 (inputs (list obs fftw))
3469 (home-page "https://github.com/univrsal/spectralizer")
3470 (synopsis "OBS plugin for audio visualization")
3471 (description "This OBS plugins allows you to vizualize MPD and internal
3472 OBS audio sources.")
3473 (license license:gpl2)))
3474
3475 (define-public obs-websocket
3476 (package
3477 (name "obs-websocket")
3478 (version "4.9.1")
3479 (source
3480 (origin
3481 (method git-fetch)
3482 (uri (git-reference
3483 (url "https://github.com/Palakis/obs-websocket")
3484 (commit version)
3485 (recursive? #t)))
3486 (file-name (git-file-name name version))
3487 (sha256
3488 (base32 "0giwhm0rbc578qng4invqqma935zzjlf05msz1gx986aqk654s7k"))))
3489 (build-system cmake-build-system)
3490 (arguments
3491 `(#:tests? #f ;no tests
3492 #:phases
3493 (modify-phases %standard-phases
3494 (add-after 'unpack 'remove-permission-change
3495 (lambda* _
3496 (substitute* "CMakeLists.txt"
3497 ;; Remove lines that set writeable permissions on outputs.
3498 (("PERMISSIONS [^)]*") "")
3499 (("set\\(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS") "")
3500 ;; Ug^WClever hack to comment out the next line, which is ‘)’.
3501 (("(OWNER|GROUP|WORLD)_READ .*") "#")))))))
3502 (inputs
3503 (list obs qtbase-5))
3504 (home-page "https://github.com/Palakis/obs-websocket")
3505 (synopsis "OBS plugin for remote control via WebSockets")
3506 (description "This OBS plugin allows you to establish a WebSocket channel
3507 from within your running OBS instance so that you can control it remotely from
3508 programs on your current machine or on other machines.")
3509 (license license:gpl2+)))
3510
3511 (define-public obs-wlrobs
3512 (package
3513 (name "obs-wlrobs")
3514 (version "1.0")
3515 (source
3516 (origin
3517 (method hg-fetch)
3518 (uri (hg-reference
3519 (url "https://hg.sr.ht/~scoopta/wlrobs")
3520 (changeset (string-append "v" version))))
3521 (file-name (git-file-name name version))
3522 (sha256
3523 (base32
3524 "1faiq2gdb7qis3m1hilm4pz8lkmkab75vzm608dbiazahhybf96p"))))
3525 (build-system meson-build-system)
3526 (native-inputs
3527 (list pkg-config))
3528 (propagated-inputs `() )
3529 (inputs (list obs
3530 `(,libx11 "out") wayland wayland-protocols))
3531 (home-page "https://hg.sr.ht/~scoopta/wlrobs")
3532 (synopsis "OBS plugin for Wayland (wlroots) screen capture")
3533 (description
3534 "This OBS plugin allows you to capture the screen on wlroots-based
3535 Wayland compositors.")
3536 (license license:gpl3+)))
3537
3538 (define-public libvdpau
3539 (package
3540 (name "libvdpau")
3541 (version "1.4")
3542 (source
3543 (origin
3544 (method git-fetch)
3545 (uri (git-reference
3546 (url "https://gitlab.freedesktop.org/vdpau/libvdpau.git")
3547 (commit version)))
3548 (file-name (git-file-name name version))
3549 (sha256
3550 (base32
3551 "1hc4mcrbr1yhfiy4zfd8wc2iiqbp90z6jswap0jia20vmyk5lqld"))))
3552 (build-system meson-build-system)
3553 (native-inputs
3554 (list pkg-config))
3555 (inputs
3556 (list `(,libx11 "out") libxext xorgproto))
3557 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
3558 (synopsis "Video Decode and Presentation API")
3559 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
3560 provides an interface to video decode acceleration and presentation hardware
3561 present in modern GPUs.")
3562 (license (license:x11-style "file://COPYING"))))
3563
3564 (define-public vdpauinfo
3565 (package
3566 (name "vdpauinfo")
3567 (version "1.4")
3568 (source
3569 (origin
3570 (method git-fetch)
3571 (uri (git-reference
3572 (url "https://gitlab.freedesktop.org/vdpau/vdpauinfo")
3573 (commit version)))
3574 (file-name (git-file-name name version))
3575 (sha256
3576 (base32 "0s84bavxr39w0r7zfaac7kpbfsg88hgymqyzcr0yvbj1yry3liz2"))))
3577 (build-system gnu-build-system)
3578 (arguments
3579 `(#:phases
3580 (modify-phases %standard-phases
3581 (replace 'bootstrap
3582 ;; ./autogen.sh runs ./configure too soon.
3583 (lambda _
3584 (invoke "autoreconf" "-fiv"))))))
3585 (native-inputs
3586 (list autoconf automake libx11 pkg-config))
3587 (propagated-inputs
3588 (list libvdpau))
3589 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
3590 (synopsis "Tool to query the capabilities of a VDPAU implementation")
3591 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
3592 implementation.")
3593 (license (license:x11-style "file://COPYING"))))
3594
3595 (define-public libvdpau-va-gl
3596 (package
3597 (name "libvdpau-va-gl")
3598 (version "0.4.2")
3599 (source
3600 (origin
3601 (method url-fetch)
3602 (uri (string-append "https://github.com/i-rinat/libvdpau-va-gl/"
3603 "releases/download/v" version "/libvdpau-va-gl-"
3604 version ".tar.gz"))
3605 (sha256
3606 (base32
3607 "1x2ag1f2fwa4yh1g5spv99w9x1m33hbxlqwyhm205ssq0ra234bx"))
3608 (patches (search-patches "libvdpau-va-gl-unbundle.patch"))
3609 (modules '((guix build utils)))
3610 (snippet '(begin (delete-file-recursively "3rdparty")
3611 #t))))
3612 (build-system cmake-build-system)
3613 (arguments
3614 '(#:tests? #f)) ; Tests require a running X11 server, with VA-API support.
3615 (native-inputs
3616 (list libvdpau pkg-config))
3617 (inputs
3618 (list libva mesa))
3619 (home-page "https://github.com/i-rinat/libvdpau-va-gl")
3620 (synopsis "VDPAU driver with VA-API/OpenGL backend")
3621 (description
3622 "Many applications can use VDPAU to accelerate portions of the video
3623 decoding process and video post-processing to the GPU video hardware. Since
3624 there is no VDPAU available on Intel chips, they fall back to different drawing
3625 techniques. This driver uses OpenGL under the hood to accelerate drawing and
3626 scaling and VA-API (if available) to accelerate video decoding.")
3627 (license license:expat)))
3628
3629 (define-public recordmydesktop
3630 (package
3631 (name "recordmydesktop")
3632 (version "0.4.0")
3633 (source (origin
3634 (method url-fetch)
3635 (uri (string-append "https://github.com/Enselic/"
3636 name "/releases/download/v" version
3637 "/recordmydesktop-" version ".tar.gz"))
3638 (sha256
3639 (base32
3640 "17kjgmkl45zma64a5dg1hyvnjkzk4vl8milgi6ic7hlsbmywpig7"))))
3641 (build-system gnu-build-system)
3642 (inputs (list popt
3643 zlib
3644 libx11
3645 libice
3646 libsm
3647 libxfixes
3648 libxdamage
3649 libxext
3650 alsa-lib
3651 libvorbis
3652 libtheora))
3653 (home-page "https://enselic.github.io/recordmydesktop/")
3654 (synopsis "Desktop session video recorder")
3655 (description
3656 "recordMyDesktop is a command-line tool that captures the activity in
3657 your graphical desktop and encodes it as a video. This is a useful tool for
3658 making @dfn{screencasts}.")
3659 (license license:gpl2+)))
3660
3661 (define-public simplescreenrecorder
3662 (package
3663 (name "simplescreenrecorder")
3664 (version "0.4.2")
3665 (source
3666 (origin
3667 (method git-fetch)
3668 (uri (git-reference
3669 (url "https://github.com/MaartenBaert/ssr")
3670 (commit version)))
3671 (file-name (git-file-name name version))
3672 (sha256
3673 (base32
3674 "1dzp5yzqlha65crzklx2qlan6ssw1diwzfpc4svd7gnr858q2292"))))
3675 (build-system cmake-build-system)
3676 ;; Although libx11, libxfixes, libxext are listed as build dependencies in
3677 ;; README.md, the program builds and functions properly without them.
3678 ;; As a result, they are omitted. Please add them back if problems appear.
3679 (inputs
3680 (list alsa-lib
3681 ffmpeg
3682 glu
3683 jack-1
3684 libxi
3685 libxinerama
3686 pulseaudio
3687 qtbase-5
3688 qtx11extras))
3689 (native-inputs (list pkg-config))
3690 (arguments
3691 `(#:configure-flags
3692 (list "-DWITH_QT5=TRUE")
3693 #:tests? #f)) ; no test suite
3694 ;; Using HTTPS causes part of the page to be displayed improperly.
3695 (home-page "https://www.maartenbaert.be/simplescreenrecorder/")
3696 (synopsis "Screen recorder")
3697 (description "SimpleScreenRecorder is an easy to use screen recorder with
3698 a graphical user interface. It supports recording the entire screen, or a
3699 part of it, and allows encoding in many different codecs and file formats.
3700 Other features include a live preview and live streaming.")
3701 (license (list license:gpl3+ ; most files
3702 license:zlib ; glinject/elfhacks.*
3703 license:isc ; glinject/*
3704 license:x11)))) ; build-aux/install-sh
3705
3706 (define-public libsmpeg
3707 (package
3708 (name "libsmpeg")
3709 (version "0.4.5-401")
3710 (source (origin
3711 (method svn-fetch)
3712 (uri (svn-reference
3713 (url "svn://svn.icculus.org/smpeg/trunk/")
3714 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
3715 (file-name (string-append name "-" version "-checkout"))
3716 (sha256
3717 (base32
3718 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
3719 (build-system gnu-build-system)
3720 (arguments
3721 ;; libsmpeg fails to build with -std=c++11, which is the default with
3722 ;; GCC 7. Also, 'configure' does CXXFLAGS=$CFLAGS, hence this hack.
3723 '(#:configure-flags '("CFLAGS=-O2 -g -std=c++03")))
3724 (native-inputs
3725 (list autoconf automake))
3726 (inputs
3727 `(("sdl" ,sdl2)))
3728 (home-page "https://icculus.org/smpeg/")
3729 (synopsis "SDL MPEG decoding library")
3730 (description
3731 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
3732 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
3733 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
3734 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
3735 and MPEG system streams.")
3736 (license (list license:expat
3737 license:lgpl2.1
3738 license:lgpl2.1+
3739 license:gpl2))))
3740
3741 ;; for btanks
3742 (define-public libsmpeg-with-sdl1
3743 (package (inherit libsmpeg)
3744 (name "libsmpeg")
3745 (version "0.4.5-399")
3746 (source (origin
3747 (method svn-fetch)
3748 (uri (svn-reference
3749 (url "svn://svn.icculus.org/smpeg/trunk/")
3750 (revision 399))) ; tagged release 0.4.5
3751 (file-name (string-append name "-" version "-checkout"))
3752 (sha256
3753 (base32
3754 "0jfi085rf3fa5xsn0vd3nqf32my8ph9c6a9445y7a8lrlz4dms64"))))
3755 (inputs
3756 (list sdl))))
3757
3758 (define-public libbdplus
3759 (package
3760 (name "libbdplus")
3761 (version "0.1.2")
3762 (source
3763 (origin
3764 (method url-fetch)
3765 (uri (string-append "https://ftp.videolan.org/pub/videolan/libbdplus/"
3766 version "/" name "-" version ".tar.bz2"))
3767 (sha256
3768 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
3769 (inputs
3770 (list libgcrypt))
3771 (build-system gnu-build-system)
3772 (home-page "https://www.videolan.org/developers/libbdplus.html")
3773 (synopsis "Library for decrypting certain Blu-Ray discs")
3774 (description "libbdplus is a library which implements the BD+ System
3775 specifications.")
3776 (license license:lgpl2.1+)))
3777
3778 (define-public libaacs
3779 (package
3780 (name "libaacs")
3781 (version "0.11.0")
3782 (source
3783 (origin
3784 (method url-fetch)
3785 (uri (string-append "https://ftp.videolan.org/pub/videolan/libaacs/"
3786 version "/libaacs-" version ".tar.bz2"))
3787 (sha256
3788 (base32 "11skjqjlldmbjkyxdcz4fmcn6y4p95r1xagbcnjy4ndnzf0l723d"))))
3789 (inputs
3790 (list libgcrypt))
3791 (native-inputs
3792 (list bison flex))
3793 (build-system gnu-build-system)
3794 (home-page "https://www.videolan.org/developers/libaacs.html")
3795 (synopsis "Library for decrypting certain Blu-Ray discs")
3796 (description "libaacs is a library which implements the Advanced Access
3797 Content System specification.")
3798 (license license:lgpl2.1+)))
3799
3800 (define-public mps-youtube
3801 (package
3802 (name "mps-youtube")
3803 (version "0.2.8")
3804 (source
3805 (origin
3806 (method git-fetch)
3807 (uri (git-reference
3808 (url "https://github.com/mps-youtube/mps-youtube")
3809 (commit (string-append "v" version))))
3810 (file-name (git-file-name name version))
3811 (sha256
3812 (base32
3813 "1w1jhw9rg3dx7vp97cwrk5fymipkcy2wrbl1jaa38ivcjhqg596y"))))
3814 (build-system python-build-system)
3815 (arguments
3816 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
3817 ;; test suite results differ depending on the country and also introduce
3818 ;; non-determinism in the tests.
3819 ;; https://github.com/mps-youtube/mps-youtube/issues/556
3820 '(#:tests? #f
3821 #:phases (modify-phases %standard-phases
3822 ;; Loading this as a library will create cache directories,
3823 ;; etc; which fails in the build container.
3824 (delete 'sanity-check))))
3825 (propagated-inputs
3826 (list python-pafy python-pygobject)) ; For mpris2 support
3827 (home-page "https://github.com/mps-youtube/mps-youtube")
3828 (synopsis "Terminal based YouTube player and downloader")
3829 (description
3830 "@code{mps-youtube} is based on mps, a terminal based program to
3831 search, stream and download music. This implementation uses YouTube as
3832 a source of content and can play and download video as well as audio.
3833 It can use either mpv or mplayer for playback, and for conversion of
3834 formats ffmpeg or libav is used. Users should install one of the
3835 supported players in addition to this package.")
3836 (license license:gpl3+)))
3837
3838 (define-public handbrake
3839 (package
3840 (name "handbrake")
3841 (version "1.5.1")
3842 (source (origin
3843 (method url-fetch)
3844 (uri (string-append "https://github.com/HandBrake/HandBrake/"
3845 "releases/download/" version "/"
3846 "HandBrake-" version "-source.tar.bz2"))
3847 (sha256
3848 (base32
3849 "1w1hjj6gvdydypw4mdn281w0x163is59cfm7k6bq371hsl3gx69r"))
3850 (modules '((guix build utils)))
3851 (snippet
3852 ;; Remove "contrib" and source not necessary for
3853 ;; building/running under a GNU environment.
3854 '(begin
3855 (for-each delete-file-recursively
3856 '("contrib" "macosx" "win")) ; 540KiB, 11MiB, 5.9MiB resp.
3857 (substitute* "make/include/main.defs"
3858 ;; Disable unconditional inclusion of "contrib" libraries
3859 ;; (ffmpeg, libvpx, libdvdread, libdvdnav, and libbluray),
3860 ;; which would lead to fetching and building of these
3861 ;; libraries. Use our own instead.
3862 (("MODULES \\+= contrib") "# MODULES += contrib"))))))
3863 (build-system glib-or-gtk-build-system)
3864 (native-inputs
3865 `(("automake" ,automake) ; GUI subpackage must be bootstrapped
3866 ("autoconf" ,autoconf)
3867 ("intltool" ,intltool)
3868 ("libtool" ,libtool)
3869 ("pkg-config" ,pkg-config)
3870 ("python" ,python-2))) ; For configuration
3871 (inputs
3872 `(("bzip2" ,bzip2)
3873 ("dbus-glib" ,dbus-glib)
3874 ("ffmpeg" ,ffmpeg)
3875 ("fontconfig" ,fontconfig)
3876 ("freetype" ,freetype)
3877 ("glib" ,glib)
3878 ("gstreamer" ,gstreamer)
3879 ("gst-plugins-base" ,gst-plugins-base)
3880 ("gtk+" ,gtk+)
3881 ("jansson" ,jansson)
3882 ("lame" ,lame)
3883 ("libass" ,libass)
3884 ("libbluray" ,libbluray)
3885 ("libdav1d" ,dav1d)
3886 ("libdvdnav" ,libdvdnav)
3887 ("libdvdread" ,libdvdread)
3888 ("libgudev" ,libgudev)
3889 ("libjpeg-turbo" ,libjpeg-turbo)
3890 ("libmpeg2" ,libmpeg2)
3891 ("libnotify" ,libnotify)
3892 ("libnuma" ,numactl)
3893 ("libogg" ,libogg)
3894 ("libopus" ,opus)
3895 ("libsamplerate" ,libsamplerate)
3896 ("libtheora" ,libtheora)
3897 ("libvorbis" ,libvorbis)
3898 ("libvpx" ,libvpx)
3899 ("libxml2" ,libxml2)
3900 ("libx264" ,libx264)
3901 ("speex" ,speex)
3902 ("x265" ,x265)
3903 ("zimg" ,zimg)
3904 ("zlib" ,zlib)))
3905 (arguments
3906 `(#:tests? #f ;tests require Ruby and claim to be unsupported
3907 #:configure-flags
3908 (list "--disable-gtk-update-checks"
3909 "--disable-nvenc"
3910 (string-append "CPPFLAGS=-I"
3911 (assoc-ref %build-inputs "libxml2")
3912 "/include/libxml2")
3913 "LDFLAGS=-lx265")
3914 #:phases
3915 (modify-phases %standard-phases
3916 (replace 'bootstrap
3917 ;; Run bootstrap ahead of time so that shebangs get patched.
3918 (lambda _
3919 (setenv "CONFIG_SHELL" (which "sh"))
3920 ;; Patch the Makefile so that it doesn't bootstrap again.
3921 (substitute* "gtk/module.rules"
3922 ((".*autoreconf.*") ""))
3923 (with-directory-excursion "gtk"
3924 (invoke "autoreconf" "-fiv"))))
3925 (add-before 'configure 'patch-SHELL
3926 (lambda _
3927 (substitute* "gtk/po/Makefile.in.in"
3928 (("SHELL = /bin/sh") "SHELL = @SHELL@"))))
3929 (add-before 'configure 'relax-reqs
3930 (lambda _
3931 (substitute* "make/configure.py"
3932 ;; cmake is checked for so that it can be used to build
3933 ;; contrib/harfbuzz and contrib/x265, but we get these as
3934 ;; inputs, so don't abort if it's not found. Similarly, meson
3935 ;; and ninja are only needed for contrib/libdav1d, and nasm
3936 ;; only for libvpx
3937 (("((cmake|meson|ninja|nasm) *=.*abort=)True" _ &)
3938 (string-append & "False")))))
3939 (replace 'configure
3940 (lambda* (#:key outputs configure-flags #:allow-other-keys)
3941 ;; 'configure' is not an autoconf-generated script, and
3942 ;; errors on unrecognized arguments,
3943 ;; e.g. --enable-fast-install
3944 (let ((out (assoc-ref outputs "out")))
3945 (apply invoke "./configure"
3946 (string-append "--prefix=" out)
3947 (or configure-flags '())))))
3948 (add-after 'configure 'chdir-build
3949 (lambda _ (chdir "./build"))))))
3950 (home-page "https://handbrake.fr")
3951 (synopsis "Video transcoder")
3952 (description
3953 "HandBrake is a tool for converting video from any format to a selection
3954 of modern, widely supported codecs.")
3955 ;; Some under GPLv2+, some under LGPLv2.1+, and portions under BSD3.
3956 ;; Combination under GPLv2. See LICENSE.
3957 (license license:gpl2)))
3958
3959 (define-public intel-vaapi-driver
3960 (package
3961 (name "intel-vaapi-driver")
3962 (version "2.4.1")
3963 (source
3964 (origin
3965 (method git-fetch)
3966 (uri (git-reference
3967 (url "https://github.com/intel/intel-vaapi-driver")
3968 (commit version)))
3969 (sha256
3970 (base32 "1cidki3av9wnkgwi7fklxbg3bh6kysf8w3fk2qadjr05a92mx3zp"))
3971 (file-name (git-file-name name version))))
3972 (build-system gnu-build-system)
3973 (native-inputs
3974 (list autoconf automake libtool pkg-config))
3975 (inputs
3976 (list libdrm libva libx11))
3977 (arguments
3978 `(#:phases
3979 (modify-phases %standard-phases
3980 (add-before 'configure 'set-target-directory
3981 (lambda* (#:key outputs #:allow-other-keys)
3982 (let ((out (assoc-ref outputs "out")))
3983 (setenv "LIBVA_DRIVERS_PATH" (string-append out "/lib/dri"))
3984 #t))))))
3985 ;; XXX Because of <https://issues.guix.gnu.org/issue/22138>, we need to add
3986 ;; this to all VA-API back ends instead of once to libva.
3987 (native-search-paths
3988 (list (search-path-specification
3989 (variable "LIBVA_DRIVERS_PATH")
3990 (files '("lib/dri")))))
3991 (supported-systems '("i686-linux" "x86_64-linux"))
3992 (home-page "https://01.org/linuxmedia/vaapi")
3993 (synopsis "VA-API video acceleration driver for Intel GEN Graphics devices")
3994 (description
3995 "This is the @acronym{VA-API, Video Acceleration API} back end required for
3996 hardware-accelerated video processing on Intel GEN Graphics devices supported by
3997 the i915 driver, such as integrated Intel HD Graphics. It provides access to
3998 both hardware and shader functionality for faster encoding, decoding, and
3999 post-processing of video formats like MPEG2, H.264/AVC, and VC-1.")
4000 (license (list license:bsd-2 ; src/gen9_vp9_const_def.c
4001 license:expat)))) ; the rest, excluding the test suite
4002
4003 (define-public openh264
4004 (package
4005 (name "openh264")
4006 (version "2.3.0")
4007 (source (origin
4008 (method git-fetch)
4009 (uri (git-reference
4010 (url "https://github.com/cisco/openh264")
4011 (commit (string-append "v" version))))
4012 (file-name (git-file-name name version))
4013 (sha256
4014 (base32
4015 "1yr6nsjpnazq4z6dvjfyanljwgwnyjh3ddxa0sq6hl9qc59yq91r"))))
4016 (build-system gnu-build-system)
4017 (native-inputs
4018 (list nasm python))
4019 (arguments
4020 (list
4021 #:make-flags
4022 #~(list (string-append "PREFIX=" #$output)
4023 "CC=gcc")
4024 #:test-target "test"
4025 #:phases
4026 #~(modify-phases %standard-phases
4027 ;; no configure script
4028 (delete 'configure))))
4029 (home-page "https://www.openh264.org/")
4030 (synopsis "H264 decoder library")
4031 (description
4032 "Openh264 is a library which can decode H264 video streams.")
4033 (license license:bsd-2)))
4034
4035 (define-public libmp4v2
4036 (package
4037 (name "libmp4v2")
4038 (version "2.0.0")
4039 (source
4040 (origin
4041 (method url-fetch)
4042 ;; XXX: The new location of upstream is uncertain and will become relevant the
4043 ;; moment when the googlecode archive shuts down. It is past the date it
4044 ;; should've been turned off. I tried to communicate with upstream, but this
4045 ;; wasn't very responsive and not very helpful. The short summary is, it is
4046 ;; chaos when it comes to the amount of forks and only time will tell where
4047 ;; the new upstream location is.
4048 (uri (string-append "https://storage.googleapis.com/google-"
4049 "code-archive-downloads/v2/"
4050 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
4051 (file-name (string-append name "-" version ".tar.bz2"))
4052 (patches (search-patches "libmp4v2-c++11.patch"))
4053 (sha256
4054 (base32
4055 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
4056 (build-system gnu-build-system)
4057 (outputs '("out"
4058 "static")) ; 3.7MiB .a file
4059 (arguments
4060 `(;; Build as C++2003 to avoid C++11 "narrowing conversion" errors.
4061 #:configure-flags '("CXXFLAGS=-O2 -g -std=c++03")
4062
4063 #:phases
4064 (modify-phases %standard-phases
4065 (add-after 'unpack 'remove-dates
4066 (lambda _
4067 ;; Make the build reproducible.
4068 (substitute* "configure"
4069 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
4070 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
4071 #t))
4072 (add-after 'install 'move-static-libraries
4073 (lambda* (#:key outputs #:allow-other-keys)
4074 ;; Move static libraries to the "static" output.
4075 (let* ((out (assoc-ref outputs "out"))
4076 (lib (string-append out "/lib"))
4077 (static (assoc-ref outputs "static"))
4078 (slib (string-append static "/lib")))
4079 (mkdir-p slib)
4080 (for-each (lambda (file)
4081 (install-file file slib)
4082 (delete-file file))
4083 (find-files lib "\\.a$"))
4084 #t))))))
4085 (native-inputs
4086 (list help2man dejagnu))
4087 (home-page "https://code.google.com/archive/p/mp4v2/")
4088 (synopsis "API to create and modify mp4 files")
4089 (description
4090 "The MP4v2 library provides an API to create and modify mp4 files as defined by
4091 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
4092 file format that has been used as a multimedia file format in a variety of platforms and
4093 applications. It is a very powerful and extensible format that can accommodate
4094 practically any type of media.")
4095 (license license:mpl1.1)))
4096
4097 (define-public libmediainfo
4098 (package
4099 (name "libmediainfo")
4100 (version "22.03")
4101 (source (origin
4102 (method url-fetch)
4103 (uri (string-append "https://mediaarea.net/download/source/"
4104 name "/" version "/"
4105 name "_" version ".tar.xz"))
4106 (sha256
4107 (base32
4108 "1fc0ihj17cdv9zb346llwvbv0hn3sl3ax398ankgp74fcaxvll7w"))))
4109 ;; TODO add a Big Buck Bunny webm for tests.
4110 (native-inputs
4111 (list autoconf automake libtool pkg-config))
4112 (propagated-inputs
4113 (list zlib tinyxml2 curl ; In Requires.private of libmediainfo.pc.
4114 libzen))
4115 (build-system gnu-build-system)
4116 (arguments
4117 '(#:tests? #f ; see above TODO
4118 #:configure-flags
4119 (list "--with-libcurl" "--with-libtinyxml2")
4120 #:phases
4121 ;; build scripts not in root of archive
4122 (modify-phases %standard-phases
4123 (add-after 'unpack 'change-to-build-dir
4124 (lambda _
4125 (chdir "Project/GNU/Library")
4126 #t)))))
4127 (home-page "https://mediaarea.net/en/MediaInfo")
4128 (synopsis "Library for retrieving media metadata")
4129 (description "MediaInfo is a library used for retrieving technical
4130 information and other metadata about audio or video files. A non-exhaustive
4131 list of the information MediaInfo can retrieve from media files include:
4132
4133 @itemize
4134 @item General: title, author, director, album, track number, date, duration...
4135 @item Video: codec, aspect, fps, bitrate...
4136 @item Audio: codec, sample rate, channels, language, bitrate...
4137 @item Text: language of subtitle
4138 @item Chapters: number of chapters, list of chapters
4139 @end itemize
4140
4141 MediaInfo supports the following formats:
4142
4143 @itemize
4144 @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
4145 MPEG-2, MPEG-4, DVD (VOB)...
4146 @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
4147 @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
4148 @item Subtitles: SRT, SSA, ASS, SAMI...
4149 @end itemize\n")
4150 (license license:bsd-2)))
4151
4152 ;; TODO also have a GUI version available
4153 (define-public mediainfo
4154 (package
4155 (name "mediainfo")
4156 (version "22.03")
4157 (source (origin
4158 (method url-fetch)
4159 ;; Warning: This source has proved unreliable 1 time at least.
4160 ;; Consider an alternate source or report upstream if this
4161 ;; happens again.
4162 (uri (string-append "https://mediaarea.net/download/source/"
4163 name "/" version "/"
4164 name "_" version ".tar.xz"))
4165 (sha256
4166 (base32
4167 "1r1bh1lk2dsiv0j84whgca7qslxbibg6vsih7x5iga2p3lmgjdk2"))))
4168 (native-inputs
4169 (list autoconf automake libtool pkg-config))
4170 (inputs
4171 (list libmediainfo))
4172 (build-system gnu-build-system)
4173 (arguments
4174 '(#:tests? #f ; lacks tests
4175 #:phases
4176 ;; build scripts not in root of archive
4177 (modify-phases %standard-phases
4178 (add-after 'unpack 'change-to-build-dir
4179 (lambda _
4180 (chdir "Project/GNU/CLI")
4181 #t)))))
4182 (home-page "https://mediaarea.net/en/MediaInfo")
4183 (synopsis "Utility for reading media metadata")
4184 (description "MediaInfo is a utility used for retrieving technical
4185 information and other metadata about audio or video files. It supports the
4186 many codecs and formats supported by libmediainfo.")
4187 (license license:bsd-2)))
4188
4189 (define-public atomicparsley
4190 (package
4191 (name "atomicparsley")
4192 (version "20200701.154658.b0d6223")
4193 (source (origin
4194 (method git-fetch)
4195 (uri (git-reference
4196 (url "https://github.com/wez/atomicparsley")
4197 (commit version)))
4198 (file-name (git-file-name name version))
4199 (sha256
4200 (base32
4201 "1kym2l5y34nmbrrlkfmxsf1cwrvch64kb34jp0hpa0b89idbhwqh"))))
4202 (build-system cmake-build-system)
4203 (arguments
4204 `(#:tests? #f ;; no tests included
4205 #:phases
4206 (modify-phases %standard-phases
4207 (add-before 'configure 'set-cmake-version
4208 (lambda* _
4209 (substitute* "CMakeLists.txt"
4210 ;; At the time of writing, Guix has CMake at 3.16, but
4211 ;; AtomicParsley uses 3.17. This brings the required CMake
4212 ;; version down to what Guix can afford.
4213 (("VERSION 3.17") "VERSION 3.16"))
4214 #t))
4215 (replace 'install
4216 (lambda* (#:key outputs #:allow-other-keys)
4217 (let* ((out (assoc-ref outputs "out"))
4218 (bin (string-append out "/bin")))
4219 (install-file "AtomicParsley" bin))
4220 #t)))))
4221 (inputs
4222 (list zlib))
4223 (synopsis "Metadata editor for MPEG-4 files")
4224 (description "AtomicParsley is a lightweight command line program for
4225 reading, parsing and setting metadata into MPEG-4 files, in particular,
4226 iTunes-style metadata.")
4227 (home-page "https://github.com/wez/atomicparsley")
4228 (license license:gpl2+)))
4229
4230 (define-public livemedia-utils
4231 (package
4232 (name "livemedia-utils")
4233 (version "2020.11.19")
4234 (source (origin
4235 (method url-fetch)
4236 (uri (string-append
4237 "https://download.videolan.org/contrib/live555/live."
4238 version ".tar.gz"))
4239 (sha256
4240 (base32
4241 "16w6yxdbmjdhvffnrb752dn4llf3l0wb00dgdkyia0vqsv2qqyn7"))))
4242 (build-system gnu-build-system)
4243 (arguments
4244 `(#:tests? #f ; no tests
4245 #:make-flags (list (string-append "CC=" ,(cc-for-target))
4246 (string-append "CXX=" ,(cxx-for-target))
4247 (string-append "LDFLAGS=-Wl,-rpath="
4248 (assoc-ref %outputs "out") "/lib")
4249 (string-append "PREFIX="
4250 (assoc-ref %outputs "out")))
4251 #:phases (modify-phases %standard-phases
4252 (add-before 'configure 'fix-makefiles-generation
4253 (lambda _
4254 (substitute* "genMakefiles"
4255 (("/bin/rm") "rm"))
4256 #t))
4257 (replace 'configure
4258 (lambda _
4259 (invoke "./genMakefiles"
4260 "linux-with-shared-libraries"))))))
4261 (inputs
4262 (list openssl))
4263 (home-page "http://www.live555.com/liveMedia/")
4264 (synopsis "Set of C++ libraries for multimedia streaming")
4265 (description "This code forms a set of C++ libraries for multimedia
4266 streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). The libraries
4267 can be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or
4268 JPEG video, and several audio codecs. They can easily be extended to support
4269 additional (audio and/or video) codecs, and can also be used to build basic
4270 RTSP or SIP clients and servers.")
4271 (license license:lgpl3+)))
4272
4273 (define-public libdvbpsi
4274 (package
4275 (name "libdvbpsi")
4276 (version "1.3.3")
4277 (source (origin
4278 (method url-fetch)
4279 (uri (string-append
4280 "https://download.videolan.org/pub/libdvbpsi/"
4281 version "/libdvbpsi-" version ".tar.bz2"))
4282 (sha256
4283 (base32
4284 "04h1l3vrkrdsrvkgzcr51adk10g6hxcxvgjphyyxz718ry5rkd82"))))
4285 (build-system gnu-build-system)
4286 (home-page "https://www.videolan.org/developers/libdvbpsi.html")
4287 (synopsis "Library for decoding and generation of MPEG TS and DVB PSI
4288 tables")
4289 (description "libdvbpsi is a simple library designed for decoding and
4290 generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818s
4291 and ITU-T H.222.0.")
4292 (license license:lgpl2.1)))
4293
4294 (define-public ffms2
4295 (package
4296 (name "ffms2")
4297 (version "2.23")
4298 (home-page "https://github.com/FFMS/ffms2")
4299 (source (origin
4300 (method git-fetch)
4301 (uri (git-reference
4302 (url "https://github.com/FFMS/ffms2")
4303 (commit version)))
4304 (file-name (git-file-name name version))
4305 (sha256
4306 (base32
4307 "0dkz5b3gxq5p4xz0qqg6l2sigszrlsinz3skyf0ln4wf3zrvf8m5"))))
4308 (build-system gnu-build-system)
4309 (arguments
4310 '(#:configure-flags
4311 (list "--enable-avresample")))
4312 (inputs
4313 (list zlib))
4314 (propagated-inputs
4315 (list ffmpeg))
4316 (native-inputs
4317 (list pkg-config))
4318 (synopsis "Cross-platform wrapper around ffmpeg/libav")
4319 (description
4320 "FFMpegSource is a wrapper library around ffmpeg/libav that allows
4321 programmers to access a standard API to open and decompress media files.")
4322 ;; sources are distributed under a different license that the binary.
4323 ;; see https://github.com/FFMS/ffms2/blob/master/COPYING
4324 (license license:gpl2+))); inherits from ffmpeg
4325
4326 (define-public aegisub
4327 (package
4328 (name "aegisub")
4329 (version "3.2.2")
4330 (source (origin
4331 (method url-fetch)
4332 (uri (string-append
4333 "http://ftp.aegisub.org/pub/archives/releases/source/"
4334 name "-" version ".tar.xz"))
4335 (sha256
4336 (base32
4337 "11b83qazc8h0iidyj1rprnnjdivj1lpphvpa08y53n42bfa36pn5"))
4338 (patches (search-patches "aegisub-icu59-include-unistr.patch"
4339 "aegisub-make43.patch"
4340 "aegisub-boost68.patch"))))
4341 (build-system gnu-build-system)
4342 (arguments
4343 `(#:configure-flags
4344 (list "--disable-update-checker"
4345 "--without-portaudio"
4346 "--without-openal"
4347 "--without-oss"
4348 "CXXFLAGS=-DU_USING_ICU_NAMESPACE=1")
4349 ;; tests require busted, a lua package we don't have yet
4350 #:tests? #f
4351 #:phases
4352 (modify-phases %standard-phases
4353 (add-before 'configure 'fix-ldflags
4354 (lambda _
4355 (setenv "LDFLAGS" "-pthread")
4356 #t))
4357 (add-after 'unpack 'fix-boost-headers
4358 (lambda _
4359 (substitute*
4360 '("src/subtitles_provider_libass.cpp"
4361 "src/colour_button.cpp"
4362 "src/video_provider_dummy.cpp"
4363 "./src/video_frame.cpp")
4364 (("#include <boost/gil/gil_all.hpp>")
4365 "#include <boost/gil.hpp>"))
4366 #t)))))
4367 (inputs
4368 (list boost
4369 ffms2
4370 fftw
4371 hunspell
4372 mesa
4373 libass
4374 alsa-lib
4375 pulseaudio
4376 libx11
4377 freetype
4378 wxwidgets-gtk2))
4379 (native-inputs
4380 (list intltool desktop-file-utils pkg-config))
4381 (home-page "http://www.aegisub.org/")
4382 (synopsis "Subtitle engine")
4383 (description
4384 "Aegisub is a tool for creating and modifying subtitles. Aegisub makes
4385 it quick and easy to time subtitles to audio, and features many powerful
4386 tools for styling them, including a built-in real-time video preview.")
4387 (license (list license:bsd-3 ; the package is licensed under the bsd-3, except
4388 license:mpl1.1 ; for vendor/universalchardet under the mpl1.1
4389 license:expat)))) ; and src/gl that is under a license similar
4390 ; the the Expat license, with a rewording (Software -> Materials). (called MIT
4391 ; by upstream). See https://github.com/Aegisub/Aegisub/blob/master/LICENCE
4392 ; src/MatroskaParser.(c|h) is under bsd-3 with permission from the author
4393
4394 (define-public pitivi
4395 (package
4396 (name "pitivi")
4397 (version "2022.06.0")
4398 (source
4399 (origin
4400 (method git-fetch)
4401 (uri (git-reference
4402 (url "https://gitlab.gnome.org/GNOME/pitivi.git")
4403 (commit version)))
4404 (file-name (git-file-name name version))
4405 (sha256
4406 (base32 "1wgfi8srblqzd2y6528cyvn56rbdxpwlq0wmwqhabshdk28zyx8d"))))
4407 (build-system meson-build-system)
4408 (native-inputs
4409 (list gettext-minimal
4410 `(,glib "bin")
4411 itstool
4412 pkg-config))
4413 (inputs
4414 (list bash-minimal
4415 glib
4416 gst-editing-services
4417 gstreamer
4418 gst-plugins-base
4419 gst-plugins-good
4420 ;; TODO: Add the 'cvtracker' plugin after our gstreamer packages
4421 ;; has been upgraded to version 1.20.
4422 (gst-plugins/selection gst-plugins-bad #:plugins
4423 '("debugutils" "transcode")
4424 #:configure-flags
4425 #~'("-Dintrospection=enabled"))
4426 gst-libav
4427 gsound
4428 gtk+
4429 libpeas
4430 libnotify
4431 pango
4432 python
4433 python-gst
4434 python-librosa
4435 python-numpy
4436 python-matplotlib
4437 python-pycairo
4438 python-pygobject))
4439 ;; Propagate librsvg so that is is registered in GDK_PIXBUF_MODULE_FILE,
4440 ;; otherwise pitivi fails to launch.
4441 (propagated-inputs (list librsvg))
4442 (arguments
4443 `(#:glib-or-gtk? #t
4444 #:phases
4445 (modify-phases %standard-phases
4446 (add-after 'glib-or-gtk-wrap 'wrap-other-dependencies
4447 (lambda* (#:key outputs #:allow-other-keys)
4448 (wrap-program (search-input-file outputs "bin/pitivi")
4449 `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
4450 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
4451 ;; We've only added inputs for what Pitivi deems either
4452 ;; necessary or optional. Let the user's packages take
4453 ;; precedence in case they have e.g. the full gst-plugins-bad.
4454 `("GST_PLUGIN_SYSTEM_PATH" suffix
4455 (,(getenv "GST_PLUGIN_SYSTEM_PATH")))))))))
4456 (home-page "http://www.pitivi.org")
4457 (synopsis "Video editor based on GStreamer Editing Services")
4458 (description "Pitivi is a video editor built upon the GStreamer Editing
4459 Services. It aims to be an intuitive and flexible application that can appeal
4460 to newbies and professionals alike.")
4461 (license license:lgpl2.1+)))
4462
4463 (define-public gavl
4464 (package
4465 (name "gavl")
4466 (version "1.4.0")
4467 (source
4468 (origin
4469 (method url-fetch)
4470 (uri (string-append "mirror://sourceforge/gmerlin/"
4471 name "/" version "/"
4472 name "-" version ".tar.gz"))
4473 (file-name (string-append name "-" version ".tar.gz"))
4474 (sha256
4475 (base32
4476 "1kikkn971a14zzm7svi7190ldc14fjai0xyhpbcmp48s750sraji"))))
4477 (build-system gnu-build-system)
4478 (arguments
4479 '(#:configure-flags '("LIBS=-lm")))
4480 (native-inputs
4481 (list pkg-config doxygen))
4482 (home-page "http://gmerlin.sourceforge.net")
4483 (synopsis "Low level library for multimedia API building")
4484 (description
4485 "Gavl is short for Gmerlin Audio Video Library. It is a low level
4486 library, upon which multimedia APIs can be built. Gavl handles all the
4487 details of audio and video formats like colorspaces, sample rates,
4488 multichannel configurations, etc. It provides standardized definitions for
4489 those formats as well as container structures for carrying audio samples or
4490 video images inside an application.
4491
4492 In addition, it handles the sometimes ugly task of converting between all
4493 these formats and provides some elementary operations (copying, scaling,
4494 alpha blending etc).")
4495 (license license:gpl3)))
4496
4497 (define-public frei0r-plugins
4498 (package
4499 (name "frei0r-plugins")
4500 (version "1.7.0")
4501 (source
4502 (origin
4503 (method url-fetch)
4504 (uri (string-append "https://files.dyne.org/frei0r/"
4505 "frei0r-plugins-" version ".tar.gz"))
4506 (sha256
4507 (base32
4508 "0fjji3060r4fwr7vn91lwfzl80lg3my9lkp94kbyw8xwz7qgh7qv"))))
4509 (build-system gnu-build-system)
4510 (arguments
4511 `(#:phases
4512 (modify-phases %standard-phases
4513 (add-after 'unpack 'patch-Makefile
4514 (lambda _
4515 ;; XXX: The 1.7.0 Makefile looks for files that have slightly different
4516 ;; names in the tarball. Try removing this for future versions.
4517 (substitute* "Makefile.in"
4518 (("README\\.md ChangeLog TODO AUTHORS")
4519 "README.txt ChangeLog.txt TODO.txt AUTHORS.txt"))
4520 #t)))))
4521 ;; TODO: opencv for additional face detection filters.
4522 (inputs
4523 (list gavl cairo))
4524 (native-inputs
4525 (list pkg-config))
4526 (home-page "https://www.dyne.org/software/frei0r/")
4527 (synopsis "Minimalistic plugin API for video effects")
4528 (description
4529 "Frei0r is a minimalistic plugin API for video effects.
4530 The main emphasis is on simplicity for an API that will round up
4531 the most common video effects into simple filters, sources and
4532 mixers that can be controlled by parameters. Frei0r wants to
4533 provide a way to share these simple effects between many
4534 applications, avoiding their reimplementation by different projects.
4535 It counts more than 100 plugins.")
4536 (license (list license:gpl2+
4537 ;; The following files are licensed as LGPL2.1+:
4538 ;; src/generator/ising0r/ising0r.c
4539 ;; src/generator/onecol0r/onecol0r.cpp
4540 ;; src/generator/nois0r/nois0r.cpp
4541 ;; src/generator/lissajous0r/lissajous0r.cpp
4542 ;; src/filter/ndvi/gradientlut.hpp
4543 ;; src/filter/ndvi/ndvi.cpp
4544 ;; src/filter/facedetect/facedetect.cpp
4545 license:lgpl2.1+))))
4546
4547 (define-public motion
4548 (package
4549 (name "motion")
4550 (version "4.3.2")
4551 (home-page "https://motion-project.github.io/")
4552 (source (origin
4553 (method git-fetch)
4554 (uri (git-reference
4555 (url "https://github.com/Motion-Project/motion")
4556 (commit (string-append "release-" version))))
4557 (sha256
4558 (base32
4559 "09xs815jsivcilpmnrx2jkcxirj4lg5kp99fkr0p2sdxw03myi95"))
4560 (file-name (git-file-name name version))))
4561 (build-system gnu-build-system)
4562 (native-inputs
4563 `(("autoconf" ,autoconf)
4564 ("automake" ,automake)
4565 ("gettext" ,gettext-minimal)
4566 ("pkg-config" ,pkg-config)))
4567 (inputs
4568 `(("libjpeg" ,libjpeg-turbo)
4569 ("ffmpeg" ,ffmpeg)
4570 ("libmicrohttpd" ,libmicrohttpd)
4571 ("sqlite" ,sqlite)))
4572 (arguments
4573 '(#:phases (modify-phases %standard-phases
4574 (replace 'bootstrap
4575 (lambda _
4576 (patch-shebang "scripts/version.sh")
4577 (invoke "autoreconf" "-vfi"))))
4578 #:configure-flags '("--sysconfdir=/etc")
4579 #:make-flags (list (string-append "sysconfdir="
4580 (assoc-ref %outputs "out")
4581 "/etc"))
4582
4583 #:tests? #f)) ; no 'check' target
4584 (synopsis "Detect motion from video signals")
4585 (description
4586 "Motion is a program that monitors the video signal from one or more
4587 cameras and is able to detect if a significant part of the picture has
4588 changed. Or in other words, it can detect motion.")
4589
4590 ;; Some files say "version 2" and others "version 2 or later".
4591 (license license:gpl2)))
4592
4593 (define-public subdl
4594 (let ((commit "4cf5789b11f0ff3f863b704b336190bf968cd471")
4595 (revision "1"))
4596 (package
4597 (name "subdl")
4598 (version (git-version "1.0.3" revision commit))
4599 (source (origin
4600 (method git-fetch)
4601 (uri (git-reference
4602 (url "https://github.com/alexanderwink/subdl")
4603 (commit commit)))
4604 (file-name (git-file-name name version))
4605 (sha256
4606 (base32
4607 "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8"))))
4608 (build-system trivial-build-system)
4609 (arguments
4610 `(#:modules ((guix build utils))
4611 #:builder (begin
4612 (use-modules (guix build utils))
4613 (let* ((out (assoc-ref %outputs "out"))
4614 (bin (string-append out "/bin"))
4615 (source (assoc-ref %build-inputs "source"))
4616 (python (assoc-ref %build-inputs "python")))
4617 (install-file (string-append source "/subdl") bin)
4618 (patch-shebang (string-append bin "/subdl")
4619 (list (string-append python "/bin")))))))
4620 (inputs (list python))
4621 (synopsis "Command-line tool for downloading subtitles from opensubtitles.org")
4622 (description "Subdl is a command-line tool for downloading subtitles from
4623 opensubtitles.org. By default, it will search for English subtitles, display
4624 the results, download the highest-rated result in the requested language and
4625 save it to the appropriate filename.")
4626 (license license:gpl3+)
4627 (home-page "https://github.com/alexanderwink/subdl"))))
4628
4629 (define-public l-smash
4630 (package
4631 (name "l-smash")
4632 (version "2.14.5")
4633 (source (origin
4634 (method git-fetch)
4635 (uri (git-reference
4636 (url "https://github.com/l-smash/l-smash")
4637 (commit (string-append "v" version))))
4638 (file-name (git-file-name name version))
4639 (sha256
4640 (base32
4641 "0rcq9727im6kd8da8b7kzzbzxdldvmh5nsljj9pvr4m3lj484b02"))))
4642 (build-system gnu-build-system)
4643 (arguments
4644 `(#:tests? #f ;no tests
4645 #:make-flags
4646 (list (string-append "LDFLAGS=-Wl,-L.,-rpath="
4647 (assoc-ref %outputs "out") "/lib"))
4648 #:phases
4649 (modify-phases %standard-phases
4650 ;; configure fails if it is followed by CONFIG_SHELL
4651 (replace 'configure
4652 (lambda* (#:key outputs #:allow-other-keys)
4653 (let ((out (assoc-ref outputs "out")))
4654 (invoke "./configure" (string-append "--prefix=" out)
4655 "--disable-static")))))))
4656 (native-inputs
4657 (list which))
4658 (home-page "https://l-smash.github.io/l-smash/")
4659 (synopsis "MP4 multiplexer and demultiplexer library")
4660 (description
4661 "L-SMASH is a cross-platform library that handles the ISO base media file
4662 format and some of its derived file formats, including MP4. It operates as a
4663 multiplexer and demultiplexer, and can mux video and audio in several formats
4664 using standalone executable files.")
4665 (license license:isc)))
4666
4667 (define-public qtfaststart
4668 (package
4669 (name "qtfaststart")
4670 (version "1.8")
4671 (source (origin
4672 (method url-fetch)
4673 (uri (pypi-uri "qtfaststart" version))
4674 (sha256
4675 (base32
4676 "0hcjfik8hhb1syqvyh5c6aillpvzal26nkjflcq1270z64aj6i5h"))))
4677 (build-system python-build-system)
4678 (arguments
4679 '(#:tests? #f)) ; no test suite
4680 (synopsis "Move QuickTime and MP4 metadata to the beginning of the file")
4681 (description "qtfaststart enables streaming and pseudo-streaming of
4682 QuickTime and MP4 files by moving metadata and offset information to the
4683 beginning of the file. It can also print some useful information about the
4684 structure of the file. This program is based on qt-faststart.c from the FFmpeg
4685 project, which is released into the public domain, as well as ISO 14496-12:2005
4686 (the official spec for MP4), which can be obtained from the ISO or found
4687 online.")
4688 (home-page "https://github.com/danielgtaylor/qtfaststart")
4689 (license license:expat)))
4690
4691 (define-public vidstab
4692 (let ((commit "aeabc8daa7904f9edf7441a11f293965a5ef53b8")
4693 (revision "0"))
4694 (package
4695 (name "vidstab")
4696 (version (git-version "1.1.0" revision commit))
4697 (source (origin
4698 (method git-fetch)
4699 (uri (git-reference
4700 (url "https://github.com/georgmartius/vid.stab")
4701 (commit commit)))
4702 (file-name (git-file-name name version))
4703 (sha256
4704 (base32
4705 "042iy0f3khwzr68djzvqgn301sy21ljvkf52rnc2c73q7ircnzzn"))))
4706 (build-system cmake-build-system)
4707 (arguments
4708 '(#:tests? #f)) ; tests are not run as part of standard build process
4709 (home-page "http://public.hronopik.de/vid.stab/")
4710 (synopsis "Video stabilization library")
4711 (description "Vidstab is a video stabilization library which can be used
4712 with FFmpeg. A video acquired using a hand-held camera or a camera mounted on a
4713 vehicle typically suffers from undesirable shakes and jitters. Activities such
4714 as surfing, skiing, riding and walking while shooting videos are especially
4715 prone to erratic camera shakes. Vidstab targets these video contents to help
4716 create smoother and stable videos.")
4717 (license license:gpl2+))))
4718
4719 (define-public libopenshot
4720 (package
4721 (name "libopenshot")
4722 (version "0.2.7")
4723 (source (origin
4724 (method git-fetch)
4725 (uri (git-reference
4726 (url "https://github.com/OpenShot/libopenshot")
4727 (commit (string-append "v" version))))
4728 (file-name (git-file-name name version))
4729 (sha256
4730 (base32
4731 "0i9bsn8gklm1mvj60l3d3xrxdgy8svpxjfqcwsr308j5zjn30pv8"))
4732 (modules '((guix build utils)))
4733 (snippet '(begin
4734 ;; Allow overriding of the python installation dir
4735 (substitute* "bindings/python/CMakeLists.txt"
4736 (("(SET\\(PYTHON_MODULE_PATH.*)\\)" _ set)
4737 (string-append set " CACHE PATH "
4738 "\"Python bindings directory\")")))
4739 (delete-file-recursively "thirdparty")
4740 #t))))
4741 (build-system cmake-build-system)
4742 (native-inputs
4743 `(("pkg-config" ,pkg-config)
4744 ("python" ,python)
4745 ("swig" ,swig)
4746 ("unittest++" ,unittest-cpp)))
4747 (inputs
4748 (list alsa-lib zlib))
4749 (propagated-inputs ;all referenced in installed headers
4750 (list cppzmq
4751 ffmpeg
4752 imagemagick
4753 jsoncpp
4754 libopenshot-audio
4755 qtbase-5
4756 qtmultimedia-5
4757 zeromq))
4758 (arguments
4759 `(#:configure-flags
4760 (list (string-append "-DPYTHON_MODULE_PATH:PATH=" %output "/lib/python"
4761 ,(version-major+minor (package-version python))
4762 "/site-packages")
4763 "-DUSE_SYSTEM_JSONCPP:BOOL=ON")
4764 #:phases
4765 (modify-phases %standard-phases
4766 (add-before 'configure 'set-vars
4767 (lambda* (#:key inputs #:allow-other-keys)
4768 (setenv "LIBOPENSHOT_AUDIO_DIR"
4769 (assoc-ref inputs "libopenshot-audio"))
4770 (setenv "ZMQDIR"
4771 (assoc-ref inputs "zeromq"))
4772 (setenv "UNITTEST_DIR"
4773 (search-input-directory inputs
4774 "include/UnitTest++")))))))
4775 (home-page "https://openshot.org")
4776 (synopsis "Video-editing, animation, and playback library")
4777 (description "OpenShot Library (libopenshot) is a powerful C++ video
4778 editing library with a multi-threaded and feature rich video editing
4779 API. It includes bindings for Python, Ruby, and other languages.")
4780 (license license:lgpl3+)))
4781
4782 (define-public openshot
4783 (package
4784 (name "openshot")
4785 (version "2.6.1")
4786 (source (origin
4787 (method git-fetch)
4788 (uri (git-reference
4789 (url "https://github.com/OpenShot/openshot-qt")
4790 (commit (string-append "v" version))))
4791 (file-name (git-file-name name version))
4792 (sha256
4793 (base32
4794 "0pa8iwl217503bjlqg2zlrw5lxyq5hvxrf5apxrh3843hj1w1myv"))
4795 (modules '((guix build utils)))
4796 (snippet
4797 '(begin
4798 ;; TODO: Unbundle jquery and others from src/timeline/media
4799 (delete-file-recursively "src/images/fonts") #t))))
4800 (build-system python-build-system)
4801 (inputs
4802 (list ffmpeg
4803 font-dejavu
4804 libopenshot
4805 python
4806 python-pyqt
4807 python-pyzmq
4808 python-requests
4809 qtsvg-5))
4810 (arguments
4811 `(#:modules ((guix build python-build-system)
4812 (guix build qt-utils)
4813 (guix build utils))
4814 #:imported-modules (,@%python-build-system-modules
4815 (guix build qt-utils))
4816 #:phases (modify-phases %standard-phases
4817 (delete 'build) ;install phase does all the work
4818 (replace 'check
4819 (lambda* (#:key tests? #:allow-other-keys)
4820 (when tests?
4821 (setenv "QT_QPA_PLATFORM" "offscreen")
4822 (invoke "python" "src/tests/query_tests.py"))))
4823 (add-after 'unpack 'patch-font-location
4824 (lambda* (#:key inputs #:allow-other-keys)
4825 (let ((font (assoc-ref inputs "font-dejavu")))
4826 (substitute* "src/classes/app.py"
4827 (("info.IMAGES_PATH") (string-append "\"" font "\""))
4828 (("fonts") "share/fonts/truetype")
4829 (("[A-Za-z_-]+.ttf") "DejaVuSans.ttf")))
4830 #t))
4831 ;; https://github.com/OpenShot/openshot-qt/issues/4502
4832 (add-before 'ensure-no-mtimes-pre-1980 'fix-symbolic-link
4833 (lambda _
4834 (delete-file "images/Humanity/actions/custom/razor_line_with_razor.png")
4835 (symlink "../../../../src/timeline/media/images/razor_line_with_razor.png"
4836 "images/Humanity/actions/custom/razor_line_with_razor.png")))
4837 (add-before 'install 'set-tmp-home
4838 (lambda _
4839 ;; src/classes/info.py "needs" to create several
4840 ;; directories in $HOME when loaded during build
4841 (setenv "HOME" "/tmp")
4842 #t))
4843 (add-after 'install 'wrap-program
4844 (lambda* (#:key outputs inputs #:allow-other-keys)
4845 (let ((out (assoc-ref outputs "out")))
4846 (wrap-qt-program "openshot-qt"
4847 #:output out #:inputs inputs))
4848 #t)))))
4849 (home-page "https://www.openshot.org/")
4850 (synopsis "Video editor")
4851 (description "OpenShot takes your videos, photos, and music files and
4852 helps you create the film you have always dreamed of. Easily add sub-titles,
4853 transitions, and effects and then export your film to many common formats.")
4854 (license license:gpl3+)))
4855
4856 (define-public shotcut
4857 (package
4858 (name "shotcut")
4859 (version "22.10.25")
4860 (source
4861 (origin
4862 (method git-fetch)
4863 (uri (git-reference
4864 (url "https://github.com/mltframework/shotcut")
4865 (commit (string-append "v" version))))
4866 (file-name (git-file-name name version))
4867 (sha256
4868 (base32 "12n179d1ymmzvlx5rzwmd89gwaa731b4y66nfl8wlr88wss4mncm"))))
4869 (build-system qt-build-system)
4870 (arguments
4871 `(#:tests? #f ;there are no tests
4872 #:phases
4873 (modify-phases %standard-phases
4874 (add-after 'unpack 'patch-executable-paths
4875 (lambda* (#:key inputs #:allow-other-keys)
4876 ;; Shotcut expects ffmpeg and melt executables in the shotcut
4877 ;; directory. Use full store paths.
4878 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
4879 (mlt (assoc-ref inputs "mlt")))
4880 (substitute* "src/jobs/ffmpegjob.cpp"
4881 (("\"ffmpeg\"") (string-append "\"" ffmpeg "/bin/ffmpeg\"")))
4882 (substitute* "src/jobs/meltjob.cpp"
4883 (("\"melt\"") (string-append "\"" mlt "/bin/melt\""))
4884 (("\"melt-7\"") (string-append "\"" mlt "/bin/melt-7\""))))))
4885 (add-after 'install 'wrap-executable
4886 (lambda* (#:key inputs outputs #:allow-other-keys)
4887 (let* ((out (assoc-ref outputs "out"))
4888 (frei0r (assoc-ref inputs "frei0r-plugins"))
4889 (jack (assoc-ref inputs "jack"))
4890 (ladspa (assoc-ref inputs "ladspa"))
4891 (mlt (assoc-ref inputs "mlt"))
4892 (sdl2 (assoc-ref inputs "sdl2")))
4893 (wrap-program (string-append out "/bin/shotcut")
4894 `("FREI0R_PATH" ":" =
4895 (,(string-append frei0r "/lib/frei0r-1")))
4896 `("LADSPA_PATH" ":" =
4897 (,(string-append ladspa "/lib/ladspa")))
4898 `("LD_LIBRARY_PATH" ":" prefix
4899 ,(list (string-append jack "/lib" ":" sdl2 "/lib")))
4900 `("PATH" ":" prefix
4901 ,(list (string-append mlt "/bin"))))))))))
4902 (native-inputs
4903 `(("pkg-config" ,pkg-config)
4904 ("python-wrapper" ,python-wrapper)
4905 ("qttools-5" ,qttools-5)))
4906 (inputs
4907 (list bash-minimal
4908 ffmpeg
4909 fftw
4910 frei0r-plugins
4911 jack-1
4912 ladspa
4913 lame
4914 libvpx
4915 libx264
4916 mlt
4917 pulseaudio
4918 qtbase-5
4919 qtdeclarative-5
4920 qtgraphicaleffects
4921 qtmultimedia-5
4922 qtquickcontrols-5
4923 qtquickcontrols2-5
4924 qtsvg-5
4925 qtwebkit
4926 qtwebsockets-5
4927 qtx11extras
4928 sdl2))
4929 (home-page "https://www.shotcut.org/")
4930 (synopsis "Video editor built on the MLT framework")
4931 (description
4932 "Shotcut is a video editor built on the MLT framework. Features include
4933 a wide range of formats through @code{ffmpeg}, 4k resolution support, webcam
4934 and audio capture, network stream playback, and many more.")
4935 (license license:gpl3+)))
4936
4937 (define-public dav1d
4938 (package
4939 (name "dav1d")
4940 (version "0.9.2")
4941 (source
4942 (origin
4943 (method git-fetch)
4944 (uri (git-reference
4945 (url "https://code.videolan.org/videolan/dav1d.git")
4946 (commit version)))
4947 (file-name (git-file-name name version))
4948 (sha256
4949 (base32 "0bkps488h9s15ylvkm4fmfywgrpbw570glawpnv6khpq9n223dzl"))))
4950 (build-system meson-build-system)
4951 (native-inputs (list nasm))
4952 (home-page "https://code.videolan.org/videolan/dav1d")
4953 (synopsis "AV1 decoder")
4954 (description "dav1d is a new AV1 cross-platform decoder, and focused on
4955 speed and correctness.")
4956 (license license:bsd-2)))
4957
4958 (define-public wlstream
4959 (let ((commit "182076a94562b128c3a97ecc53cc68905ea86838")
4960 (revision "1"))
4961 (package
4962 (name "wlstream")
4963 (version (git-version "0.0" revision commit))
4964 (source
4965 (origin
4966 (method git-fetch)
4967 (uri (git-reference
4968 (url "https://github.com/atomnuker/wlstream")
4969 (commit commit)))
4970 (file-name (git-file-name name version))
4971 (sha256
4972 (base32
4973 "01qbcgfl3g9kfwn1jf1z9pdj3bvf5lmg71d1vwkcllc2az24bjqp"))))
4974 (build-system meson-build-system)
4975 (native-inputs (list libdrm pkg-config))
4976 (inputs (list ffmpeg pulseaudio wayland wayland-protocols))
4977 (home-page "https://github.com/atomnuker/wlstream")
4978 (synopsis "Screen capture tool for Wayland sessions")
4979 (description "Wlstream is a screen capture tool for recording audio and
4980 video from a Wayland session.")
4981 (license license:lgpl2.1+))))
4982
4983 (define-public gaupol
4984 (package
4985 (name "gaupol")
4986 (version "1.11")
4987 (source (origin
4988 (method git-fetch)
4989 (uri (git-reference
4990 (url "https://github.com/otsaloma/gaupol/")
4991 (commit version)))
4992 (file-name (git-file-name name version))
4993 (sha256
4994 (base32
4995 "01qbhhycmy26b2mw2jlri321k478jhp7y0jzlcv87iaq05qr4pc8"))))
4996 (build-system python-build-system)
4997 (native-inputs
4998 `(("gettext" ,gettext-minimal)
4999 ("pkg-config" ,pkg-config)))
5000 (inputs
5001 (list python-pygobject
5002 gtk+
5003 python-pycairo ; Required or else clicking on a subtitle line fails.
5004 python-chardet ; Optional: Character encoding detection.
5005 gtkspell3 ; Optional: Inline spell-checking.
5006 iso-codes ; Optional: Translations.
5007 gstreamer
5008 gst-libav
5009 gst-plugins-base
5010 gst-plugins-good
5011 gst-plugins-bad
5012 gst-plugins-ugly))
5013 (arguments
5014 `(#:tests? #f ; Tests seem to require networking.
5015 #:phases
5016 (modify-phases %standard-phases
5017 (add-after 'unpack 'disable-builtin-byte-compilation
5018 (lambda _
5019 ;; The setup.py script attempts to compile bytecode and fails.
5020 ;; We compile bytecode in a separate phase, so just disable it.
5021 (substitute* "setup.py"
5022 (("distutils\\.util\\.byte_compile\\(.*")
5023 ""))))
5024 ;; gaupol's setup.py script does not support one of the Python build
5025 ;; system's default flags, "--single-version-externally-managed".
5026 (replace 'install
5027 (lambda* (#:key outputs #:allow-other-keys)
5028 (invoke "python" "setup.py" "install"
5029 (string-append "--prefix=" (assoc-ref outputs "out"))
5030 "--root=/")))
5031 (add-after 'install 'wrap-gaupol
5032 (lambda* (#:key outputs #:allow-other-keys)
5033 (let ((out (assoc-ref outputs "out"))
5034 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
5035 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
5036 (wrap-program (string-append out "/bin/gaupol")
5037 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
5038 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))))
5039 (add-after 'unpack 'patch-data-dir
5040 ;; Fix some path variables that setup.py seems to garble.
5041 (lambda* (#:key outputs #:allow-other-keys)
5042 (let ((out (assoc-ref outputs "out")))
5043 (substitute* "setup.py"
5044 (("DATA_DIR = \\{!r\\}\"\\.format\\(data_dir\\)")
5045 (string-append "DATA_DIR = '" out "/share/gaupol'\""))
5046 (("LOCALE_DIR = \\{!r\\}\"\\.format\\(locale_dir\\)")
5047 (string-append "LOCALE_DIR = '" out "/share/locale'\"")))))))))
5048 (synopsis "Editor for text-based subtitles")
5049 (description
5050 "Gaupol supports multiple subtitle file formats and provides means of
5051 creating subtitles, editing texts and timing subtitles to match video. The
5052 user interface features a builtin video player and is designed with attention
5053 to convenience of translating and batch processing of multiple documents.")
5054 (home-page "https://otsaloma.io/gaupol/")
5055 (license license:gpl3+)))
5056
5057 (define-public theorafile
5058 (let ((commit "404b14d7602b5918d117eaa64e8aa6601ede8593"))
5059 (package
5060 (name "theorafile")
5061 (version (git-version "0.0.0" "1" commit))
5062 (source
5063 (origin
5064 (method git-fetch)
5065 (uri (git-reference
5066 (url "https://github.com/FNA-XNA/Theorafile")
5067 (commit commit)))
5068 (file-name (git-file-name name version))
5069 (sha256
5070 (base32 "128c3pjzqbgrj020glm5jd6ss18vl19471lj615w2brjwb7c1f0z"))))
5071 (build-system gnu-build-system)
5072 (arguments
5073 '(#:make-flags '("CC=gcc")
5074 #:phases
5075 (modify-phases %standard-phases
5076 (delete 'configure)
5077 (replace 'check
5078 (lambda _
5079 (setenv "CC" "gcc")
5080 (invoke "make" "test")))
5081 (replace 'install
5082 (lambda* (#:key outputs #:allow-other-keys)
5083 (let ((out (assoc-ref outputs "out")))
5084 (install-file "libtheorafile.so" (string-append out "/lib"))
5085 (install-file "theorafile.h" (string-append out "/include")))
5086 #t)))))
5087 (native-inputs
5088 ;; For tests.
5089 (list sdl2))
5090 (home-page "https://github.com/FNA-XNA/Theorafile")
5091 (synopsis "Ogg Theora Video Decoder Library")
5092 (description "Theorafile is a library for quickly and easily decoding Ogg
5093 Theora videos. Theorafile was written to be used for FNA's VideoPlayer.")
5094 (license license:zlib))))
5095
5096 (define-public dvdbackup
5097 (package
5098 (name "dvdbackup")
5099 (version "0.4.2")
5100 (source
5101 (origin
5102 (method url-fetch)
5103 (uri (string-append "mirror://sourceforge/dvdbackup/dvdbackup/"
5104 "dvdbackup-" version "/"
5105 "dvdbackup-" version ".tar.xz"))
5106 (sha256
5107 (base32 "1rl3h7waqja8blmbpmwy01q9fgr5r0c32b8dy3pbf59bp3xmd37g"))))
5108 (build-system gnu-build-system)
5109 (inputs
5110 (list libdvdcss libdvdread))
5111 (home-page "http://dvdbackup.sourceforge.net")
5112 (synopsis "DVD video ripper")
5113 (description
5114 "A simple command line tool to backup video from a DVD. Decrypts the
5115 DVD using @command{libdvdcss}, but does @strong{not} demux, remux,
5116 transcode or reformat the videos in any way, producing perfect backups.")
5117 (license license:gpl3+)))
5118
5119 (define-public svt-av1
5120 (package
5121 (name "svt-av1")
5122 (version "0.9.1")
5123 (source
5124 (origin
5125 (method git-fetch)
5126 (uri (git-reference
5127 (url "https://gitlab.com/AOMediaCodec/SVT-AV1.git")
5128 (commit (string-append "v" version))))
5129 (file-name (git-file-name name version))
5130 (sha256
5131 (base32 "02fchq2vlxcxzbrss72xl9vrxzysdy39d5i159bmg3qa45ngd2iw"))))
5132 (build-system cmake-build-system)
5133 ;; SVT-AV1 only supports 64-bit Intel-compatible CPUs.
5134 (supported-systems '("x86_64-linux"))
5135 (arguments
5136 ;; The test suite tries to download test data and git clone a 3rd-party
5137 ;; fork of libaom. Skip it.
5138 `(#:tests? #f
5139 #:phases
5140 (modify-phases %standard-phases
5141 (add-after 'install 'install-documentation
5142 (lambda* (#:key outputs #:allow-other-keys)
5143 (let* ((out (assoc-ref %outputs "out"))
5144 (doc (string-append out "/share/doc/svt-av1-" ,version)))
5145 (copy-recursively "../source/Docs" doc)
5146 #t))))))
5147 (native-inputs
5148 (list yasm))
5149 (synopsis "AV1 video codec")
5150 (description "SVT-AV1 is an AV1 codec implementation. The encoder is a
5151 work-in-progress, aiming to support video-on-demand and live streaming
5152 applications. It only supports Intel-compatible CPUs (x86).")
5153 (home-page "https://gitlab.com/AOMediaCodec/SVT-AV1")
5154 (license license:bsd-2)))
5155
5156 (define-public svt-vp9
5157 (package
5158 (name "svt-vp9")
5159 (version "0.3.0")
5160 (source (origin
5161 (method git-fetch)
5162 (uri (git-reference
5163 (url "https://github.com/OpenVisualCloud/SVT-VP9")
5164 (commit (string-append "v" version))))
5165 (file-name (git-file-name name version))
5166 (sha256
5167 (base32
5168 "1ypdiw4cq22llvm8jyszxdq6r1aydkj80dsxjarjn5b7c1f2q3ar"))))
5169 ;; SVT-VP9 only supports 64-bit Intel-compatible CPUs.
5170 (supported-systems '("x86_64-linux"))
5171 (build-system cmake-build-system)
5172 (arguments
5173 `(#:tests? #f ; No test suite
5174 #:phases
5175 (modify-phases %standard-phases
5176 (add-after 'install 'install-documentation
5177 (lambda* (#:key outputs #:allow-other-keys)
5178 (let* ((out (assoc-ref %outputs "out"))
5179 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5180 (copy-recursively "../source/Docs" doc)
5181 #t))))))
5182 (native-inputs
5183 (list yasm))
5184 (home-page "https://github.com/OpenVisualCloud/SVT-VP9")
5185 (synopsis "VP9 video encoder")
5186 (description "SVT-VP9 is a VP9 video encoder implementation. It is focused
5187 on supporting video-on-demand and live encoding on Intel Xeon processors.")
5188 (license license:bsd-2)))
5189
5190 (define-public w-scan
5191 (package
5192 (name "w-scan")
5193 (version "20170107")
5194 (source
5195 (origin
5196 (method url-fetch)
5197 (uri (string-append "https://www.gen2vdr.de/wirbel/w_scan/w_scan-"
5198 version ".tar.bz2"))
5199 (sha256
5200 (base32 "1zkgnj2sfvckix360wwk1v5s43g69snm45m0drnzyv7hgf5g7q1q"))))
5201 (build-system gnu-build-system)
5202 (arguments
5203 `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5204 (synopsis "Scan ATSC/DVB-C/DVB-S/DVB-T channels")
5205 (description
5206 "This is a small command line utility used to perform frequency scans for
5207 DVB and ATSC transmissions without initial tuning data. It can print the
5208 result in several formats:
5209 @itemize
5210 @item VDR channels.conf,
5211 @item czap/tzap/xine/mplayer channels.conf,
5212 @item Gstreamer dvbsrc plugin,
5213 @item VLC xspf playlist,
5214 @item XML,
5215 @item initial tuning data for scan or dvbv5-scan.
5216 @end itemize\n")
5217 (home-page "https://www.gen2vdr.de/wirbel/w_scan/index2.html")
5218 (license license:gpl2+)))
5219
5220 ;;; XXX: This crate is used only for rav1e and can be removed once the latter
5221 ;;; is updated. See <https://issues.guix.gnu.org/52837>.
5222 (define rust-dav1d-sys-0.3.2
5223 (package
5224 (name "rust-dav1d-sys")
5225 (version "0.3.2")
5226 (source
5227 (origin
5228 (method url-fetch)
5229 (uri (crate-uri "dav1d-sys" version))
5230 (file-name
5231 (string-append name "-" version ".tar.gz"))
5232 (sha256
5233 (base32 "1jdxhnlxcml6jd67lx78ifzkn1xm18zfk4li7vjdh3fa61i073kx"))))
5234 (build-system cargo-build-system)
5235 (arguments
5236 `(#:cargo-inputs
5237 (("rust-bindgen" ,rust-bindgen-0.54)
5238 ("rust-metadeps" ,rust-metadeps-1))))
5239 (native-inputs
5240 (list pkg-config))
5241 (inputs
5242 (list dav1d clang llvm))
5243 (home-page "https://github.com/rust-av/dav1d-rs")
5244 (synopsis "FFI bindings to dav1d")
5245 (description "This package provides FFI bindings to dav1d.")
5246 (license license:expat)))
5247
5248 (define-public rav1e
5249 (package
5250 (name "rav1e")
5251 (version "0.5.1")
5252 (source
5253 (origin
5254 (method url-fetch)
5255 (uri (crate-uri "rav1e" version))
5256 (file-name
5257 (string-append name "-" version ".tar.gz"))
5258 (sha256
5259 (base32
5260 "006bfcmjwg0phg8gc25b1sl2ngjrb2bh1b3fd0s5gbf9nlkr8qsn"))
5261 (modules '((guix build utils)))
5262 (snippet
5263 '(substitute* "Cargo.toml"
5264 (("\\[package\\]" m)
5265 (string-append "cargo-features = [\"rust-version\"]\n" m))))))
5266 (build-system cargo-build-system)
5267 (arguments
5268 `(;; Strip the '--release' flag to work around the doctest failures with
5269 ;; Rust 1.57 (see: https://github.com/xiph/rav1e/issues/2851).
5270 #:cargo-test-flags '()
5271 #:cargo-inputs
5272 (("rust-aom-sys" ,rust-aom-sys-0.3)
5273 ("rust-arbitrary" ,rust-arbitrary-0.4)
5274 ("rust-arg-enum-proc-macro" ,rust-arg-enum-proc-macro-0.3)
5275 ("rust-arrayvec" ,rust-arrayvec-0.7)
5276 ("rust-av-metrics" ,rust-av-metrics-0.7)
5277 ("rust-backtrace" ,rust-backtrace-0.3)
5278 ("rust-bitstream-io" ,rust-bitstream-io-1)
5279 ("rust-byteorder" ,rust-byteorder-1)
5280 ("rust-cfg-if" ,rust-cfg-if-1)
5281 ("rust-clap" ,rust-clap-2)
5282 ("rust-console" ,rust-console-0.14)
5283 ("rust-crossbeam" ,rust-crossbeam-0.8)
5284 ("rust-dav1d-sys" ,rust-dav1d-sys-0.3)
5285 ("rust-fern" ,rust-fern-0.6)
5286 ("rust-image" ,rust-image-0.23)
5287 ("rust-interpolate-name" ,rust-interpolate-name-0.2)
5288 ("rust-itertools" ,rust-itertools-0.10)
5289 ("rust-ivf" ,rust-ivf-0.1)
5290 ("rust-libc" ,rust-libc-0.2)
5291 ("rust-libfuzzer-sys" ,rust-libfuzzer-sys-0.3)
5292 ("rust-log" ,rust-log-0.4)
5293 ("rust-nasm-rs" ,rust-nasm-rs-0.2)
5294 ("rust-noop-proc-macro" ,rust-noop-proc-macro-0.3)
5295 ("rust-num-derive" ,rust-num-derive-0.3)
5296 ("rust-num-traits" ,rust-num-traits-0.2)
5297 ("rust-paste" ,rust-paste-1)
5298 ("rust-rand" ,rust-rand-0.8)
5299 ("rust-rand-chacha" ,rust-rand-chacha-0.3)
5300 ("rust-rayon" ,rust-rayon-1)
5301 ("rust-regex" ,rust-regex-1)
5302 ("rust-rust-hawktracer" ,rust-rust-hawktracer-0.7)
5303 ("rust-rustc-version" ,rust-rustc-version-0.4)
5304 ("rust-scan-fmt" ,rust-scan-fmt-0.2)
5305 ("rust-serde" ,rust-serde-1)
5306 ("rust-signal-hook" ,rust-signal-hook-0.3)
5307 ("rust-simd-helpers" ,rust-simd-helpers-0.1)
5308 ("rust-thiserror" ,rust-thiserror-1)
5309 ("rust-toml" ,rust-toml-0.5)
5310 ("rust-v-frame" ,rust-v-frame-0.2)
5311 ("rust-vergen" ,rust-vergen-3)
5312 ("rust-wasm-bindgen" ,rust-wasm-bindgen-0.2)
5313 ("rust-y4m" ,rust-y4m-0.7))
5314 #:cargo-development-inputs
5315 (("rust-assert-cmd" ,rust-assert-cmd-2)
5316 ("rust-cc" ,rust-cc-1)
5317 ("rust-criterion" ,rust-criterion-0.3)
5318 ("rust-interpolate-name" ,rust-interpolate-name-0.2)
5319 ("rust-pretty-assertions" ,rust-pretty-assertions-0.7)
5320 ("rust-rand" ,rust-rand-0.8)
5321 ("rust-rand-chacha" ,rust-rand-chacha-0.3)
5322 ("rust-semver" ,rust-semver-1))
5323 #:phases
5324 (modify-phases %standard-phases
5325 (add-after 'unpack 'relax-versions
5326 (lambda _
5327 (substitute* "Cargo.toml"
5328 ;; Allow using more recent versions of
5329 (("~3.1.2") "~3"))))
5330 (add-after 'configure 'force-rust-edition-2018
5331 (lambda* (#:key vendor-dir #:allow-other-keys)
5332 ;; Force all the dependencies to not be higher than edition 2018.
5333 (with-fluids ((%default-port-encoding #f))
5334 (substitute* (find-files vendor-dir "Cargo.toml")
5335 (("edition = \\\"2021\\\"") "edition = \"2018\"")))))
5336 (replace 'build
5337 (lambda* (#:key outputs #:allow-other-keys)
5338 (let ((out (assoc-ref outputs "out")))
5339 (invoke "cargo" "cinstall" "--release"
5340 (string-append "--prefix=" out)))))
5341 (add-after 'install 'delete-static-library
5342 (lambda* (#:key outputs #:allow-other-keys)
5343 ;; Delete 80 MiB (!) static library.
5344 (delete-file (string-append (assoc-ref outputs "out")
5345 "/lib/librav1e.a")))))))
5346 (native-inputs
5347 (list rust-cargo-c nasm))
5348 (home-page "https://github.com/xiph/rav1e/")
5349 (synopsis "Fast and safe AV1 encoder")
5350 (description "@code{rav1e} is an AV1 video encoder. It is designed to
5351 eventually cover all use cases, though in its current form it is most suitable
5352 for cases where libaom (the reference encoder) is too slow.")
5353 (license license:bsd-2)))
5354
5355 (define-public peek
5356 (package
5357 (name "peek")
5358 (version "1.5.1")
5359 (source
5360 (origin
5361 (method git-fetch)
5362 (uri (git-reference
5363 (url "https://github.com/phw/peek")
5364 (commit version)))
5365 (file-name (git-file-name name version))
5366 (sha256
5367 (base32 "1xwlfizga6hvjqq127py8vabaphsny928ar7mwqj9cyqfl6fx41x"))))
5368 (build-system meson-build-system)
5369 (arguments '(#:glib-or-gtk? #t))
5370 (inputs
5371 `(("gtk+" ,gtk+)
5372 ("python" ,python-wrapper)))
5373 (native-inputs
5374 `(("desktop-file-utils" ,desktop-file-utils) ; for update-desktop-database
5375 ("gettext" ,gettext-minimal)
5376 ("glib:bin" ,glib "bin") ; for glib-compile-resources
5377 ("gtk+-bin" ,gtk+ "bin") ; For gtk-update-icon-cache
5378 ("pkg-config" ,pkg-config)
5379 ("vala" ,vala)))
5380 (home-page "https://github.com/phw/peek")
5381 (synopsis "Simple animated GIF screen recorder")
5382 (description
5383 "Peek makes it easy to create short screencasts of a screen area. It was
5384 built for the specific use case of recording screen areas, e.g. for easily
5385 showing UI features of your own apps or for showing a bug in bug reports.
5386 With Peek, you simply place the Peek window over the area you want to record
5387 and press \"Record\". Peek is optimized for generating animated GIFs, but you
5388 can also directly record to WebM or MP4 if you prefer.")
5389 (license license:gpl3+)))
5390
5391 (define-public wf-recorder
5392 (package
5393 (name "wf-recorder")
5394 (version "0.3.0")
5395 (source (origin
5396 (method git-fetch)
5397 (uri (git-reference
5398 (url "https://github.com/ammen99/wf-recorder")
5399 (commit (string-append "v" version))))
5400 (file-name (git-file-name name version))
5401 (sha256
5402 (base32
5403 "18csvix8fdqir52q729rgcy355xy2ngvmr05l1abflpbvsklbn52"))))
5404 (build-system meson-build-system)
5405 (native-inputs
5406 (list pkg-config))
5407 (inputs
5408 (list ffmpeg pulseaudio wayland wayland-protocols libx264))
5409 (home-page "https://github.com/ammen99/wf-recorder")
5410 (synopsis "Screen recorder for wlroots-based compositors")
5411 (description
5412 "@code{wf-recorder} is a utility program for screen recording of
5413 wlroots-based compositors. More specifically, those that support
5414 @code{wlr-screencopy-v1} and @code{xdg-output}.")
5415 (license license:expat)))
5416
5417 (define-public guvcview
5418 (package
5419 (name "guvcview")
5420 (version "2.0.8")
5421 (source (origin
5422 (method url-fetch)
5423 (uri (string-append "mirror://sourceforge/guvcview/source/guvcview-"
5424 "src-" version ".tar.bz2"))
5425 (sha256
5426 (base32
5427 "108c4g0ns9i1wnxyalmpjqbhlflmrj855vxgggr6qrl6h924w7x2"))))
5428 (build-system gnu-build-system)
5429 (arguments
5430 ;; There are no tests and "make check" would fail on an intltool error.
5431 '(#:tests? #f))
5432 (native-inputs
5433 (list pkg-config intltool))
5434 (inputs
5435 (list bdb
5436 gtk+
5437 eudev
5438 libjpeg-turbo
5439 libusb
5440 v4l-utils ;libv4l2
5441 ffmpeg ;libavcodec, libavutil
5442 sdl2
5443 gsl
5444 portaudio
5445 alsa-lib))
5446 (home-page "http://guvcview.sourceforge.net/")
5447 (synopsis "Control your webcam and capture videos and images")
5448 (description
5449 "GTK+ UVC Viewer (guvcview) is a graphical application to control a
5450 webcam accessible with Video4Linux (V4L2) and to capture videos and images.
5451 It provides control over precise settings of the webcam such as exposure,
5452 brightness, contrast, and frame rate.")
5453
5454 ;; 'COPYING' is GPLv3 but source headers say GPLv2+.
5455 (license license:gpl2+)))
5456
5457 (define-public get-iplayer
5458 (package
5459 (name "get-iplayer")
5460 (version "3.30")
5461 (source
5462 (origin
5463 (method git-fetch)
5464 (uri (git-reference
5465 (url "https://github.com/get-iplayer/get_iplayer")
5466 (commit (string-append "v" version))))
5467 (file-name (git-file-name name version))
5468 (sha256
5469 (base32 "1kzsdq1mhm5h83bbdbhh3jhpfvq4f13ly22mfd6vvmhj8mq084pi"))))
5470 (build-system perl-build-system)
5471 (arguments
5472 `(#:tests? #f ; no tests
5473 #:phases
5474 (modify-phases %standard-phases
5475 (delete 'configure)
5476 (delete 'build)
5477 (replace 'install
5478 (lambda* (#:key outputs #:allow-other-keys)
5479 (let* ((out (assoc-ref outputs "out"))
5480 (bin (string-append out "/bin"))
5481 (man (string-append out "/share/man/man1")))
5482 (install-file "get_iplayer" bin)
5483 (install-file "get_iplayer.cgi" bin)
5484 (install-file "get_iplayer.1" man))))
5485 (add-after 'install 'wrap-program
5486 (lambda* (#:key inputs outputs #:allow-other-keys)
5487 (let* ((out (assoc-ref outputs "out"))
5488 (perllib (string-append out "/lib/perl5/site_perl/"
5489 ,(package-version perl))))
5490 (wrap-program (string-append out "/bin/get_iplayer")
5491 `("PERL5LIB" ":"
5492 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
5493 (wrap-program (string-append out "/bin/get_iplayer.cgi")
5494 `("PERL5LIB" ":"
5495 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))))))))
5496 (inputs
5497 (list perl-mojolicious perl-lwp-protocol-https perl-xml-libxml))
5498 (home-page "https://github.com/get-iplayer/get_iplayer")
5499 (synopsis "Download or stream available BBC iPlayer TV and radio programmes")
5500 (description "@code{get_iplayer} lists, searches and records BBC iPlayer
5501 TV/Radio, BBC Podcast programmes. Other third-party plugins may be available.
5502 @code{get_iplayer} has three modes: recording a complete programme for later
5503 playback, streaming a programme directly to a playback application, such as
5504 mplayer; and as a @dfn{Personal Video Recorder} (PVR), subscribing to search
5505 terms and recording programmes automatically. It can also stream or record live
5506 BBC iPlayer output.")
5507 (license license:gpl3+)))
5508
5509 (define-public ogmtools
5510 (package
5511 (name "ogmtools")
5512 (version "1.5")
5513 (source (origin
5514 (method url-fetch)
5515 (uri (string-append "https://www.bunkus.org/videotools/ogmtools/ogmtools-"
5516 version
5517 ".tar.bz2"))
5518 (sha256
5519 (base32
5520 "1spx81p5wf59ksl3r3gvf78d77sh7gj8a6lw773iv67bphfivmn8"))))
5521 (build-system gnu-build-system)
5522 (inputs
5523 (list libvorbis libdvdread))
5524 (synopsis "Information, extraction or creation for OGG media streams")
5525 (description
5526 "These tools allow information about (@code{ogminfo}) or extraction from
5527 \(@code{ogmdemux}) or creation of (@code{ogmmerge}) OGG media streams. It
5528 includes @code{dvdxchap} tool for extracting chapter information from DVD.")
5529 (license license:gpl2)
5530 (home-page "https://www.bunkus.org/videotools/ogmtools/")))
5531
5532 (define-public libcaption
5533 (package
5534 (name "libcaption")
5535 (version "0.7")
5536 (source (origin
5537 (method git-fetch)
5538 (uri (git-reference
5539 (url "https://github.com/szatmary/libcaption")
5540 (commit version)))
5541 (file-name (git-file-name name version))
5542 (sha256
5543 (base32
5544 "16mhw8wpl7wdjj4n7rd1c294p1r8r322plj7z91crla5aah726rq"))))
5545 (build-system cmake-build-system)
5546 (arguments
5547 `(#:tests? #f ; Cannot figure out how to run the unit tests
5548 #:configure-flags '("-DENABLE_RE2C=ON")))
5549 (native-inputs
5550 (list re2c))
5551 (synopsis "CEA608 / CEA708 closed-caption codec")
5552 (description "Libcaption creates and parses closed-caption data,
5553 providing an encoder / decoder for the EIA608 and CEA708 closed-caption
5554 standards.
5555
5556 608 support is currently limited to encoding and decoding the necessary control
5557 and preamble codes as well as support for the Basic North American, Special
5558 North American and Extended Western European character sets.
5559
5560 708 support is limited to encoding the 608 data in NTSC field 1 user data type
5561 structure.
5562
5563 In addition, utility functions to create h.264 SEI (Supplementary enhancement
5564 information) NALUs (Network Abstraction Layer Unit) for inclusion into an h.264
5565 elementary stream are provided.")
5566 (home-page "https://github.com/szatmary/libcaption")
5567 (license license:expat)))
5568
5569 (define-public video-contact-sheet
5570 (package
5571 (name "video-contact-sheet")
5572 (version "1.13.4")
5573 (source (origin
5574 (method url-fetch)
5575 (uri (string-append "http://p.outlyer.net/vcs/files/vcs-" version
5576 ".tar.gz"))
5577 (sha256
5578 (base32
5579 "0jsl93r0rnybjcipqbww5hwsr9ln6kz1qnf32qfxdvhfw52n27fw"))))
5580 (build-system gnu-build-system)
5581 (arguments
5582 (list
5583 #:make-flags
5584 #~(list (string-append "prefix=" #$output))
5585 #:phases
5586 #~(modify-phases %standard-phases
5587 (delete 'configure)
5588 (delete 'build)
5589 (delete 'check)
5590 (add-after 'install 'wrap-program
5591 (lambda _
5592 (wrap-program (string-append #$output "/bin/vcs")
5593 `("PATH" ":" prefix
5594 ,(map (lambda (dir)
5595 (string-append dir "/bin"))
5596 (list #$(this-package-input "ffmpeg")
5597 #$(this-package-input "imagemagick"))))))))))
5598 (inputs
5599 (list bash-minimal ffmpeg imagemagick))
5600 (synopsis "Create contact sheets (preview images) from videos")
5601 (description "@acronym{VCS, Video Contact Sheet} is a Bash script meant to
5602 create video contact sheets (previews) of videos. Any video supported by
5603 MPlayer and FFmpeg can be used. A note of warning: Unlike most similar tools
5604 VCS, by default, makes screenshots the same size as the video, see the manual
5605 for details on how to change this.")
5606 (home-page "http://p.outlyer.net/vcs/")
5607 (license license:lgpl2.1+)))