a92588a9e2112178deedccc719e65cde2aea6691
[jackhill/guix/guix.git] / gnu / packages / gstreamer.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
4 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2016, 2017, 2022 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016, 2018 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
11 ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
12 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages gstreamer)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix gexp)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system meson)
38 #:use-module (guix build-system trivial)
39 #:use-module (guix utils)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages aidc)
42 #:use-module (gnu packages audio)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages base)
45 #:use-module (gnu packages bash)
46 #:use-module (gnu packages bison)
47 #:use-module (gnu packages cdrom)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages elf)
52 #:use-module (gnu packages flex)
53 #:use-module (gnu packages freedesktop)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages graphics)
61 #:use-module (gnu packages graphviz)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages image-processing)
65 #:use-module (gnu packages iso-codes)
66 #:use-module (gnu packages java)
67 #:use-module (gnu packages libunwind)
68 #:use-module (gnu packages libusb)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages maths)
71 #:use-module (gnu packages mp3)
72 #:use-module (gnu packages multiprecision)
73 #:use-module (gnu packages music)
74 #:use-module (gnu packages ncurses)
75 #:use-module (gnu packages nettle)
76 #:use-module (gnu packages networking)
77 #:use-module (gnu packages ocr)
78 #:use-module (gnu packages perl)
79 #:use-module (gnu packages photo)
80 #:use-module (gnu packages pulseaudio)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages rdf)
83 #:use-module (gnu packages sdl)
84 #:use-module (gnu packages shells)
85 #:use-module (gnu packages video)
86 #:use-module (gnu packages xorg)
87 #:use-module (gnu packages xdisorg)
88 #:use-module (gnu packages xiph)
89 #:use-module (gnu packages pkg-config)
90 #:use-module (gnu packages ruby)
91 #:use-module (gnu packages speech)
92 #:use-module (gnu packages python)
93 #:use-module (gnu packages ssh)
94 #:use-module (gnu packages telephony)
95 #:use-module (gnu packages tls)
96 #:use-module (gnu packages version-control)
97 #:use-module (gnu packages vulkan)
98 #:use-module (gnu packages webkit)
99 #:use-module (gnu packages assembly)
100 #:use-module (gnu packages xml))
101
102 (define-public openni2
103 (package
104 (name "openni2")
105 (version "2.2.0")
106 (source
107 (origin
108 (method git-fetch)
109 (uri
110 (git-reference
111 (url "https://github.com/occipital/OpenNI2")
112 (commit (string-append "v" version "-debian"))))
113 (file-name (git-file-name name version))
114 (sha256
115 (base32 "0mfnyzpq53wnzgjfx91xcbx0nrl0lp1vrk1rk20a3gb3kshsr675"))))
116 (build-system gnu-build-system)
117 (arguments
118 `(#:tests? #f ; No target
119 #:phases
120 (modify-phases %standard-phases
121 (delete 'configure))))
122 (native-inputs
123 `(("graphviz" ,graphviz)
124 ("doxygen" ,doxygen)
125 ("openjdk" ,openjdk14)
126 ("openjdk:jdk" ,openjdk14 "jdk")
127 ("python" ,python-wrapper)))
128 (inputs
129 `(("freeglut3" ,freeglut)
130 ("libudev" ,eudev)
131 ("libusb" ,libusb)))
132 (synopsis "Framework for sensor-based 'Natural Interaction")
133 (description "OpenNI is a framework for getting data to support
134 'Natural Interaction', i.e. skeleton tracking, gesture tracking, and similar
135 ways of getting data from humans. It provides the interface for physical devices
136 and for middleware components.")
137 (home-page "https://structure.io/openni")
138 (license license:asl2.0)))
139
140 (define-public libdc1394
141 (package
142 (name "libdc1394")
143 (version "2.2.6")
144 (source (origin
145 (method url-fetch)
146 (uri
147 (string-append "https://sourceforge.net/projects/" name "/files/"
148 name "-2" "/" version "/" name "-" version ".tar.gz"))
149 (sha256
150 (base32 "1v8gq54n1pg8izn7s15yylwjf8r1l1dmzbm2yvf6pv2fmb4mz41b"))))
151 (build-system gnu-build-system)
152 (native-inputs
153 (list doxygen perl pkg-config))
154 (inputs
155 (list glu
156 libraw1394
157 libusb
158 libxv
159 mesa
160 sdl
161 v4l-utils))
162 (synopsis "1394-Based Digital Camera Control Library")
163 (description "LibDC1394 is a library that provides functionality to control
164 any camera that conforms to the 1394-Based Digital Camera Specification written
165 by the 1394 Trade Association. It utilizes the lowlevel functionality provided
166 by libraw1394 to communicate with the camera. It also uses the video1394 kernel
167 module for the DMA capture of the video flow.")
168 (home-page "https://damien.douxchamps.net/ieee1394/libdc1394/")
169 (license license:lgpl2.0+)))
170
171 (define-public ccextractor
172 (package
173 (name "ccextractor")
174 (version "0.88")
175 (source
176 (origin
177 (method git-fetch)
178 (uri
179 (git-reference
180 (url "https://github.com/CCExtractor/ccextractor")
181 (commit (string-append "v" version))))
182 (file-name (git-file-name name version))
183 (sha256
184 (base32 "1sya45hvv4d46bk7541yimmafgvgyhkpsvwfz9kv6pm4yi1lz6nb"))))
185 (build-system cmake-build-system)
186 (arguments
187 `(#:tests? #f ; No target
188 #:configure-flags
189 (list
190 "-DWITH_FFMPEG=ON"
191 "-DWITH_OCR=ON"
192 "-DWITH_SHARING=ON"
193 "-DWITH_HARDSUBX=ON")
194 #:phases
195 (modify-phases %standard-phases
196 ;; The package is in a sub-dir of this repo.
197 (add-after 'unpack 'chdir
198 (lambda _
199 (chdir "src")
200 #t))
201 (add-after 'chdir 'fix-build-errors
202 (lambda _
203 (substitute* "CMakeLists.txt"
204 (("libnanomsg")
205 "nanomsg"))
206 #t)))))
207 (native-inputs
208 `(("perl" ,perl)
209 ("pkg-config" ,pkg-config)
210 ("python" ,python-wrapper)))
211 (inputs
212 `(("ffmeg" ,ffmpeg-3.4)
213 ("nanomsg" ,nanomsg)
214 ("leptonica" ,leptonica)
215 ("ocr" ,tesseract-ocr)
216 ("zlib" ,zlib)))
217 (synopsis "Closed Caption Extractor")
218 (description "CCExtractor is a tool that analyzes video files and produces
219 independent subtitle files from the closed captions data. It is portable, small,
220 and very fast.")
221 (home-page "https://www.ccextractor.org/")
222 (license license:gpl2+)))
223
224 (define-public libvisual
225 (package
226 (name "libvisual")
227 (version "0.4.0")
228 (source
229 (origin
230 (method git-fetch)
231 (uri
232 (git-reference
233 (url "https://github.com/Libvisual/libvisual")
234 (commit (string-append name "-" version))))
235 (file-name (git-file-name name version))
236 (sha256
237 (base32 "02xwakwkqjsznc03pjlb6hcv1li1gw3r8xvyswqsm4msix5xq18a"))))
238 (build-system gnu-build-system)
239 (arguments
240 `(#:phases
241 (modify-phases %standard-phases
242 ;; The package is in a sub-dir of this repo.
243 (add-after 'unpack 'chdir
244 (lambda _
245 (chdir "libvisual")
246 #t)))))
247 (native-inputs
248 `(("gettext" ,gettext-minimal)
249 ("libintl" ,intltool)
250 ("libtool" ,libtool)
251 ("pkg-config" ,pkg-config)))
252 (inputs
253 (list sdl))
254 (native-search-paths
255 (list
256 (search-path-specification
257 (variable "LIBVISUAL_PLUGINS_BASE_DIR")
258 (files '("lib/libvisual-0.4")))))
259 ;; To load libvisual-plugins.
260 (search-paths native-search-paths)
261 (synopsis "Audio visualisation library")
262 (description "Libvisual is a library that acts as a middle layer between
263 applications that want audio visualisation and audio visualisation plugins.")
264 (home-page "http://libvisual.org/")
265 (license
266 (list
267 ;; Libraries.
268 license:lgpl2.1+
269 ;; Examples and Tests.
270 license:gpl2+))))
271
272 (define-public libvisual-plugins
273 (package
274 (name "libvisual-plugins")
275 (version "0.4.0")
276 (source
277 (origin
278 (method git-fetch)
279 (uri
280 (git-reference
281 (url "https://github.com/Libvisual/libvisual")
282 (commit (string-append name "-" version))))
283 (file-name (git-file-name name version))
284 (sha256
285 (base32 "02xwakwkqjsznc03pjlb6hcv1li1gw3r8xvyswqsm4msix5xq18a"))))
286 (build-system gnu-build-system)
287 (arguments
288 `(#:configure-flags
289 (list
290 "--disable-gstreamer-plugin"
291 "--disable-corona"
292 "--disable-gforce"
293 (string-append "--with-plugins-base-dir=" (assoc-ref %outputs "out")
294 "/lib/libvisual-0.4"))
295 #:phases
296 (modify-phases %standard-phases
297 ;; The package is in a sub-dir of this repo.
298 (add-after 'unpack 'chdir
299 (lambda _
300 (chdir "libvisual-plugins")
301 #t)))))
302 (native-inputs
303 `(("bison" ,bison)
304 ("flex" ,flex)
305 ("gettext" ,gettext-minimal)
306 ("libintl" ,intltool)
307 ("libtool" ,libtool)
308 ("pkg-config" ,pkg-config)))
309 (inputs
310 `(("alsa-lib" ,alsa-lib)
311 ("esound" ,esound)
312 ("librsvg" ,librsvg)
313 ("gtk+" ,gtk+-2)
314 ("jack" ,jack-2)
315 ("libx11" ,libx11)
316 ("libxext" ,libxext)))
317 (propagated-inputs
318 (list libvisual))
319 (synopsis "Audio visualisation library")
320 (description "Libvisual is a library that acts as a middle layer between
321 applications that want audio visualisation and audio visualisation plugins.")
322 (home-page "http://libvisual.org/")
323 (license license:gpl2+)))
324
325 (define-public esound
326 (package
327 (name "esound")
328 (version "0.2.41")
329 (source
330 (origin
331 (method git-fetch)
332 (uri
333 (git-reference
334 (url "https://gitlab.gnome.org/Archive/esound.git")
335 (commit "ESOUND_0_2_41")))
336 (file-name (git-file-name name version))
337 (sha256
338 (base32 "141jg70fim276i8k2kyypm84gy89i1k9mm4yf68mfwnybvjw1d6n"))))
339 (build-system gnu-build-system)
340 (native-inputs
341 (list autoconf
342 automake
343 gettext-minimal
344 gnome-common
345 libtool
346 pkg-config
347 tcsh ; for the tests
348 which))
349 (inputs
350 (list alsa-lib pcaudiolib tcp-wrappers))
351 (propagated-inputs
352 (list audiofile))
353 (synopsis "Enlightened Sound Daemon")
354 (description "The Enlightened Sound Daemon mixes several audio streams for
355 playback by a single audio device. You can also pre-load samples, and play them
356 back without having to send all the data for the sound. Network transparency is
357 also built in, so you can play sounds on one machine, and listen to them on
358 another.")
359 (home-page "https://web.archive.org/web/20160528230227/
360 http://www.tux.org/~ricdude/overview.html")
361 (license
362 (list
363 ;; Libraries.
364 license:lgpl2.0+
365 ;; Others.
366 license:gpl2+))))
367
368 (define-public orc
369 (package
370 (name "orc")
371 (version "0.4.32")
372 (source (origin
373 (method url-fetch)
374 (uri (string-append "https://gstreamer.freedesktop.org/data/src/"
375 "orc/orc-" version ".tar.xz"))
376 (sha256
377 (base32
378 "1w0qmyj3v9sb2g7ff39pp38b9850y9hyy0bag26ifrby5f7ksvm6"))))
379 (build-system meson-build-system)
380 (arguments
381 `(#:phases
382 (modify-phases %standard-phases
383 (add-after 'unpack 'disable-faulty-test
384 (lambda _
385 ;; XXX Disable the 'test-limits' and 'exec_opcodes_sys'
386 ;; tests, which fail on some machines. See:
387 ;; https://bugzilla.gnome.org/show_bug.cgi?id=735273
388 (substitute* '("testsuite/test-limits.c"
389 "testsuite/exec_opcodes_sys.c")
390 (("if \\(error\\) return 1;")
391 "if (error) return 77;"))
392 #t)))))
393 (native-inputs
394 (list gtk-doc/stable))
395 (home-page "https://gstreamer.freedesktop.org/modules/orc.html")
396 (synopsis "Oil runtime compiler")
397 (description
398 "Orc is a just-in-time compiler implemented as a library and set of
399 associated tools for compiling and executing simple programs that operate on
400 arrays of data.")
401 ;; The source code implementing the Marsenne Twister algorithm is licensed
402 ;; under the 3-clause BSD license, the rest is under 2-clause BSD license.
403 (license (list license:bsd-2 license:bsd-3))))
404
405 (define-public gstreamer-docs
406 (package
407 (name "gstreamer-docs")
408 (version "1.20.3")
409 (source (origin
410 (method url-fetch)
411 (uri (string-append
412 "https://gstreamer.freedesktop.org/src/gstreamer-docs"
413 "/gstreamer-docs-" version ".tar.xz"))
414 (sha256
415 (base32
416 "1gziccq5f4fy23q6dm8nwbmzh68gn9rfbqw0xcn4r8yn82545z3k"))))
417 (build-system trivial-build-system)
418 (arguments
419 `(#:modules ((guix build utils))
420 #:builder
421 (begin
422 (use-modules ((guix build utils)))
423 (let* ((source (assoc-ref %build-inputs "source"))
424 (tar (assoc-ref %build-inputs "tar"))
425 (xz (assoc-ref %build-inputs "xz"))
426 (out (assoc-ref %outputs "out"))
427 (books (string-append out "/share/devhelp/books")))
428 (setenv "PATH" (string-append xz "/bin"))
429 (mkdir-p books)
430 (with-directory-excursion books
431 (invoke (string-append tar "/bin/tar") "-xvf" source
432 "--strip-components=3"
433 (string-append ,name "-" ,version
434 "/devhelp/books/GStreamer")))))))
435 (native-inputs
436 (list tar xz))
437 (home-page "https://gstreamer.freedesktop.org/")
438 (synopsis "Developer documentation for GStreamer")
439 (description
440 "This package contains manuals, tutorials, and API reference for
441 the GStreamer multimedia framework.")
442 ;; The documentation is covered by multiple licenses. Anything not
443 ;; explicitly mentioned below is LGPL2.1+. See README.md for details.
444 (license (list
445 ;; The tutorial code can be used with either of these licenses,
446 ;; at the users option.
447 license:lgpl2.1+ license:bsd-2 license:expat
448 ;; The developer manual and plugin writer guide carries
449 ;; the Open Publication License v1.0.
450 (license:fsf-free "https://opencontent.org/openpub/"
451 "The Open Publication License v1.0")
452 ;; Tutorials are covered by CC-BY-SA 4.0.
453 license:cc-by-sa4.0))))
454
455 ;; Increase the test timeouts to accommodate slow or busy machines.
456 (define %common-gstreamer-phases
457 '((add-after 'unpack 'increase-test-timeout
458 (lambda _
459 (substitute* "tests/check/meson.build"
460 (("'CK_DEFAULT_TIMEOUT', '[0-9]*'")
461 "'CK_DEFAULT_TIMEOUT', '600'")
462 (("timeout ?: .*\\)")
463 "timeout: 90 * 60)"))))))
464
465 (define-public gstreamer
466 (package
467 (name "gstreamer")
468 (version "1.20.3")
469 (source
470 (origin
471 (method url-fetch)
472 (uri (string-append
473 "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-"
474 version ".tar.xz"))
475 (sha256
476 (base32
477 "0aisl8nazcfi4b5j6fz8zwpp0k9csb022zniz65b2pxxpdjayzb0"))))
478 (build-system meson-build-system)
479 (arguments
480 (list #:phases
481 #~(modify-phases %standard-phases
482 #$@%common-gstreamer-phases
483 #$@(if (string-prefix? "i686" (or (%current-target-system)
484 (%current-system)))
485 ;; FIXME: These tests consistently fail in the Guix CI:
486 ;; https://issues.guix.gnu.org/57868
487 '((add-after 'unpack 'disable-systemclock-test
488 (lambda _
489 (substitute* "tests/check/gst/gstsystemclock.c"
490 (("tcase_add_test \\(tc_chain, \
491 test_stress_cleanup_unschedule.*")
492 "")
493 (("tcase_add_test \\(tc_chain, \
494 test_stress_reschedule.*")
495 "")))))
496 '()))))
497 (propagated-inputs
498 ;; In gstreamer-1.0.pc:
499 ;; Requires: glib-2.0, gobject-2.0
500 ;; Requires.private: gmodule-no-export-2.0 libunwind libdw
501 (list elfutils ; libdw
502 glib libunwind))
503 (native-inputs
504 (list bash-completion
505 bison flex
506 gettext-minimal
507 `(,glib "bin")
508 gobject-introspection
509 perl
510 pkg-config
511 python-wrapper))
512 (inputs
513 (list gmp libcap
514 ;; For tests.
515 gsl))
516 (native-search-paths
517 (list (search-path-specification
518 (variable "GST_PLUGIN_SYSTEM_PATH")
519 (files '("lib/gstreamer-1.0")))))
520 (home-page "https://gstreamer.freedesktop.org/")
521 (synopsis "Multimedia framework")
522 (description
523 "GStreamer is a library for constructing graphs of media-handling
524 components. The applications it supports range from simple Ogg/Vorbis
525 playback, audio/video streaming to complex audio mixing and video
526 non-linear editing.
527
528 Applications can take advantage of advances in codec and filter technology
529 transparently. Developers can add new codecs and filters by writing a
530 simple plugin with a clean, generic interface.
531
532 This package provides the core library and elements.")
533 (license license:lgpl2.0+)))
534
535 (define-public gst-plugins-base
536 (package
537 (name "gst-plugins-base")
538 (version "1.20.3")
539 (source
540 (origin
541 (method url-fetch)
542 (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/"
543 name "-" version ".tar.xz"))
544 (sha256
545 (base32
546 "17rw8wj1x1bg153m9z76pdvgz5k93m3riyalfpzq00x7h7fv6c3y"))))
547 (build-system meson-build-system)
548 (propagated-inputs
549 (list glib ;required by gstreamer-sdp-1.0.pc
550 gstreamer ;required by gstreamer-plugins-base-1.0.pc
551 libgudev ;required by gstreamer-gl-1.0.pc
552 ;; wayland-client.h is referred to in
553 ;; include/gstreamer-1.0/gst/gl/wayland/gstgldisplay_wayland.h
554 wayland
555 orc)) ;required by gstreamer-audio-1.0.pc
556 (inputs
557 ;; TODO: Add libvorbisidec
558 (list alsa-lib
559 cdparanoia
560 graphene
561 iso-codes
562 libjpeg-turbo
563 libogg
564 libpng
565 libtheora
566 libvisual
567 libvorbis
568 libx11
569 libxext
570 libxv
571 mesa
572 opus
573 pango
574 wayland-protocols
575 zlib))
576 (native-inputs
577 (list pkg-config
578 `(,glib "bin")
579 gobject-introspection
580 python-wrapper
581 gettext-minimal
582 xorg-server-for-tests))
583 (arguments
584 (list
585 #:phases
586 #~(modify-phases %standard-phases
587 #$@%common-gstreamer-phases
588 (add-after 'unpack 'disable-problematic-tests
589 (lambda _
590 (substitute* "tests/check/meson.build"
591 ;; This test causes nondeterministic failures (see:
592 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/950).
593 ((".*'elements/appsrc.c'.*")
594 ""))
595 ;; Some other tests fail on other architectures.
596 #$@(cond
597 ((target-x86-32?)
598 #~((substitute* "tests/check/meson.build"
599 ((".*'libs/libsabi\\.c'.*") ""))))
600 ((target-riscv64?)
601 #~((substitute* "tests/check/meson.build"
602 ((".*'libs/gstglcolorconvert\\.c'.*") "")
603 ((".*'libs/gstglcontext\\.c'.*") "")
604 ((".*'libs/gstglmemory\\.c'.*") "")
605 ((".*'libs/gstglupload\\.c'.*") "")
606 ((".*'elements/glimagesink\\.c'.*") "")
607 ((".*'pipelines/gl-launch-lines\\.c'.*") "")
608 ((".*'elements/glstereo\\.c'.*") "")
609 ((".*'elements/glmixer\\.c'.*") ""))))
610 (else
611 #~()))))
612 (add-before 'configure 'patch
613 (lambda _
614 (substitute* "tests/check/libs/pbutils.c"
615 (("/bin/sh") (which "sh")))))
616 (add-before 'check 'pre-check
617 (lambda _
618 ;; Tests require a running X server.
619 (system "Xvfb :1 +extension GLX &")
620 (setenv "DISPLAY" ":1")
621 ;; Tests write to $HOME.
622 (setenv "HOME" (getcwd))
623 ;; Tests look for $XDG_RUNTIME_DIR.
624 (setenv "XDG_RUNTIME_DIR" (getcwd))
625 ;; For missing '/etc/machine-id'.
626 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
627 (home-page "https://gstreamer.freedesktop.org/")
628 (synopsis
629 "Plugins for the GStreamer multimedia library")
630 (description "This package provides an essential exemplary set of plug-ins
631 for the GStreamer multimedia library.")
632 (license license:lgpl2.0+)))
633
634 (define-public gst-plugins-good
635 (package
636 (name "gst-plugins-good")
637 (version "1.20.3")
638 (source
639 (origin
640 (method url-fetch)
641 (uri
642 (string-append
643 "https://gstreamer.freedesktop.org/src/" name "/"
644 name "-" version ".tar.xz"))
645 (sha256
646 (base32 "1dv8b2md1xk6d45ir1wzbvqhxbvm6mxv881rjl0brnjwpw3c5wzq"))))
647 (build-system meson-build-system)
648 (arguments
649 (list
650 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
651 #:phases
652 #~(modify-phases %standard-phases
653 #$@%common-gstreamer-phases
654 (add-after 'unpack 'absolutize-libsoup-library
655 (lambda* (#:key inputs #:allow-other-keys)
656 (define libsoup
657 (search-input-file inputs "lib/libsoup-3.0.so"))
658
659 (substitute* "ext/soup/gstsouploader.c"
660 (("(#define LIBSOUP_3_SONAME ).+$" _ prefix)
661 (string-append prefix "\"" libsoup "\"\n")))))
662 (add-after 'unpack 'skip-failing-tests
663 (lambda _
664 (substitute* "tests/check/meson.build"
665 ;; Reported as shaky upstream, see
666 ;; <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/785>
667 (("\\[ 'elements/flvmux' \\]") "[ 'elements/flvmux', true ]"))))
668 (add-before 'check 'pre-check
669 (lambda _
670 ;; Tests require a running X server.
671 (system "Xvfb :1 +extension GLX &")
672 (setenv "DISPLAY" ":1")
673 ;; Tests write to $HOME.
674 (setenv "HOME" (getcwd))
675 ;; Tests look for $XDG_RUNTIME_DIR.
676 (setenv "XDG_RUNTIME_DIR" (getcwd))
677 ;; For missing '/etc/machine-id'.
678 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
679 (native-inputs
680 (list gettext-minimal
681 `(,glib "bin")
682 gobject-introspection
683 gsettings-desktop-schemas
684 libxml2
685 perl
686 pkg-config
687 python-wrapper
688 xorg-server-for-tests))
689 (inputs
690 (list aalib
691 bzip2
692 cairo
693 flac
694 (librsvg-for-system)
695 glib
696 glib-networking
697 glu
698 gtk+
699 jack-2
700 lame
701 libavc1394
702 libcaca
703 libdv
704 libgudev
705 libiec61883
706 libjpeg-turbo
707 libpng
708 libshout
709 libsoup
710 libvpx
711 libx11
712 libxdamage
713 libxfixes
714 libxext
715 libxshmfence
716 mesa
717 mpg123
718 orc
719 pulseaudio
720 speex
721 taglib
722 twolame
723 v4l-utils
724 wavpack
725 zlib))
726 (propagated-inputs
727 (list gstreamer gst-plugins-base))
728 (synopsis "GStreamer plugins and helper libraries")
729 (description "GStreamer-Plugins-Good is a collection of plug-ins you'd want
730 to have right next to you on the battlefield. Shooting sharp and making no
731 mistakes, these plug-ins have it all: good looks, good code, and good
732 licensing. Documented and dressed up in tests. If you're looking for a role
733 model to base your own plug-in on, here it is.")
734 (home-page "https://gstreamer.freedesktop.org/")
735 (license license:lgpl2.0+)))
736
737 (define-public gst-plugins-bad
738 (package
739 (name "gst-plugins-bad")
740 (version "1.20.3")
741 (source (origin
742 (method url-fetch)
743 (uri (string-append "https://gstreamer.freedesktop.org/src/"
744 name "/" name "-" version ".tar.xz"))
745 (sha256
746 (base32
747 "0kys6m5hg5bc30wfg8qa3s7dmkdz3kj1j8lhvn3267fxalxw24bs"))
748 (modules '((guix build utils)))
749 (snippet
750 '(begin
751 ;; Delete bundled copy of usrsctp.
752 (delete-file-recursively "ext/sctp/usrsctp")))))
753 (build-system meson-build-system)
754 (arguments
755 (list
756 #:configure-flags #~(list "-Dsctp-internal-usrsctp=disabled")
757 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
758 #:phases
759 #~(modify-phases %standard-phases
760 #$@%common-gstreamer-phases
761 #$@(if (string-prefix? "arm" (or (%current-target-system)
762 (%current-system)))
763 ;; Disable test that fails on ARMv7.
764 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1188
765 `((add-after 'unpack 'disable-asfmux-test
766 (lambda _
767 (substitute* "tests/check/meson.build"
768 (("\\[\\['elements/asfmux\\.c'\\]\\],")
769 "")))))
770 '())
771 (add-after 'unpack 'adjust-tests
772 (lambda* (#:key native-inputs inputs #:allow-other-keys)
773 (let ((gst-plugins-good (assoc-ref (or native-inputs inputs)
774 "gst-plugins-good")))
775 (substitute* "tests/check/meson.build"
776 ;; Make gst-plugin-good available for tests, see
777 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1426
778 (("'GST_PLUGIN_SYSTEM_PATH_1_0', ''")
779 (string-append "'GST_PLUGIN_SYSTEM_PATH_1_0', '"
780 gst-plugins-good "/lib/gstreamer-1.0'"))
781
782 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1136
783 ((".*elements/msdkh264enc\\.c.*") "")
784 ((".*elements/svthevcenc\\.c.*") "")
785
786 ;; The 'elements_shm.test_shm_live' test sometimes times out
787 ;; (see:
788 ;; https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/790).
789 ((".*'elements/shm\\.c'.*") "")
790
791 ;; FIXME: Why is this failing.
792 ((".*elements/dash_mpd\\.c.*") "")
793
794 ;; These tests are flaky and occasionally time out:
795 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/932
796 ((".*elements/curlhttpsrc\\.c.*") "")
797 ;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1412
798 ((".*elements/dtls\\.c.*") ""))
799 (substitute* "tests/check/elements/zxing.c"
800 ;; zxing 1.2.0 seemingly changed the type representation of
801 ;; the EAN_13 structure; disable it.
802 ((".*\"EAN_13\".*")
803 "")))))
804 (add-before 'check 'pre-check
805 (lambda _
806 ;; Tests require a running X server.
807 (system "Xvfb :1 +extension GLX &")
808 (setenv "DISPLAY" ":1")
809 ;; Tests write to $HOME.
810 (setenv "HOME" (getcwd))
811 ;; Tests look for $XDG_RUNTIME_DIR.
812 (setenv "XDG_RUNTIME_DIR" (getcwd))
813 ;; For missing '/etc/machine-id'.
814 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
815 (propagated-inputs
816 (list gstreamer gst-plugins-base))
817 (native-inputs
818 (list gettext-minimal
819 `(,glib "bin") ; for glib-mkenums, etc.
820 gobject-introspection
821 gsettings-desktop-schemas
822 gst-plugins-good ;for tests
823 perl
824 pkg-config
825 python-wrapper
826 xorg-server-for-tests))
827 (inputs
828 (append
829 (if (target-x86?) (list mediasdk) '())
830 (if (target-x86-64?) (list svt-hevc) '())
831 (list bluez
832 bzip2
833 cairo
834 ;; ccextractor
835 chromaprint
836 curl
837 directfb
838 ;; dssim
839 faad2
840 flite
841 fluidsynth
842 glib
843 glib-networking
844 glu
845 gsm
846 gtk+
847 iqa
848 ladspa
849 lcms
850 libaom
851 libass
852 libbs2b
853 libdc1394
854 libdca
855 libde265
856 libdrm
857 libdvdnav
858 libdvdread
859 libexif
860 libfdk
861 libgcrypt
862 libgme
863 libgudev
864 libkate
865 libmms
866 libmodplug
867 libmpcdec
868 libnice
869 libofa
870 libopenmpt
871 (librsvg-for-system)
872 libsndfile
873 libsrtp
874 libssh2
875 libtiff
876 libusb
877 libva
878 libvdpau
879 libwebp
880 libx11
881 libxcb
882 libxext
883 libxkbcommon
884 libxml2
885 libxshmfence
886 lilv
887 lrdf
888 lv2
889 mesa
890 mjpegtools
891 neon
892 nettle
893 openal
894 ;; opencv
895 openexr
896 openh264
897 openjpeg
898 ;; openni2
899 opensles
900 openssl-1.1
901 opus
902 orc
903 pango
904 rtmpdump
905 sbc
906 lksctp-tools
907 soundtouch
908 spandsp
909 srt
910 tinyalsa
911 transcode
912 usrsctp
913 v4l-utils
914 vo-aacenc
915 vo-amrwbenc
916 vulkan-headers
917 vulkan-loader
918 x265
919 wayland
920 webrtc-audio-processing
921 wildmidi
922 wpebackend-fdo
923 zbar
924 zxing-cpp-1.2)))
925 (home-page "https://gstreamer.freedesktop.org/")
926 (synopsis "Plugins for the GStreamer multimedia library")
927 (description
928 "GStreamer Bad Plug-ins is a set of plug-ins whose quality aren't up to
929 par compared to the rest.")
930 (license license:lgpl2.0+)))
931
932 (define-public gst-plugins-ugly
933 (package
934 (name "gst-plugins-ugly")
935 (version "1.20.3")
936 (source
937 (origin
938 (method url-fetch)
939 (uri
940 (string-append "https://gstreamer.freedesktop.org/src/"
941 name "/" name "-" version ".tar.xz"))
942 (sha256
943 (base32 "1zdfsq0zm1d3wj3w3z44bf3v28clr8yd6qzmkjs09hq9k9w21alc"))))
944 (build-system meson-build-system)
945 (arguments
946 (list #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
947 #:phases
948 #~(modify-phases %standard-phases
949 #$@%common-gstreamer-phases
950 (add-before 'check 'pre-check
951 (lambda _
952 ;; Tests require a running X server.
953 (system "Xvfb :1 +extension GLX &")
954 (setenv "DISPLAY" ":1")
955 ;; Tests write to $HOME.
956 (setenv "HOME" (getcwd))
957 ;; Tests look for $XDG_RUNTIME_DIR.
958 (setenv "XDG_RUNTIME_DIR" (getcwd))
959 ;; For missing '/etc/machine-id'.
960 (setenv "DBUS_FATAL_WARNINGS" "0"))))))
961 (native-inputs
962 (list gettext-minimal
963 `(,glib "bin")
964 gobject-introspection
965 gsettings-desktop-schemas
966 perl
967 pkg-config
968 python-wrapper
969 xorg-server-for-tests))
970 (inputs
971 (list glib
972 glib-networking
973 liba52
974 libcdio
975 libdvdread
976 libmpeg2
977 libx264
978 opencore-amr
979 orc))
980 (propagated-inputs
981 (list gstreamer gst-plugins-base))
982 (synopsis "GStreamer plugins and helper libraries")
983 (description "Gst-Plugins-Ugly are the ones that might have a patent noose
984 around their neck, or a lock-up license, or any other problem that makes you
985 think twice about shipping them.")
986 (home-page "https://gstreamer.freedesktop.org/")
987 (license license:lgpl2.0+)))
988
989 (define-public gst-libav
990 (package
991 (name "gst-libav")
992 (version "1.20.3")
993 (source
994 (origin
995 (method url-fetch)
996 (uri
997 (string-append
998 "https://gstreamer.freedesktop.org/src/" name "/"
999 name "-" version ".tar.xz"))
1000 (sha256
1001 (base32 "1zkxybdzdkn07wwmj0rrgxyvbry472dggjv2chdsmpzwc02x3v9z"))))
1002 (build-system meson-build-system)
1003 (native-inputs
1004 (list perl pkg-config python-wrapper ruby))
1005 (inputs
1006 (list ffmpeg))
1007 (propagated-inputs
1008 (list gstreamer gst-plugins-base))
1009 (synopsis "GStreamer plugins and helper libraries")
1010 (description "Gst-Libav contains a GStreamer plugin for using the encoders,
1011 decoders, muxers, and demuxers provided by FFmpeg.")
1012 (home-page "https://gstreamer.freedesktop.org/")
1013 (license license:lgpl2.0+)))
1014
1015 (define-public gst-editing-services
1016 (package
1017 (name "gst-editing-services")
1018 (version "1.20.3")
1019 (source (origin
1020 (method url-fetch)
1021 (uri (string-append
1022 "https://gstreamer.freedesktop.org/src/" name "/"
1023 "gst-editing-services-" version ".tar.xz"))
1024 (sha256
1025 (base32
1026 "18msiadg6wi1636ylp02yfiwphxlz39gh3vbxchl9qpvd7g9dn2z"))))
1027 (build-system meson-build-system)
1028 (arguments
1029 (list
1030 #:tests? #f ; FIXME: 16/23 failing tests.
1031 #:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
1032 #:phases #~(modify-phases %standard-phases
1033 #$@%common-gstreamer-phases)))
1034 (propagated-inputs
1035 (list gstreamer gst-plugins-base))
1036 (inputs
1037 (list glib glib-networking gtk+ libxml2))
1038 (native-inputs
1039 (list flex
1040 gobject-introspection
1041 `(,glib "bin")
1042 gst-plugins-bad
1043 gst-plugins-good
1044 perl
1045 pkg-config
1046 python-wrapper))
1047 (home-page "https://gstreamer.freedesktop.org/")
1048 (synopsis "GStreamer library for non-linear editors")
1049 (description
1050 "This is a high-level library for facilitating the creation of audio/video
1051 non-linear editors.")
1052 (license license:gpl2+)))
1053
1054 (define-public gst-plugins/selection
1055 (lambda* (pkg #:key plugins configure-flags)
1056 "Build PKG with only PLUGINS enabled. Optionally, if CONFIGURE-FLAGS are
1057 given, also pass them to the build system instead of the ones used by PKG."
1058 (package/inherit pkg
1059 (arguments
1060 (substitute-keyword-arguments (package-arguments pkg)
1061 ((#:configure-flags flags #~'())
1062 #~(append
1063 (list
1064 #$@(map (lambda (plugin)
1065 (string-append "-D" plugin "=enabled"))
1066 plugins))
1067 #$(or configure-flags flags)))
1068 ((#:phases phases)
1069 #~(modify-phases #$phases
1070 (add-after 'unpack 'disable-auto-plugins
1071 (lambda _
1072 (substitute* "meson_options.txt"
1073 (("'auto'") "'disabled'")))))))))))
1074
1075 (define-public gst-plugins-bad-minimal
1076 (package
1077 (inherit (gst-plugins/selection gst-plugins-bad #:plugins '()))
1078 (name "gst-plugins-bad-minimal")
1079 (description "This package provides the smallest selection of GStreamer's
1080 \"bad\" plugin set, essentially containing libraries and the gst-transcoder
1081 binary, but none of the actual plugins.")))
1082
1083 (define-public python-gst
1084 (package
1085 (name "python-gst")
1086 (version "1.20.3")
1087 (source (origin
1088 (method url-fetch)
1089 (uri (string-append
1090 "https://gstreamer.freedesktop.org/src/gst-python/"
1091 "gst-python-" version ".tar.xz"))
1092 (sha256
1093 (base32
1094 "1p6g05k88nbbv5x9madsvphxcdkfl1z0lmp39p6bhmg9x8h82d6v"))))
1095 (build-system meson-build-system)
1096 (arguments
1097 (list
1098 #:modules `((guix build meson-build-system)
1099 (guix build utils)
1100 ((guix build python-build-system) #:prefix python:))
1101 #:imported-modules `(,@%meson-build-system-modules
1102 (guix build python-build-system))
1103 #:configure-flags
1104 #~(list (string-append
1105 "-Dpygi-overrides-dir="
1106 (python:site-packages %build-inputs %outputs) "/gi/overrides"))))
1107 (native-inputs
1108 (list pkg-config python))
1109 (propagated-inputs
1110 (list gst-plugins-base python-pygobject))
1111 (home-page "https://gstreamer.freedesktop.org/")
1112 (synopsis "GStreamer GObject Introspection overrides for Python")
1113 (description
1114 "This package contains GObject Introspection overrides for Python that can
1115 be used by Python applications using GStreamer.")
1116 (license license:lgpl2.1+)
1117 (properties `((upstream-name . "gst-python")))))
1118
1119 (define-public gst123
1120 (package
1121 (name "gst123")
1122 (version "0.3.5")
1123 (source (origin
1124 (method url-fetch)
1125 (uri (string-append "http://space.twc.de/~stefan/gst123/gst123-"
1126 version ".tar.bz2"))
1127 (sha256
1128 (base32
1129 "0zaa117n4wkya9p903vkj8hj58lmdb66pxsdx5wwcv7nffbp5d67"))))
1130 (build-system gnu-build-system)
1131 (inputs
1132 (list gtk+-2 ncurses gstreamer gst-plugins-base))
1133 (native-inputs
1134 (list pkg-config))
1135 (home-page "https://space.twc.de/~stefan/gst123.php")
1136 (synopsis "Flexible command line media player based on gstreamer")
1137 (description "The program gst123 is designed to be a more flexible command
1138 line player in the spirit of ogg123 and mpg123, based on the gstreamer media
1139 framework. It plays all file formats gstreamer supports, so if you have a
1140 music collection which contains different file formats, like flac, ogg and
1141 mp3, you can use gst123 to play all your music files.")
1142 (license license:lgpl2.0+)))