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