gnu: aalib: Support aarch64.
[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 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015, 2016 Alex Vong <alexvong1995@gmail.com>
10 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
11 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
12 ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com>
13 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
14 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
15 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
16 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages video)
34 #:use-module (ice-9 match)
35 #:use-module (srfi srfi-1)
36 #:use-module (srfi srfi-26)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix utils)
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix svn-download)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system glib-or-gtk)
46 #:use-module (guix build-system python)
47 #:use-module (guix build-system waf)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages audio)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages avahi)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bison)
55 #:use-module (gnu packages cdrom)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages curl)
59 #:use-module (gnu packages databases)
60 #:use-module (gnu packages dejagnu)
61 #:use-module (gnu packages elf)
62 #:use-module (gnu packages flex)
63 #:use-module (gnu packages fontutils)
64 #:use-module (gnu packages freedesktop)
65 #:use-module (gnu packages fribidi)
66 #:use-module (gnu packages gettext)
67 #:use-module (gnu packages ghostscript)
68 #:use-module (gnu packages gl)
69 #:use-module (gnu packages glib)
70 #:use-module (gnu packages guile)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gnupg)
73 #:use-module (gnu packages gstreamer)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages linux)
77 #:use-module (gnu packages lua)
78 #:use-module (gnu packages m4)
79 #:use-module (gnu packages man)
80 #:use-module (gnu packages mp3)
81 #:use-module (gnu packages ncurses)
82 #:use-module (gnu packages ocr)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages popt)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages sdl)
90 #:use-module (gnu packages ssh)
91 #:use-module (gnu packages texinfo)
92 #:use-module (gnu packages textutils)
93 #:use-module (gnu packages tls)
94 #:use-module (gnu packages version-control)
95 #:use-module (gnu packages web)
96 #:use-module (gnu packages webkit)
97 #:use-module (gnu packages xdisorg)
98 #:use-module (gnu packages xiph)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xorg)
101 #:use-module (gnu packages assembly)
102 #:use-module (gnu packages zip))
103
104 (define-public aalib
105 (package
106 (name "aalib")
107 (version "1.4rc5")
108 (source (origin
109 (method url-fetch)
110 (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
111 version "/" name "-" version ".tar.gz"))
112 (sha256
113 (base32
114 "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
115 (build-system gnu-build-system)
116 (native-inputs
117 `(("makeinfo" ,texinfo)))
118 (inputs
119 `(("ncurses" ,ncurses)))
120 (arguments
121 `(#:phases
122 (modify-phases %standard-phases
123 (replace 'configure
124 (lambda* (#:key build inputs outputs #:allow-other-keys)
125 ;; This old `configure' script doesn't support
126 ;; variables passed as arguments.
127 (let ((out (assoc-ref outputs "out"))
128 (ncurses (assoc-ref inputs "ncurses")))
129 (setenv "CONFIG_SHELL" (which "bash"))
130 (zero? (system* "./configure"
131 (string-append "--prefix=" out)
132 (string-append "--build=" build)
133 ;; The ancient config.guess is unable to
134 ;; guess the host triplet on mips64el.
135 ,@(if (string=? "mips64el-linux"
136 (%current-system))
137 '("--host=mips64el-unknown-linux-gnu")
138 '())
139 ;; The same is also true with aarch64.
140 ,@(if (string=? "aarch64-linux"
141 (%current-system))
142 '("--host=aarch64-unknown-linux-gnu")
143 '())
144 (string-append "--with-ncurses="
145 ncurses)))))))))
146 (home-page "http://aa-project.sourceforge.net/aalib/")
147 (synopsis "ASCII-art library")
148 (description
149 "AA-lib is a low level gfx library which does not require graphics device.
150 In fact, there is no graphical output possible. AA-lib replaces those
151 old-fashioned output methods with powerful ascii-art renderer.")
152 (license license:lgpl2.0+)))
153
154 (define-public liba52
155 (package
156 (name "liba52")
157 (version "0.7.4")
158 (source (origin
159 (method url-fetch)
160 (uri (string-append
161 ;; A mirror://sourceforge URI doesn't work, presumably
162 ;; because the SourceForge project is misconfigured.
163 "http://liba52.sourceforge.net/files/a52dec-" version
164 ".tar.gz"))
165 (sha256
166 (base32
167 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
168 (patches (search-patches "liba52-enable-pic.patch"
169 "liba52-set-soname.patch"
170 "liba52-use-mtune-not-mcpu.patch"
171 "liba52-link-with-libm.patch"))))
172 (build-system gnu-build-system)
173 ;; XXX We need to run ./bootstrap because of the build system fixes above.
174 (native-inputs
175 `(("autoconf" ,autoconf)
176 ("automake" ,automake)
177 ("libtool" ,libtool)))
178 (arguments `(#:configure-flags '("--enable-shared")
179 #:phases
180 (modify-phases %standard-phases
181 ;; XXX We need to run ./bootstrap because of the build
182 ;; system fixes above.
183 (add-after
184 'unpack 'bootstrap
185 (lambda _ (zero? (system* "sh" "bootstrap")))))))
186 (home-page "http://liba52.sourceforge.net/")
187 (synopsis "ATSC A/52 stream decoder")
188 (description "liba52 is a library for decoding ATSC A/52 streams. The
189 A/52 standard is used in a variety of applications, including digital
190 television and DVD. It is also known as AC-3.")
191 (license license:gpl2+)))
192
193 (define-public libmpeg2
194 (package
195 (name "libmpeg2")
196 (version "0.5.1")
197 (source (origin
198 (method url-fetch)
199 ;; A mirror://sourceforge URI doesn't work, presumably
200 ;; because the SourceForge project is misconfigured.
201 (uri (string-append "http://libmpeg2.sourceforge.net/files/"
202 name "-" version ".tar.gz"))
203 (sha256
204 (base32
205 "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
206 (inputs
207 `(("libx11" ,libx11)
208 ("libxext" ,libxext)
209 ("libxv" ,libxv)
210 ("libsm" ,libsm)
211 ("libice" ,libice)
212 ("sdl" ,sdl)))
213 (build-system gnu-build-system)
214 (home-page "http://libmpeg2.sourceforge.net/")
215 (synopsis "MPEG1 and MPEG2 video decoder library")
216 (description
217 "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
218 (license license:gpl2+)))
219
220 (define-public libx264
221 (package
222 (name "libx264")
223 (version "20161205-2245")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
227 "x264-snapshot-" version ".tar.bz2"))
228 (sha256
229 (base32
230 "0jjzdwag59kqlk09bb2pykm1ss8bw3p9q7bsks2kjgdwbj121a44"))))
231 (build-system gnu-build-system)
232 (native-inputs
233 `(("pkg-config" ,pkg-config)
234 ("yasm" ,yasm)))
235 ;; TODO: Add gpac input
236 (arguments
237 `(#:tests? #f ;no check target
238 #:configure-flags '("--enable-shared"
239 ;; Don't build the command-line program. If we
240 ;; want it later, we should do so in a different
241 ;; package to avoid a circular dependency (the x264
242 ;; program depends on ffmpeg and ffmpeg depends on
243 ;; libx264).
244 "--disable-cli"
245
246 ;; On MIPS, we must pass "--disable-asm" or else
247 ;; configure fails after printing: "You specified a
248 ;; pre-MSA CPU in your CFLAGS. If you really want
249 ;; to run on such a CPU, configure with
250 ;; --disable-asm."
251 ,@(if (string-prefix? "mips"
252 (or (%current-target-system)
253 (%current-system)))
254 '("--disable-asm")
255 '()))))
256 (home-page "https://www.videolan.org/developers/x264.html")
257 (synopsis "H.264 video coding library")
258 (description "libx264 is an advanced encoding library for creating
259 H.264 (MPEG-4 AVC) video streams.")
260 (license (list license:gpl2+ ;most files
261 license:isc ;common/x86/x86inc.asm
262 license:lgpl2.1+ ;extras/getopt.c
263 license:bsd-3 ;extras/inttypes.h
264 (license:non-copyleft ;extras/cl*.h
265 "file://extras/cl.h"
266 "See extras/cl.h in the distribution.")))))
267
268 (define-public x265
269 (package
270 (name "x265")
271 (version "2.1")
272 (source
273 (origin
274 (method url-fetch)
275 (uri (string-append "https://download.videolan.org/videolan/x265/"
276 "x265_" version ".tar.gz"))
277 (sha256
278 (base32
279 "0hx6sr9l7586gs4qds2sj0i1m5brxkaqq3cwmibhfb559fpvkz48"))
280 (modules '((guix build utils)))
281 (snippet
282 '(delete-file-recursively "source/compat/getopt"))))
283 (build-system cmake-build-system)
284 (arguments
285 `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
286 #:phases
287 (modify-phases %standard-phases
288 (add-before 'configure 'prepare-build
289 (lambda _
290 (delete-file-recursively "build")
291 (chdir "source")
292 #t)))))
293 (home-page "http://x265.org/")
294 (synopsis "Library for encoding h.265/HEVC video streams")
295 (description "x265 is a H.265 / HEVC video encoder application library,
296 designed to encode video or images into an H.265 / HEVC encoded bitstream.")
297 (license license:gpl2+)))
298
299 (define-public libass
300 (package
301 (name "libass")
302 (version "0.13.4")
303 (source (origin
304 (method url-fetch)
305 (uri (string-append
306 "https://github.com/libass/libass/releases/download/"
307 version "/libass-" version ".tar.xz"))
308 (sha256
309 (base32
310 "1dlzkjybnpl2fkvyjq0qblb7qw12cs893bs7zj3rvf8ij342yjnq"))))
311 (build-system gnu-build-system)
312 (native-inputs
313 `(("pkg-config" ,pkg-config)
314 ("yasm" ,yasm)))
315 (propagated-inputs
316 `(("freetype" ,freetype)
317 ("fribidi" ,fribidi)
318 ("fontconfig" ,fontconfig)
319 ("harfbuzz" ,harfbuzz)
320 ("enca" ,enca)))
321 (home-page "https://github.com/libass/libass")
322 (synopsis "Subtitle rendering library for the ASS/SSA format")
323 (description "libass is a subtitle rendering library for the
324 ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
325 (license license:isc)))
326
327 (define-public libcaca
328 (package
329 (name "libcaca")
330 (version "0.99.beta19")
331 (source (origin
332 (method url-fetch)
333 (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
334 version ".tar.gz"))
335 (sha256
336 (base32
337 "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
338 (build-system gnu-build-system)
339 (native-inputs `(("pkg-config" ,pkg-config)))
340 (inputs
341 `(("freeglut" ,freeglut)
342 ("ftgl" ,ftgl)
343 ("imlib2" ,imlib2)
344 ("libx11" ,libx11)
345 ("mesa" ,mesa)
346 ("ncurses" ,ncurses)
347 ("zlib" ,zlib)))
348 (home-page "http://caca.zoy.org/wiki/libcaca")
349 (synopsis "Colour ASCII-art library")
350 (description "libcaca is a graphics library that outputs text instead of
351 pixels, so that it can work on older video cards or text terminals. It
352 supports Unicode, 2048 colors, dithering of color images, and advanced text
353 canvas operations.")
354 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
355
356 (define-public libdca
357 (package
358 (name "libdca")
359 (version "0.0.5")
360 (source (origin
361 (method url-fetch)
362 (uri (string-append
363 "http://download.videolan.org/pub/videolan/libdca/"
364 version "/libdca-" version ".tar.bz2"))
365 (sha256
366 (base32
367 "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
368 (build-system gnu-build-system)
369 (home-page "http://www.videolan.org/developers/libdca.html")
370 (synopsis "DTS Coherent Acoustics decoder")
371 (description "libdca is a library for decoding DTS Coherent Acoustics
372 streams.")
373 (license license:gpl2+)))
374
375 (define-public libdv
376 (package
377 (name "libdv")
378 (version "1.0.0")
379 (source (origin
380 (method url-fetch)
381 (uri (string-append
382 "mirror://sourceforge/" name "/" name "/"
383 version "/" name "-" version ".tar.gz"))
384 (sha256
385 (base32
386 "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
387 (build-system gnu-build-system)
388 (native-inputs `(("pkg-config" ,pkg-config)))
389 (inputs `(("libxv" ,libxv)))
390 (home-page "http://libdv.sourceforge.net/")
391 (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
392 (description "The Quasar DV codec (libdv) is a software codec for DV
393 video, the encoding format used by most digital camcorders, typically those
394 that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
395 developed according to the official standards for DV video: IEC 61834 and
396 SMPTE 314M.")
397 (license license:lgpl2.1+)))
398
399 (define-public libva
400 (package
401 (name "libva")
402 (version "1.7.1")
403 (source
404 (origin
405 (method url-fetch)
406 (uri (string-append
407 "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
408 version".tar.bz2"))
409 (sha256
410 (base32 "1j8mb3p9kafhp30r3kmndnrklvzycc2ym0w6xdqz6m7jap626028"))))
411 (build-system gnu-build-system)
412 (native-inputs
413 `(("pkg-config" ,pkg-config)))
414 (inputs
415 `(("libdrm" ,libdrm)
416 ("libx11" ,libx11)
417 ("libxext" ,libxext)
418 ("libxfixes" ,libxfixes)
419 ("mesa" ,mesa)))
420 (arguments
421 `(#:phases
422 (modify-phases %standard-phases
423 (add-before
424 'build 'fix-dlopen-paths
425 (lambda* (#:key outputs #:allow-other-keys)
426 (let ((out (assoc-ref outputs "out")))
427 (substitute* "va/drm/va_drm_auth_x11.c"
428 (("\"libva-x11\\.so\\.%d\"")
429 (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
430 ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
431 ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
432 #:configure-flags
433 (list (string-append "--with-drivers-path="
434 (assoc-ref %build-inputs "mesa") "/lib/dri"))
435 ;; However, we can't write to mesa's store directory, so override the
436 ;; following make variable to install the dummy driver to libva's
437 ;; $prefix/lib/dri directory.
438 #:make-flags
439 (list (string-append "dummy_drv_video_ladir="
440 (assoc-ref %outputs "out") "/lib/dri"))))
441 (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
442 (synopsis "Video acceleration library")
443 (description "The main motivation for VA-API (Video Acceleration API) is
444 to enable hardware accelerated video decode/encode at various
445 entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
446 standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
447 (license license:expat)))
448
449 (define-public ffmpeg
450 (package
451 (name "ffmpeg")
452 (version "3.2.4")
453 (source (origin
454 (method url-fetch)
455 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
456 version ".tar.xz"))
457 (sha256
458 (base32
459 "0ymg1mkg1n0770gmjfqp79p5ijxq04smfrsrrxc8pjc0y0agyf3f"))))
460 (build-system gnu-build-system)
461 (inputs
462 `(("fontconfig" ,fontconfig)
463 ("freetype" ,freetype)
464 ("gnutls" ,gnutls)
465 ("opus" ,opus)
466 ("ladspa" ,ladspa)
467 ("lame" ,lame)
468 ("libass" ,libass)
469 ("libbluray" ,libbluray)
470 ("libcaca" ,libcaca)
471 ("libcdio-paranoia" ,libcdio-paranoia)
472 ("libtheora" ,libtheora)
473 ("libvdpau" ,libvdpau)
474 ("libvorbis" ,libvorbis)
475 ("libvpx" ,libvpx)
476 ("libx11" ,libx11)
477 ("libx264" ,libx264)
478 ("mesa" ,mesa)
479 ("openal" ,openal)
480 ("pulseaudio" ,pulseaudio)
481 ("sdl" ,sdl2)
482 ("soxr" ,soxr)
483 ("speex" ,speex)
484 ("twolame" ,twolame)
485 ("x265" ,x265)
486 ("xvid" ,xvid)
487 ("zlib" ,zlib)))
488 (native-inputs
489 `(("bc" ,bc)
490 ("perl" ,perl)
491 ("pkg-config" ,pkg-config)
492 ("texinfo" ,texinfo)
493 ("python" ,python-2) ; scripts use interpreter python2
494 ("speex" ,speex)
495 ("yasm" ,yasm)))
496 (arguments
497 `(#:test-target "fate"
498 #:configure-flags
499 ;; possible additional inputs:
500 ;; --enable-avisynth enable reading of AviSynth script
501 ;; files [no]
502 ;; --enable-frei0r enable frei0r video filtering
503 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
504 ;; --enable-libcelt enable CELT decoding via libcelt [no]
505 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
506 ;; and libraw1394 [no]
507 ;; --enable-libfaac enable AAC encoding via libfaac [no]
508 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
509 ;; --enable-libflite enable flite (voice synthesis) support via
510 ;; libflite [no]
511 ;; --enable-libgme enable Game Music Emu via libgme [no]
512 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
513 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
514 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
515 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
516 ;; --enable-libnut enable NUT (de)muxing via libnut,
517 ;; native (de)muxer exists [no]
518 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
519 ;; libopencore-amrnb [no]
520 ;; --enable-libopencore-amrwb enable AMR-WB decoding via
521 ;; libopencore-amrwb [no]
522 ;; --enable-libopencv enable video filtering via libopencv [no]
523 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
524 ;; OpenJPEG [no]
525 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
526 ;; --enable-libschroedinger enable Dirac de/encoding via
527 ;; libschroedinger [no]
528 ;; --enable-libshine enable fixed-point MP3 encoding via
529 ;; libshine [no]
530 ;; --enable-libssh enable SFTP protocol via libssh [no]
531 ;; (libssh2 does not work)
532 ;; --enable-libstagefright-h264 enable H.264 decoding via
533 ;; libstagefright [no]
534 ;; --enable-libutvideo enable Ut Video encoding and decoding via
535 ;; libutvideo [no]
536 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
537 ;; --enable-libvidstab enable video stabilization using
538 ;; vid.stab [no]
539 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
540 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
541 ;; libvo-amrwbenc [no]
542 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
543 ;; --enable-libxavs enable AVS encoding via xavs [no]
544 ;; --enable-libzmq enable message passing via libzmq [no]
545 ;; --enable-libzvbi enable teletext support via libzvbi [no]
546 ;; --enable-opencl enable OpenCL code
547 '("--enable-avresample"
548 "--enable-gpl" ; enable optional gpl licensed parts
549 "--enable-shared"
550 "--enable-fontconfig"
551 "--enable-gnutls"
552 "--enable-ladspa"
553 "--enable-libass"
554 "--enable-libbluray"
555 "--enable-libcaca"
556 "--enable-libcdio"
557 "--enable-libfreetype"
558 "--enable-libmp3lame"
559 "--enable-libopus"
560 "--enable-libpulse"
561 "--enable-libsoxr"
562 "--enable-libspeex"
563 "--enable-libtheora"
564 "--enable-libtwolame"
565 "--enable-libvorbis"
566 "--enable-libvpx"
567 "--enable-libxvid"
568 "--enable-libx264"
569 "--enable-libx265"
570 "--enable-openal"
571 "--enable-opengl"
572 "--enable-x11grab"
573
574 "--enable-runtime-cpudetect"
575
576 ;; Runtime cpu detection is not implemented on
577 ;; MIPS, so we disable some features.
578 "--disable-mips32r2"
579 "--disable-mipsdsp"
580 "--disable-mipsdspr2"
581 "--disable-mipsfpu")
582 #:phases
583 (modify-phases %standard-phases
584 (replace
585 'configure
586 ;; configure does not work followed by "SHELL=..." and
587 ;; "CONFIG_SHELL=..."; set environment variables instead
588 (lambda* (#:key outputs configure-flags #:allow-other-keys)
589 (let ((out (assoc-ref outputs "out")))
590 (substitute* "configure"
591 (("#! /bin/sh") (string-append "#!" (which "sh"))))
592 (setenv "SHELL" (which "bash"))
593 (setenv "CONFIG_SHELL" (which "bash"))
594 (zero? (apply system*
595 "./configure"
596 (string-append "--prefix=" out)
597 ;; Add $libdir to the RUNPATH of all the binaries.
598 (string-append "--extra-ldflags=-Wl,-rpath="
599 out "/lib")
600 configure-flags)))))
601 (add-before
602 'check 'set-ld-library-path
603 (lambda _
604 ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
605 ;; running tests.
606 (let* ((dso (find-files "." "\\.so$"))
607 (path (string-join (map dirname dso) ":")))
608 (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
609 (setenv "LD_LIBRARY_PATH" path)
610 #t))))))
611 (home-page "https://www.ffmpeg.org/")
612 (synopsis "Audio and video framework")
613 (description "FFmpeg is a complete, cross-platform solution to record,
614 convert and stream audio and video. It includes the libavcodec
615 audio/video codec library.")
616 (license license:gpl2+)))
617
618 (define-public ffmpeg-2.8
619 (package
620 (inherit ffmpeg)
621 (version "2.8.11")
622 (source (origin
623 (method url-fetch)
624 (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
625 version ".tar.xz"))
626 (sha256
627 (base32
628 "1rhz7rhmhhh8bjcj3dc82haisn3qjbzqlr7k6d6v7064jgn3maiq"))))
629 (arguments
630 (substitute-keyword-arguments (package-arguments ffmpeg)
631 ((#:configure-flags flags)
632 `(map (lambda (flag)
633 (if (string=? flag "--disable-mipsdsp")
634 "--disable-mipsdspr1"
635 flag))
636 ,flags))))))
637
638 (define-public vlc
639 (package
640 (name "vlc")
641 (version "2.2.4")
642 (source (origin
643 (method url-fetch)
644 (uri (string-append
645 "https://download.videolan.org/pub/videolan/vlc/"
646 version "/vlc-" version ".tar.xz"))
647 (sha256
648 (base32
649 "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn"))
650 (modules '((guix build utils)))
651 (snippet
652 ;; There are two occurrences where __DATE__ and __TIME__ are
653 ;; used to capture the build time and show it to the user.
654 '(substitute* (find-files "." "help\\.c(pp)?$")
655 (("__DATE__") "\"2016\"")
656 (("__TIME__") "\"00:00\"")))))
657 (build-system gnu-build-system)
658 (native-inputs
659 `(("git" ,git) ; needed for a test
660 ("pkg-config" ,pkg-config)))
661 ;; FIXME: Add optional inputs once available.
662 (inputs
663 `(("alsa-lib" ,alsa-lib)
664 ("avahi" ,avahi)
665 ("dbus" ,dbus)
666 ("flac" ,flac)
667 ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
668 ("fontconfig" ,fontconfig)
669 ("freetype" ,freetype)
670 ("gnutls" ,gnutls)
671 ("liba52" ,liba52)
672 ("libcddb" ,libcddb)
673 ("libgcrypt" ,libgcrypt)
674 ("libkate" ,libkate)
675 ("libmad" ,libmad)
676 ("libogg" ,libogg)
677 ("libpng" ,libpng)
678 ("libsamplerate" ,libsamplerate)
679 ("libssh2" ,libssh2)
680 ("libvorbis" ,libvorbis)
681 ("libtheora" ,libtheora)
682 ("libxext" ,libxext)
683 ("libxi" ,libxi)
684 ("libxinerama" ,libxinerama)
685 ("libxml2" ,libxml2)
686 ("libxpm" ,libxpm)
687 ("lua" ,lua-5.1)
688 ("mesa" ,mesa)
689 ("opus" ,opus)
690 ("perl" ,perl)
691 ("pulseaudio" ,pulseaudio)
692 ("python" ,python-wrapper)
693 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
694 ;("qtbase" ,qtbase) with -std=gnu++11.
695 ;("qtx11extras" ,qtx11extras)
696 ("sdl" ,sdl)
697 ("sdl-image" ,sdl-image)
698 ("speex" ,speex)
699 ("x265" ,x265)
700 ("xcb-util-keysyms" ,xcb-util-keysyms)))
701 (arguments
702 `(#:configure-flags
703 `(;; Gross workaround for <https://trac.videolan.org/vlc/ticket/16907>.
704 ;; In our case, this led to a test failure:
705 ;; test_libvlc_equalizer: libvlc/equalizer.c:122: test_equalizer: Assertion `isnan(libvlc_audio_equalizer_get_amp_at_index (equalizer, u_bands))' failed.
706 "ac_cv_c_fast_math=no"
707
708 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
709 (assoc-ref %build-inputs "ffmpeg")
710 "/lib")) ;needed for the tests
711
712 #:phases
713 (modify-phases %standard-phases
714 (add-before 'configure 'remove-visual-tests
715 ;; Some of the tests require using the display to test out VLC,
716 ;; which fails in our sandboxed build system
717 (lambda _
718 (substitute* "test/run_vlc.sh"
719 (("./vlc --ignore-config") "echo"))
720 #t))
721 (add-after 'install 'regenerate-plugin-cache
722 (lambda* (#:key outputs #:allow-other-keys)
723 ;; The 'install-exec-hook' rule in the top-level Makefile.am
724 ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
725 ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
726 ;; it references. Thus, we first reset the timestamps of all
727 ;; these files, and then regenerate the cache such that the
728 ;; mtimes it includes are always zero instead of being dependent
729 ;; on the build time.
730 (let* ((out (assoc-ref outputs "out"))
731 (pkglibdir (string-append out "/lib/vlc"))
732 (plugindir (string-append pkglibdir "/plugins"))
733 (cachegen (string-append pkglibdir "/vlc-cache-gen")))
734 ;; TODO: Factorize 'reset-timestamps'.
735 (for-each (lambda (file)
736 (let ((s (lstat file)))
737 (unless (eq? (stat:type s) 'symlink)
738 (utime file 0 0 0 0))))
739 (find-files plugindir))
740 (zero? (system* cachegen plugindir))))))))
741 (home-page "https://www.videolan.org/")
742 (synopsis "Audio and video framework")
743 (description "VLC is a cross-platform multimedia player and framework
744 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
745 treaming protocols.")
746 (license license:gpl2+)))
747
748 (define-public mplayer
749 (package
750 (name "mplayer")
751 (version "1.3.0")
752 (source (origin
753 (method url-fetch)
754 (uri (string-append
755 "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
756 version ".tar.xz"))
757 (sha256
758 (base32
759 "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
760 (build-system gnu-build-system)
761 ;; FIXME: Add additional inputs once available.
762 (native-inputs
763 `(("pkg-config" ,pkg-config)))
764 (inputs
765 `(("alsa-lib" ,alsa-lib)
766 ("cdparanoia" ,cdparanoia)
767 ("ffmpeg" ,ffmpeg)
768 ("fontconfig" ,fontconfig)
769 ("freetype" ,freetype)
770 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
771 ("lame" ,lame)
772 ("libass" ,libass)
773 ("libdvdcss" ,libdvdcss)
774 ("libdvdnav" ,libdvdnav)
775 ("libjpeg" ,libjpeg)
776 ("libmpeg2" ,libmpeg2)
777 ("libmpg123" ,mpg123) ; audio codec for MP3
778 ("libpng" ,libpng)
779 ("libtheora" ,libtheora)
780 ("libvdpau" ,libvdpau)
781 ("libvorbis" ,libvorbis)
782 ("libx11" ,libx11)
783 ("libx264" ,libx264)
784 ("libxinerama" ,libxinerama)
785 ("libxv" ,libxv)
786 ("libxxf86dga" ,libxxf86dga)
787 ("mesa" ,mesa)
788 ("opus" ,opus)
789 ("perl" ,perl)
790 ("pulseaudio" ,pulseaudio)
791 ("python" ,python-wrapper)
792 ("sdl" ,sdl)
793 ("speex" ,speex)
794 ("yasm" ,yasm)
795 ("zlib" ,zlib)))
796 (arguments
797 `(#:tests? #f ; no test target
798 #:phases
799 (modify-phases %standard-phases
800 (replace 'configure
801 ;; configure does not work followed by "SHELL=..." and
802 ;; "CONFIG_SHELL=..."; set environment variables instead
803 (lambda* (#:key inputs outputs #:allow-other-keys)
804 (let ((out (assoc-ref outputs "out"))
805 (libx11 (assoc-ref inputs "libx11")))
806 (substitute* "configure"
807 (("#! /bin/sh") (string-append "#!" (which "sh"))))
808 (setenv "SHELL" (which "bash"))
809 (setenv "CONFIG_SHELL" (which "bash"))
810 (zero? (system*
811 "./configure"
812 (string-append "--extra-cflags=-I"
813 libx11 "/include") ; to detect libx11
814 "--disable-ffmpeg_a" ; disables bundled ffmpeg
815 (string-append "--prefix=" out)
816 ;; Enable runtime cpu detection where supported,
817 ;; and choose a suitable target.
818 ,@(match (or (%current-target-system)
819 (%current-system))
820 ("x86_64-linux"
821 '("--enable-runtime-cpudetection"
822 "--target=x86_64-linux"))
823 ("i686-linux"
824 '("--enable-runtime-cpudetection"
825 "--target=i686-linux"))
826 ("mips64el-linux"
827 '("--target=mips3-linux"))
828 (_ (list (string-append
829 "--target="
830 (or (%current-target-system)
831 (nix-system->gnu-triplet
832 (%current-system)))))))
833 "--disable-iwmmxt"))))))))
834 (home-page "https://www.mplayerhq.hu/design7/news.html")
835 (synopsis "Audio and video player")
836 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
837 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
838 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
839 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
840 (license license:gpl2)))
841
842 (define-public mpv
843 (package
844 (name "mpv")
845 (version "0.23.0")
846 (source (origin
847 (method url-fetch)
848 (uri (string-append
849 "https://github.com/mpv-player/mpv/archive/v" version
850 ".tar.gz"))
851 (sha256
852 (base32
853 "1629v5l0rmphxra7chmfm7bnn59zc1mp529b9m2zqzaqf1czxvla"))
854 (file-name (string-append name "-" version ".tar.gz"))))
855 (build-system waf-build-system)
856 (native-inputs
857 `(("perl" ,perl) ; for zsh completion file
858 ("pkg-config" ,pkg-config)
859 ("python-docutils" ,python-docutils)))
860 ;; Missing features: libguess, Wayland, V4L2
861 (inputs
862 `(("alsa-lib" ,alsa-lib)
863 ("enca" ,enca)
864 ("ffmpeg" ,ffmpeg)
865 ("jack" ,jack-1)
866 ("ladspa" ,ladspa)
867 ("lcms" ,lcms)
868 ("libass" ,libass)
869 ("libbluray" ,libbluray)
870 ("libcaca" ,libcaca)
871 ("libbs2b" ,libbs2b)
872 ("libcdio-paranoia" ,libcdio-paranoia)
873 ("libdvdread" ,libdvdread)
874 ("libdvdnav" ,libdvdnav)
875 ("libjpeg" ,libjpeg)
876 ("libva" ,libva)
877 ("libvdpau" ,libvdpau)
878 ("libx11" ,libx11)
879 ("libxext" ,libxext)
880 ("libxinerama" ,libxinerama)
881 ("libxrandr" ,libxrandr)
882 ("libxscrnsaver" ,libxscrnsaver)
883 ("libxv" ,libxv)
884 ;; XXX: lua > 5.2 is not currently supported; see
885 ;; waftools/checks/custom.py
886 ("lua" ,lua-5.2)
887 ("mesa" ,mesa)
888 ("mpg123" ,mpg123)
889 ("pulseaudio" ,pulseaudio)
890 ("rsound" ,rsound)
891 ("waf" ,python-waf)
892 ("youtube-dl" ,youtube-dl)
893 ("zlib" ,zlib)))
894 (arguments
895 '(#:phases
896 (modify-phases %standard-phases
897 (add-before
898 'configure 'setup-waf
899 (lambda* (#:key inputs #:allow-other-keys)
900 (copy-file (assoc-ref inputs "waf") "waf")
901 (setenv "CC" "gcc"))))
902 #:configure-flags (list "--enable-libmpv-shared"
903 "--enable-zsh-comp"
904 "--disable-build-date")
905 ;; No check function defined.
906 #:tests? #f))
907 (home-page "https://mpv.io/")
908 (synopsis "Audio and video player")
909 (description "mpv is a general-purpose audio and video player. It is a
910 fork of mplayer2 and MPlayer. It shares some features with the former
911 projects while introducing many more.")
912 (license license:gpl2+)))
913
914 (define-public gnome-mpv
915 (package
916 (name "gnome-mpv")
917 (version "0.11")
918 (source
919 (origin
920 (method url-fetch)
921 (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
922 "/download/v" version "/gnome-mpv-" version
923 ".tar.xz"))
924 (sha256
925 (base32
926 "1hn3mpsxbrwf2m0nz4vzji4i6i896y8kqjb9kijqpk04cnrs3fgz"))))
927 (native-inputs
928 `(("intltool" ,intltool)
929 ("pkg-config" ,pkg-config)))
930 (inputs
931 `(("gtk+" ,gtk+)
932 ("libepoxy" ,libepoxy)
933 ("mpv" ,mpv)))
934 (build-system glib-or-gtk-build-system)
935 (home-page "https://github.com/gnome-mpv/gnome-mpv")
936 (synopsis "GTK+ frontend for the mpv media player")
937 (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
938 GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
939 access to mpv's powerful playback capabilities.")
940 (license license:gpl3+)))
941
942 (define-public libvpx
943 (package
944 (name "libvpx")
945 (version "1.6.1")
946 (source (origin
947 (method url-fetch)
948 (uri (string-append "http://storage.googleapis.com/"
949 "downloads.webmproject.org/releases/webm/"
950 name "-" version ".tar.bz2"))
951 (sha256
952 (base32
953 "06d8hqjkfs6wl45qf4pwh1kpbvkx6cwywd5y8d4lgagvjwm0qb0w"))
954 (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
955 (build-system gnu-build-system)
956 (arguments
957 `(#:phases
958 (modify-phases %standard-phases
959 (replace 'configure
960 (lambda* (#:key outputs #:allow-other-keys)
961 (setenv "CONFIG_SHELL" (which "bash"))
962 (let ((out (assoc-ref outputs "out")))
963 (setenv "LDFLAGS"
964 (string-append "-Wl,-rpath=" out "/lib"))
965 (zero? (system* "./configure"
966 "--enable-shared"
967 "--as=yasm"
968 ;; Limit size to avoid CVE-2015-1258
969 "--size-limit=16384x16384"
970 (string-append "--prefix=" out)))))))
971 #:tests? #f)) ; no check target
972 (native-inputs
973 `(("perl" ,perl)
974 ("yasm" ,yasm)))
975 (synopsis "VP8/VP9 video codec")
976 (description "libvpx is a codec for the VP8/VP9 video compression format.")
977 (license license:bsd-3)
978 (home-page "http://www.webmproject.org/")))
979
980 (define-public youtube-dl
981 (package
982 (name "youtube-dl")
983 (version "2017.02.16")
984 (source (origin
985 (method url-fetch)
986 (uri (string-append "https://yt-dl.org/downloads/"
987 version "/youtube-dl-"
988 version ".tar.gz"))
989 (sha256
990 (base32
991 "1c2rx8hj960wg2sffpvg2513rl9grkwcpn4xk612ibfq4m7h3991"))))
992 (build-system python-build-system)
993 (arguments
994 ;; The problem here is that the directory for the man page and completion
995 ;; files is relative, and for some reason, setup.py uses the
996 ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
997 ;; So, we need pass the prefix directly. In addition, make sure the Bash
998 ;; completion file is called 'youtube-dl' rather than
999 ;; 'youtube-dl.bash-completion'.
1000 `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
1001 #:phases (modify-phases %standard-phases
1002 (add-before 'install 'fix-the-data-directories
1003 (lambda* (#:key outputs #:allow-other-keys)
1004 (let ((prefix (assoc-ref outputs "out")))
1005 (mkdir "bash-completion")
1006 (rename-file "youtube-dl.bash-completion"
1007 "bash-completion/youtube-dl")
1008 (substitute* "setup.py"
1009 (("youtube-dl\\.bash-completion")
1010 "bash-completion/youtube-dl")
1011 (("'etc/")
1012 (string-append "'" prefix "/etc/"))
1013 (("'share/")
1014 (string-append "'" prefix "/share/")))))))))
1015 (synopsis "Download videos from YouTube.com and other sites")
1016 (description
1017 "Youtube-dl is a small command-line program to download videos from
1018 YouTube.com and a few more sites.")
1019 (home-page "https://yt-dl.org")
1020 (license license:public-domain)))
1021
1022 (define-public libbluray
1023 (package
1024 (name "libbluray")
1025 (version "0.9.3")
1026 (source (origin
1027 (method url-fetch)
1028 (uri (string-append "https://download.videolan.org/videolan/"
1029 name "/" version "/"
1030 name "-" version ".tar.bz2"))
1031 (sha256
1032 (base32
1033 "1q1whviqv5sr9nr372h31zwid1rvbfbx3z4lzr8lnj25xha6cdm6"))))
1034 (build-system gnu-build-system)
1035 (arguments
1036 `(#:configure-flags '("--disable-bdjava")
1037 #:phases
1038 (modify-phases %standard-phases
1039 (add-before 'build 'fix-dlopen-paths
1040 (lambda* (#:key inputs #:allow-other-keys)
1041 (let ((libaacs (assoc-ref inputs "libaacs"))
1042 (libbdplus (assoc-ref inputs "libbdplus")))
1043 (substitute* "src/libbluray/disc/aacs.c"
1044 (("\"libaacs\"")
1045 (string-append "\"" libaacs "/lib/libaacs\"")))
1046 (substitute* "src/libbluray/disc/bdplus.c"
1047 (("\"libbdplus\"")
1048 (string-append "\"" libbdplus "/lib/libbdplus\"")))
1049 #t))))))
1050 (native-inputs `(("pkg-config" ,pkg-config)))
1051 (inputs
1052 `(("fontconfig" ,fontconfig)
1053 ("freetype" ,freetype)
1054 ("libaacs" ,libaacs)
1055 ("libbdplus" ,libbdplus)
1056 ("libxml2" ,libxml2)))
1057 (home-page "https://www.videolan.org/developers/libbluray.html")
1058 (synopsis "Blu-Ray Disc playback library")
1059 (description
1060 "libbluray is a library designed for Blu-Ray Disc playback for media
1061 players, like VLC or MPlayer.")
1062 (license license:lgpl2.1+)))
1063
1064 (define-public libdvdread
1065 (package
1066 (name "libdvdread")
1067 (version "5.0.3")
1068 (source (origin
1069 (method url-fetch)
1070 (uri (string-append "http://download.videolan.org/videolan/"
1071 name "/" version "/"
1072 name "-" version ".tar.bz2"))
1073 (sha256
1074 (base32
1075 "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
1076 (build-system gnu-build-system)
1077 (home-page "http://dvdnav.mplayerhq.hu/")
1078 (synopsis "Library for reading video DVDs")
1079 (description
1080 "Libdvdread provides a simple foundation for reading DVD video
1081 disks. It provides the functionality that is required to access many
1082 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
1083 authentication and descrambling (if an external libdvdcss library is
1084 installed).")
1085 (license license:gpl2+)))
1086
1087 (define-public libdvdnav
1088 (package
1089 (name "libdvdnav")
1090 (version "5.0.3")
1091 (source (origin
1092 (method url-fetch)
1093 (uri (string-append "http://download.videolan.org/videolan/"
1094 name "/" version "/"
1095 name "-" version ".tar.bz2"))
1096 (sha256
1097 (base32
1098 "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
1099 (build-system gnu-build-system)
1100 (native-inputs
1101 `(("pkg-config" ,pkg-config)))
1102 (inputs
1103 `(("libdvdread" ,libdvdread)))
1104 (home-page "http://dvdnav.mplayerhq.hu/")
1105 (synopsis "Library for video DVD navigation features")
1106 (description
1107 "Libdvdnav is a library for developers of multimedia
1108 applications. It allows easy use of sophisticated DVD navigation features
1109 such as DVD menus, multiangle playback and even interactive DVD games. All
1110 this functionality is provided through a simple API which provides the DVD
1111 playback as a single logical stream of blocks, intermitted by special
1112 dvdnav events to report certain conditions. The main usage of libdvdnav is
1113 a loop regularly calling a function to get the next block, surrounded by
1114 additional calls to tell the library of user interaction. The whole
1115 DVD virtual machine and internal playback states are completely
1116 encapsulated.")
1117 (license license:gpl2+)))
1118
1119 (define-public libdvdnav-4
1120 (package
1121 (inherit libdvdnav)
1122 (version "4.2.1")
1123 (source (origin
1124 (method url-fetch)
1125 (uri
1126 (string-append
1127 "http://download.videolan.org/videolan/libdvdnav/libdvdnav-"
1128 version ".tar.xz"))
1129 (sha256
1130 (base32
1131 "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
1132 (native-inputs
1133 `(("pkg-config" ,pkg-config)
1134 ("autoconf" ,autoconf)
1135 ("automake" ,automake)
1136 ("libtool" ,libtool)))
1137 (arguments
1138 '(#:phases
1139 (alist-cons-after
1140 'unpack 'autoreconf
1141 (lambda _
1142 (zero? (system* "autoreconf" "-vif")))
1143 %standard-phases)))))
1144
1145 (define-public libdvdcss
1146 (package
1147 (name "libdvdcss")
1148 (version "1.4.0")
1149 (source (origin
1150 (method url-fetch)
1151 (uri (string-append "http://download.videolan.org/pub/"
1152 name "/" version "/"
1153 name "-" version ".tar.bz2"))
1154 (sha256
1155 (base32
1156 "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
1157 (build-system gnu-build-system)
1158 (home-page "http://www.videolan.org/developers/libdvdcss.html")
1159 (synopsis "Library for accessing DVDs as block devices")
1160 (description
1161 "libdvdcss is a simple library designed for accessing DVDs like a block
1162 device without having to bother about the decryption.")
1163 (license license:gpl2+)))
1164
1165 (define-public srt2vtt
1166 (package
1167 (name "srt2vtt")
1168 (version "0.1")
1169 (source (origin
1170 (method url-fetch)
1171 (uri (string-append
1172 "http://dthompson.us/releases/srt2vtt/srt2vtt-"
1173 version ".tar.gz"))
1174 (sha256
1175 (base32
1176 "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
1177 (build-system gnu-build-system)
1178 (inputs
1179 `(("guile" ,guile-2.0)))
1180 (synopsis "SubRip to WebVTT subtitle converter")
1181 (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
1182 for use with HTML5 video.")
1183 (home-page "http://dthompson.us/pages/software/srt2vtt")
1184 (license license:gpl3+)))
1185
1186 (define-public avidemux
1187 (package
1188 (name "avidemux")
1189 (version "2.6.12")
1190 (source (origin
1191 (method url-fetch)
1192 (uri (string-append
1193 "mirror://sourceforge/" name "/" name "/" version "/"
1194 name "_" version ".tar.gz"))
1195 (sha256
1196 (base32
1197 "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
1198 (patches (search-patches "avidemux-install-to-lib.patch"))))
1199 (build-system cmake-build-system)
1200 (native-inputs
1201 `(("pkg-config" ,pkg-config)))
1202 ;; FIXME: Once packaged, add libraries not found during the build.
1203 (inputs
1204 `(("alsa-lib" ,alsa-lib)
1205 ("fontconfig" ,fontconfig)
1206 ("freetype" ,freetype)
1207 ("fribidi" ,fribidi)
1208 ("glu" ,glu)
1209 ("jack" ,jack-1)
1210 ("lame" ,lame)
1211 ("libva" ,libva)
1212 ("libvdpau" ,libvdpau)
1213 ("libvorbis" ,libvorbis)
1214 ("libvpx" ,libvpx)
1215 ("libxv" ,libxv)
1216 ("perl" ,perl)
1217 ("pulseaudio" ,pulseaudio)
1218 ("python" ,python-wrapper)
1219 ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
1220 ;("qtbase" ,qtbase) with -std=gnu++11.
1221 ;("qttools" ,qttools)
1222 ("sdl" ,sdl)
1223 ("sqlite" ,sqlite)
1224 ("yasm" ,yasm)
1225 ("zlib" ,zlib)))
1226 (arguments
1227 `(#:tests? #f ; no check target
1228 #:phases
1229 ;; Make sure files inside the included ffmpeg tarball are
1230 ;; patch-shebanged.
1231 (modify-phases %standard-phases
1232 (add-before 'patch-source-shebangs 'unpack-ffmpeg
1233 (lambda _
1234 (with-directory-excursion "avidemux_core/ffmpeg_package"
1235 (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
1236 (delete-file "ffmpeg-2.7.6.tar.bz2"))))
1237 (add-after 'patch-source-shebangs 'repack-ffmpeg
1238 (lambda _
1239 (with-directory-excursion "avidemux_core/ffmpeg_package"
1240 (substitute* "ffmpeg-2.7.6/configure"
1241 (("#! /bin/sh") (string-append "#!" (which "sh"))))
1242 (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
1243 ;; avoid non-determinism in the archive
1244 "--sort=name" "--mtime=@0"
1245 "--owner=root:0" "--group=root:0")
1246 (delete-file-recursively "ffmpeg-2.7.6"))))
1247 (replace 'configure
1248 (lambda _
1249 ;; Copy-paste settings from the cmake build system.
1250 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1251 (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
1252 (replace 'build
1253 (lambda* (#:key inputs outputs #:allow-other-keys)
1254 (let*
1255 ((out (assoc-ref outputs "out"))
1256 (lib (string-append out "/lib"))
1257 (top (getcwd))
1258 (sdl (assoc-ref inputs "sdl"))
1259 (build_component
1260 (lambda* (component srcdir #:optional (args '()))
1261 (let ((builddir (string-append "build_" component)))
1262 (mkdir builddir)
1263 (with-directory-excursion builddir
1264 (zero?
1265 (and
1266 (apply system* "cmake"
1267 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
1268 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
1269 (string-append "-DCMAKE_INSTALL_RPATH=" lib)
1270 (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
1271 "\"-Wl,-rpath=" lib "\"")
1272 (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
1273 (string-append "-DSDL_INCLUDE_DIR="
1274 sdl "/include/SDL")
1275 (string-append "../" srcdir)
1276 "-DENABLE_QT5=True"
1277 args)
1278 (system* "make" "-j"
1279 (number->string (parallel-job-count)))
1280 (system* "make" "install"))))))))
1281 (mkdir out)
1282 (and (build_component "core" "avidemux_core")
1283 (build_component "cli" "avidemux/cli")
1284 (build_component "qt4" "avidemux/qt4")
1285 (build_component "plugins_common" "avidemux_plugins"
1286 '("-DPLUGIN_UI=COMMON"))
1287 (build_component "plugins_cli" "avidemux_plugins"
1288 '("-DPLUGIN_UI=CLI"))
1289 (build_component "plugins_qt4" "avidemux_plugins"
1290 '("-DPLUGIN_UI=QT4"))
1291 (build_component "plugins_settings" "avidemux_plugins"
1292 '("-DPLUGIN_UI=SETTINGS")))
1293 ;; Remove .exe and .dll file.
1294 (delete-file-recursively
1295 (string-append out "/share/ADM6_addons")))))
1296 (delete 'install))))
1297 (home-page "http://fixounet.free.fr/avidemux/")
1298 (synopsis "Video editor")
1299 (description "Avidemux is a video editor designed for simple cutting,
1300 filtering and encoding tasks. It supports many file types, including AVI,
1301 DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
1302 can be automated using projects, job queue and powerful scripting
1303 capabilities.")
1304 ;; Software with various licenses is included, see License.txt.
1305 (license license:gpl2+)))
1306
1307 (define-public vapoursynth
1308 (package
1309 (name "vapoursynth")
1310 (version "35")
1311 (source (origin
1312 (method url-fetch)
1313 (uri (string-append
1314 "https://github.com/vapoursynth/vapoursynth/archive/R"
1315 version ".tar.gz"))
1316 (file-name (string-append name "-" version ".tar.gz"))
1317 (sha256
1318 (base32
1319 "0629ys2lf618n9cc644xlvx0vx52v2fp3sx14p4mx5rg9nlasb3n"))))
1320 (build-system gnu-build-system)
1321 (native-inputs
1322 `(("autoconf" ,autoconf)
1323 ("automake" ,automake)
1324 ("cython" ,python-cython)
1325 ("libtool" ,libtool)
1326 ("pkg-config" ,pkg-config)
1327 ("python" ,python)
1328 ("yasm" ,yasm)))
1329 (inputs
1330 `(("ffmpeg" ,ffmpeg)
1331 ("libass" ,libass)
1332 ("tesseract-ocr" ,tesseract-ocr)
1333 ("zimg" ,zimg)))
1334 (arguments
1335 '(#:phases
1336 (modify-phases %standard-phases
1337 (add-after
1338 'unpack 'autogen
1339 (lambda _
1340 (zero? (system* "sh" "autogen.sh")))))))
1341 (home-page "http://www.vapoursynth.com/")
1342 (synopsis "Video processing framework")
1343 (description "VapourSynth is a C++ library and Python module for video
1344 manipulation. It aims to be a modern rewrite of Avisynth, supporting
1345 multithreading, generalized colorspaces, per frame properties, and videos with
1346 format changes.")
1347 ;; src/core/cpufeatures only allows x86, ARM or PPC
1348 (supported-systems (delete "mips64el-linux" %supported-systems))
1349 ;; As seen from the source files.
1350 (license license:lgpl2.1+)))
1351
1352 (define-public xvid
1353 (package
1354 (name "xvid")
1355 (version "1.3.4")
1356 (source (origin
1357 (method url-fetch)
1358 (uri (string-append
1359 "http://downloads.xvid.org/downloads/xvidcore-"
1360 version ".tar.bz2"))
1361 (sha256
1362 (base32
1363 "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
1364 (build-system gnu-build-system)
1365 (native-inputs `(("yasm" ,yasm)))
1366 (arguments
1367 '(#:phases
1368 (modify-phases %standard-phases
1369 (add-before
1370 'configure 'pre-configure
1371 (lambda _
1372 (chdir "build/generic")
1373 (substitute* "configure"
1374 (("#! /bin/sh") (string-append "#!" (which "sh")))))))
1375 ;; No 'check' target.
1376 #:tests? #f))
1377 (home-page "https://www.xvid.com/")
1378 (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
1379 (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
1380 codec library. It uses ASP features such as b-frames, global and quarter
1381 pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
1382 and custom quantization matrices.")
1383 (license license:gpl2+)))
1384
1385 (define-public livestreamer
1386 (package
1387 (name "livestreamer")
1388 (version "1.12.2")
1389 (source (origin
1390 (method url-fetch)
1391 (uri (string-append
1392 "https://github.com/chrippa/livestreamer/archive/v"
1393 version ".tar.gz"))
1394 (file-name (string-append "livestreamer-" version ".tar.gz"))
1395 (sha256
1396 (base32
1397 "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
1398 (build-system python-build-system)
1399 (arguments
1400 '(#:tests? #f)) ; tests rely on external web servers
1401 (propagated-inputs
1402 `(("python-requests" ,python-requests)))
1403 (synopsis "Internet video stream viewer")
1404 (description "Livestreamer is a command-line utility that extracts streams
1405 from various services and pipes them into a video playing application.")
1406 (home-page "http://livestreamer.io/")
1407 (license license:bsd-2)))
1408
1409 (define-public mlt
1410 (package
1411 (name "mlt")
1412 (version "6.4.1")
1413 (source (origin
1414 (method url-fetch)
1415 (uri (string-append "https://github.com/mltframework/mlt/"
1416 "archive/v" version ".tar.gz"))
1417 (file-name (string-append name "-" version ".tar.gz"))
1418 (sha256
1419 (base32
1420 "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))))
1421 (build-system gnu-build-system)
1422 (arguments
1423 `(#:tests? #f ; no tests
1424 #:make-flags '("CC=gcc")
1425 #:configure-flags
1426 (list "--enable-gpl3"
1427 "--enable-gpl")
1428 #:phases
1429 (modify-phases %standard-phases
1430 (add-after
1431 'configure 'override-LDFLAGS
1432 (lambda* (#:key outputs #:allow-other-keys)
1433 (substitute* "config.mak"
1434 (("LDFLAGS\\+=")
1435 (string-append "LDFLAGS+=-Wl,-rpath="
1436 (assoc-ref outputs "out")
1437 "/lib ")))
1438 #t)))))
1439 (inputs
1440 `(("alsa-lib" ,alsa-lib)
1441 ("fftw" ,fftw)
1442 ("libxml2" ,libxml2)
1443 ("jack" ,jack-1)
1444 ("ladspa" ,ladspa)
1445 ("libsamplerate" ,libsamplerate)
1446 ("pulseaudio" ,pulseaudio)
1447 ("sdl" ,sdl)
1448 ("sox" ,sox)))
1449 (native-inputs
1450 `(("pkg-config" ,pkg-config)))
1451 (home-page "https://www.mltframework.org/")
1452 (synopsis "Author, manage, and run multitrack audio/video compositions")
1453 (description
1454 "MLT is a multimedia framework, designed and developed for television
1455 broadcasting. It provides a toolkit for broadcasters, video editors, media
1456 players, transcoders, web streamers and many more types of applications. The
1457 functionality of the system is provided via an assortment of ready to use
1458 tools, XML authoring components, and an extensible plug-in based API.")
1459 (license license:lgpl2.1+)))
1460
1461 (define-public v4l-utils
1462 (package
1463 (name "v4l-utils")
1464 (version "1.10.1")
1465 (source (origin
1466 (method url-fetch)
1467 (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
1468 "/v4l-utils-" version ".tar.bz2"))
1469 (sha256
1470 (base32
1471 "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1"))))
1472 (build-system gnu-build-system)
1473 (arguments
1474 '(#:configure-flags
1475 (list (string-append "--with-udevdir="
1476 (assoc-ref %outputs "out")
1477 "/lib/udev")
1478 "CXXFLAGS=-std=gnu++11")))
1479 (native-inputs
1480 `(("pkg-config" ,pkg-config)))
1481 (inputs
1482 `(("alsa-lib" ,alsa-lib)
1483 ("glu" ,glu)
1484 ("libjpeg" ,libjpeg)
1485 ("libx11" ,libx11)
1486 ("qtbase" ,qtbase)
1487 ("eudev" ,eudev)))
1488 (synopsis "Realtime video capture utilities for Linux")
1489 (description "The v4l-utils provide a series of libraries and utilities to
1490 be used for realtime video capture via Linux-specific APIs.")
1491 (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
1492 ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
1493 (license (list license:lgpl2.1+ license:gpl2))))
1494
1495 (define-public obs
1496 (package
1497 (name "obs")
1498 (version "17.0.2")
1499 (source (origin
1500 (method url-fetch)
1501 (uri (string-append "https://github.com/jp9000/obs-studio"
1502 "/archive/" version ".tar.gz"))
1503 (file-name (string-append name "-" version ".tar.gz"))
1504 (sha256
1505 (base32
1506 "02cfhpkcsq718zwhwwsm48gjggf95qr38hqpi0kwrvsy18ll0msm"))))
1507 (build-system cmake-build-system)
1508 (arguments
1509 `(#:tests? #f ; no tests
1510 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1511 (%current-system)))
1512 '("arm" "mips"))
1513 '(#:phases
1514 (modify-phases %standard-phases
1515 (add-after 'unpack 'remove-architecture-specific-instructions
1516 ;; non-Intel platforms fail to build with the architecture
1517 ;; specific compiler flags included by default.
1518 (lambda _
1519 (substitute* "libobs/CMakeLists.txt"
1520 (("if\\(NOT MSVC\\)") "if(MSVC)"))
1521 #t))))
1522 '())))
1523 (native-inputs
1524 `(("pkg-config" ,pkg-config)))
1525 (inputs
1526 `(("alsa-lib" ,alsa-lib)
1527 ("curl" ,curl)
1528 ("eudev" ,eudev)
1529 ("ffmpeg" ,ffmpeg)
1530 ("fontconfig" ,fontconfig)
1531 ("freetype" ,freetype)
1532 ("jack" ,jack-1)
1533 ("jansson" ,jansson)
1534 ("libx264" ,libx264)
1535 ("libxcomposite" ,libxcomposite)
1536 ("mesa" ,mesa)
1537 ("pulseaudio" ,pulseaudio)
1538 ("qtbase" ,qtbase)
1539 ("qtx11extras" ,qtx11extras)
1540 ("speex" ,speex)
1541 ("v4l-utils" ,v4l-utils)
1542 ("zlib" ,zlib)))
1543 (synopsis "Live streaming software")
1544 (description "Open Broadcaster Software provides a graphical interface for
1545 video recording and live streaming. OBS supports capturing audio and video
1546 from many input sources such as webcams, X11 (for screencasting), PulseAudio,
1547 and JACK.")
1548 (home-page "https://obsproject.com")
1549 (license license:gpl2+)))
1550
1551 (define-public libvdpau
1552 (package
1553 (name "libvdpau")
1554 (version "1.1.1")
1555 (source
1556 (origin
1557 (method url-fetch)
1558 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1559 name "-" version ".tar.bz2"))
1560 (sha256
1561 (base32
1562 "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
1563 (build-system gnu-build-system)
1564 (native-inputs
1565 `(("pkg-config" ,pkg-config)))
1566 (inputs
1567 `(("dri2proto" ,dri2proto)
1568 ("libx11" ,libx11 "out")
1569 ("libxext" ,libxext)))
1570 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1571 (synopsis "Video Decode and Presentation API")
1572 (description "VDPAU is the Video Decode and Presentation API for UNIX. It
1573 provides an interface to video decode acceleration and presentation hardware
1574 present in modern GPUs.")
1575 (license (license:x11-style "file://COPYING"))))
1576
1577 (define-public vdpauinfo
1578 (package
1579 (name "vdpauinfo")
1580 (version "1.0")
1581 (source
1582 (origin
1583 (method url-fetch)
1584 (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
1585 name "-" version ".tar.gz"))
1586 (sha256
1587 (base32
1588 "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
1589 (build-system gnu-build-system)
1590 (native-inputs
1591 `(("pkg-config" ,pkg-config)
1592 ("libx11" ,libx11)))
1593 (propagated-inputs
1594 `(("libvdpau" ,libvdpau)))
1595 (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
1596 (synopsis "Tool to query the capabilities of a VDPAU implementation")
1597 (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
1598 implementation.")
1599 (license (license:x11-style "file://COPYING"))))
1600
1601 (define-public recordmydesktop
1602 (package
1603 (name "recordmydesktop")
1604 (version "0.3.8.1")
1605 (source (origin
1606 (method url-fetch)
1607 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1608 version "/recordmydesktop-" version ".tar.gz"))
1609 (sha256
1610 (base32
1611 "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
1612 (build-system gnu-build-system)
1613 (inputs `(("popt" ,popt)
1614 ("zlib" ,zlib)
1615 ("libx11" ,libx11)
1616 ("libice" ,libice)
1617 ("libsm" ,libsm)
1618 ("libxfixes" ,libxfixes)
1619 ("libxdamage" ,libxdamage)
1620 ("libxext" ,libxext)
1621 ("alsa-lib" ,alsa-lib)
1622 ("libvorbis" ,libvorbis)
1623 ("libtheora" ,libtheora)))
1624 (home-page "http://recordmydesktop.sourceforge.net/")
1625 (synopsis "Desktop session video recorder")
1626 (description
1627 "recordMyDesktop is a command-line tool that captures the activity in
1628 your graphical desktop and encodes it as a video. This is a useful tool for
1629 making @dfn{screencasts}.")
1630 (license license:gpl2+)))
1631
1632 (define-public libsmpeg
1633 (package
1634 (name "libsmpeg")
1635 (version "0.4.5")
1636 (source (origin
1637 (method svn-fetch)
1638 (uri (svn-reference
1639 (url "svn://svn.icculus.org/smpeg/trunk/")
1640 (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
1641 (sha256
1642 (base32
1643 "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
1644 (build-system gnu-build-system)
1645 (arguments
1646 `(#:phases (modify-phases %standard-phases
1647 (add-after 'unpack 'autogen.sh
1648 (lambda _
1649 (zero? (system* "sh" "autogen.sh")))))))
1650 (native-inputs
1651 `(("autoconf" ,autoconf)
1652 ("automake" ,automake)))
1653 (inputs
1654 `(("sdl" ,sdl2)))
1655 (home-page "http://icculus.org/smpeg/")
1656 (synopsis "SDL MPEG decoding library")
1657 (description
1658 "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
1659 with sound support. Video playback is based on the ubiquitous Berkeley MPEG
1660 player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
1661 library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
1662 and MPEG system streams.")
1663 (license (list license:expat
1664 license:lgpl2.1
1665 license:lgpl2.1+
1666 license:gpl2))))
1667
1668 (define-public libbdplus
1669 (package
1670 (name "libbdplus")
1671 (version "0.1.2")
1672 (source
1673 (origin
1674 (method url-fetch)
1675 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libbdplus/"
1676 version "/" name "-" version ".tar.bz2"))
1677 (sha256
1678 (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
1679 (inputs
1680 `(("libgcrypt" ,libgcrypt)))
1681 (build-system gnu-build-system)
1682 (home-page "http://www.videolan.org/developers/libbdplus.html")
1683 (synopsis "Library for decrypting certain Blu-Ray discs")
1684 (description "libbdplus is a library which implements the BD+ System
1685 specifications.")
1686 (license license:lgpl2.1+)))
1687
1688 (define-public libaacs
1689 (package
1690 (name "libaacs")
1691 (version "0.8.1")
1692 (source
1693 (origin
1694 (method url-fetch)
1695 (uri (string-append "ftp://ftp.videolan.org/pub/videolan/libaacs/"
1696 version "/" name "-" version ".tar.bz2"))
1697 (sha256
1698 (base32 "1s5v075hnbs57995r6lljm79wgrip3gnyf55a0y7bja75jh49hwm"))))
1699 (inputs
1700 `(("libgcrypt" ,libgcrypt)))
1701 (native-inputs
1702 `(("bison" ,bison)
1703 ("flex" ,flex)))
1704 (build-system gnu-build-system)
1705 (home-page "http://www.videolan.org/developers/libaacs.html")
1706 (synopsis "Library for decrypting certain Blu-Ray discs")
1707 (description "libaacs is a library which implements the Advanced Access
1708 Content System specification.")
1709 (license license:lgpl2.1+)))
1710
1711 (define-public mps-youtube
1712 (package
1713 (name "mps-youtube")
1714 (version "0.2.7.1")
1715 (source
1716 (origin
1717 (method url-fetch)
1718 (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
1719 "archive/v" version ".tar.gz"))
1720 (file-name (string-append name "-" version ".tar.gz"))
1721 (sha256
1722 (base32
1723 "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
1724 (build-system python-build-system)
1725 (arguments
1726 ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
1727 ;; test suite results differ depending on the country and also introduce
1728 ;; non-determinism in the tests.
1729 ;; https://github.com/mps-youtube/mps-youtube/issues/556
1730 `(#:tests? #f))
1731 (propagated-inputs
1732 `(("python-pafy" ,python-pafy)
1733 ("python-pygobject" ,python-pygobject))) ; For mpris2 support
1734 (home-page "https://github.com/mps-youtube/mps-youtube")
1735 (synopsis "Terminal based YouTube player and downloader")
1736 (description
1737 "@code{mps-youtube} is based on mps, a terminal based program to
1738 search, stream and download music. This implementation uses YouTube as
1739 a source of content and can play and download video as well as audio.
1740 It can use either mpv or mplayer for playback, and for conversion of
1741 formats ffmpeg or libav is used. Users should install one of the
1742 supported players in addition to this package.")
1743 (license license:gpl3+)))
1744
1745 (define-public handbrake
1746 (package
1747 (name "handbrake")
1748 (version "0.10.5")
1749 (source (origin
1750 (method url-fetch)
1751 (uri (string-append "https://handbrake.fr/rotation.php?file="
1752 "HandBrake-" version ".tar.bz2"))
1753 (file-name (string-append "handbrake-" version ".tar.bz2"))
1754 (sha256
1755 (base32
1756 "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
1757 (patches (search-patches "handbrake-pkg-config-path.patch"))
1758 (modules '((guix build utils)))
1759 (snippet
1760 ;; Remove bundled libraries and source not necessary for
1761 ;; running under a GNU environment.
1762 '(begin
1763 (for-each delete-file-recursively '("contrib" "macosx" "win"))
1764 #t))))
1765 (build-system glib-or-gtk-build-system)
1766 (native-inputs
1767 `(("automake" ,automake) ;gui subpackage must be bootstrapped
1768 ("autoconf" ,autoconf)
1769 ("curl" ,curl) ;not actually used, but tested for
1770 ("intltool" ,intltool)
1771 ("libtool" ,libtool)
1772 ("pkg-config" ,pkg-config)
1773 ("python" ,python-2))) ;for configuration
1774 (inputs
1775 `(("bzip2" ,bzip2)
1776 ("dbus-glib" ,dbus-glib)
1777 ("ffmpeg" ,ffmpeg)
1778 ("fontconfig" ,fontconfig)
1779 ("freetype" ,freetype)
1780 ("glib" ,glib)
1781 ("gstreamer" ,gstreamer)
1782 ("gst-plugins-base" ,gst-plugins-base)
1783 ("gtk+" ,gtk+)
1784 ("lame" ,lame)
1785 ("libass" ,libass)
1786 ("libbluray" ,libbluray)
1787 ("libdvdnav" ,libdvdnav)
1788 ("libdvdread" ,libdvdread)
1789 ("libgudev" ,libgudev)
1790 ("libmpeg2" ,libmpeg2)
1791 ("libnotify" ,libnotify)
1792 ("libogg" ,libogg)
1793 ("libsamplerate" ,libsamplerate)
1794 ("libtheora" ,libtheora)
1795 ("libvorbis" ,libvorbis)
1796 ("libvpx" ,libvpx)
1797 ("libxml2" ,libxml2)
1798 ("libx264" ,libx264)
1799 ("x265" ,x265)
1800 ("zlib" ,zlib)))
1801 (arguments
1802 `(#:tests? #f ;tests require Ruby and claim to be unsupported
1803 #:phases
1804 (modify-phases %standard-phases
1805 (add-before 'patch-source-shebangs 'bootstrap-gtk
1806 ;; Run bootstrap ahead of time so that shebangs get patched.
1807 (lambda _
1808 (setenv "CONFIG_SHELL" (which "sh"))
1809 (setenv "NOCONFIGURE" "1")
1810 ;; Patch the Makefile so that it doesn't bootstrap again.
1811 (substitute* "gtk/module.rules"
1812 ((".*autogen\\.sh.*") ""))
1813 (zero? (system* "sh" "./gtk/autogen.sh"))))
1814 (add-before 'configure 'disable-contrib
1815 (lambda _
1816 (substitute* "make/include/main.defs"
1817 ;; Disable unconditional inclusion of some "contrib"
1818 ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
1819 ;; and libbluray), which would lead to fetching and
1820 ;; building of these libraries. Use our own instead.
1821 (("MODULES \\+= contrib") "# MODULES += contrib"))
1822 #t))
1823 (add-before 'configure 'fix-x265-linking
1824 (lambda _
1825 (substitute* "test/module.defs"
1826 ;; Fix missing library during linking error
1827 (("TEST.GCC.l =") "TEST.GCC.l = x265"))
1828 #t))
1829 (replace 'configure
1830 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1831 ;; 'configure' is not an autoconf-generated script, and
1832 ;; errors on unrecognized arguments,
1833 ;; e.g. --enable-fast-install
1834 (let ((out (assoc-ref outputs "out")))
1835 (zero? (apply system* "./configure"
1836 (string-append "--prefix=" out)
1837 (or configure-flags '()))))))
1838 (add-after 'configure 'chdir-build
1839 (lambda _ (chdir "./build") #t)))))
1840 (home-page "https://handbrake.fr")
1841 (synopsis "Video transcoder")
1842 (description
1843 "HandBrake is a tool for converting video from any format to a selection
1844 of modern, widely supported codecs.")
1845 ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
1846 (license (list license:gpl2+ license:bsd-3))))
1847
1848 (define-public openh264
1849 (package
1850 (name "openh264")
1851 (version "1.6.0")
1852 (source (origin
1853 (method url-fetch)
1854 (uri (string-append "https://github.com/cisco/"
1855 name "/archive/v" version ".tar.gz"))
1856 (file-name (string-append name "-" version ".tar.gz"))
1857 (sha256
1858 (base32
1859 "1ix2fhk62i4q4kbnkl0gfk4x53vxqavsn0pck1pashr566zhglv5"))))
1860 (build-system gnu-build-system)
1861 (native-inputs
1862 `(("nasm" ,nasm)
1863 ("python" ,python)))
1864 (arguments
1865 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1866 #:test-target "test"
1867 #:phases (modify-phases %standard-phases
1868 ;; no configure script
1869 (delete 'configure))))
1870 (home-page "http://www.openh264.org/")
1871 (synopsis "H264 decoder library")
1872 (description
1873 "Openh264 is a library which can decode H264 video streams.")
1874 (license license:bsd-2)))
1875
1876 (define-public libmp4v2
1877 (package
1878 (name "libmp4v2")
1879 (version "2.0.0")
1880 (source
1881 (origin
1882 (method url-fetch)
1883 ;; XXX: The new location of upstream is uncertain and will become relevant the
1884 ;; moment when the googlecode archive shuts down. It is past the date it
1885 ;; should've been turned off. I tried to communicate with upstream, but this
1886 ;; wasn't very responsive and not very helpful. The short summary is, it is
1887 ;; chaos when it comes to the amount of forks and only time will tell where
1888 ;; the new upstream location is.
1889 (uri (string-append "https://storage.googleapis.com/google-"
1890 "code-archive-downloads/v2/"
1891 "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
1892 (file-name (string-append name "-" version ".tar.bz2"))
1893 (sha256
1894 (base32
1895 "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
1896 (build-system gnu-build-system)
1897 (outputs '("out"
1898 "static")) ; 3.7MiB .a file
1899 (arguments
1900 `(#:phases
1901 (modify-phases %standard-phases
1902 (add-after 'unpack 'remove-dates
1903 (lambda _
1904 ;; Make the build reproducible.
1905 (substitute* "configure"
1906 (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
1907 (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
1908 #t))
1909 (add-after 'install 'move-static-libraries
1910 (lambda* (#:key outputs #:allow-other-keys)
1911 ;; Move static libraries to the "static" output.
1912 (let* ((out (assoc-ref outputs "out"))
1913 (lib (string-append out "/lib"))
1914 (static (assoc-ref outputs "static"))
1915 (slib (string-append static "/lib")))
1916 (mkdir-p slib)
1917 (for-each (lambda (file)
1918 (install-file file slib)
1919 (delete-file file))
1920 (find-files lib "\\.a$"))
1921 #t))))))
1922 (native-inputs
1923 `(("help2man" ,help2man)
1924 ("dejagnu" ,dejagnu)))
1925 (home-page "https://code.google.com/archive/p/mp4v2/")
1926 (synopsis "API to create and modify mp4 files")
1927 (description
1928 "The MP4v2 library provides an API to create and modify mp4 files as defined by
1929 ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
1930 file format that has been used as a multimedia file format in a variety of platforms and
1931 applications. It is a very powerful and extensible format that can accommodate
1932 practically any type of media.")
1933 (license license:mpl1.1)))