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