1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages video)
22 #:use-module (ice-9 match)
23 #:use-module ((guix licenses)
24 #:select (gpl2 gpl2+ bsd-3 public-domain))
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages avahi)
31 #:use-module (gnu packages cdrom)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages zip)
34 #:use-module (gnu packages elf)
35 #:use-module (gnu packages fontutils)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gnupg)
39 #:use-module (gnu packages gnutls)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages lua)
43 #:use-module (gnu packages mp3)
44 #:use-module (gnu packages openssl)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages pulseaudio)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages sdl)
51 #:use-module (gnu packages ssh)
52 #:use-module (gnu packages version-control)
53 #:use-module (gnu packages xiph)
54 #:use-module (gnu packages xml)
55 #:use-module (gnu packages xorg)
56 #:use-module (gnu packages yasm))
64 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
68 "06j1cgw9h9ya5z8gpcf9v9zik3l4xz7sr4wshj06kznzz5z3sf4x"))))
69 (build-system gnu-build-system)
71 `(("fontconfig" ,fontconfig)
72 ("freetype" ,freetype)
74 ("libtheora" ,libtheora)
75 ("libvorbis" ,libvorbis)
77 ("patchelf" ,patchelf)
84 ("pkg-config" ,pkg-config)
85 ("python" ,python-2) ; scripts use interpreter python2
89 `(#:test-target "fate"
90 #:modules ((guix build gnu-build-system)
94 #:imported-modules ((guix build gnu-build-system)
100 ;; configure does not work followed by "SHELL=..." and
101 ;; "CONFIG_SHELL=..."; set environment variables instead
102 (lambda* (#:key outputs configure-flags #:allow-other-keys)
103 (let ((out (assoc-ref outputs "out")))
104 (substitute* "configure"
105 (("#! /bin/sh") (string-append "#!" (which "bash"))))
106 (setenv "SHELL" (which "bash"))
107 (setenv "CONFIG_SHELL" (which "bash"))
108 ;; possible additional inputs:
109 ;; --enable-avisynth enable reading of AviSynth script files [no]
110 ;; --enable-frei0r enable frei0r video filtering
111 ;; --enable-ladspa enable LADSPA audio filtering
112 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
113 ;; --enable-libass enable libass subtitles rendering [no]
114 ;; --enable-libbluray enable BluRay reading using libbluray [no]
115 ;; --enable-libcaca enable textual display using libcaca
116 ;; --enable-libcelt enable CELT decoding via libcelt [no]
117 ;; --enable-libcdio enable audio CD grabbing with libcdio
118 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
119 ;; and libraw1394 [no]
120 ;; --enable-libfaac enable AAC encoding via libfaac [no]
121 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
122 ;; --enable-libflite enable flite (voice synthesis) support via libflite [no]
123 ;; --enable-libgme enable Game Music Emu via libgme [no]
124 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
125 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
126 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
127 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
128 ;; --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
129 ;; --enable-libnut enable NUT (de)muxing via libnut,
130 ;; native (de)muxer exists [no]
131 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
132 ;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
133 ;; --enable-libopencv enable video filtering via libopencv [no]
134 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
135 ;; --enable-libpulse enable Pulseaudio input via libpulse [no]
136 ;; --enable-libquvi enable quvi input via libquvi [no]
137 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
138 ;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
139 ;; --enable-libshine enable fixed-point MP3 encoding via libshine [no]
140 ;; --enable-libsoxr enable Include libsoxr resampling [no]
141 ;; --enable-libssh enable SFTP protocol via libssh [no]
142 ;; (libssh2 does not work)
143 ;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
144 ;; --enable-libtwolame enable MP2 encoding via libtwolame [no]
145 ;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
146 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
147 ;; --enable-libvidstab enable video stabilization using vid.stab [no]
148 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
149 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
150 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
151 ;; --enable-libx264 enable H.264 encoding via x264 [no]
152 ;; --enable-libxavs enable AVS encoding via xavs [no]
153 ;; --enable-libxvid enable Xvid encoding via xvidcore,
154 ;; native MPEG-4/Xvid encoder exists [no]
155 ;; --enable-libzmq enable message passing via libzmq [no]
156 ;; --enable-libzvbi enable teletext support via libzvbi [no]
157 ;; --enable-openal enable OpenAL 1.1 capture support [no]
158 ;; --enable-opencl enable OpenCL code
159 ;; --enable-x11grab enable X11 grabbing [no]
162 (string-append "--prefix=" out)
163 "--enable-gpl" ; enable optional gpl licensed parts
165 "--enable-fontconfig"
166 ;; "--enable-gnutls" ; causes test failures
167 "--enable-libfreetype"
174 "--enable-runtime-cpudetect"
176 ;; Runtime cpu detection is not implemented on
177 ;; MIPS, so we disable some features.
179 "--disable-mipsdspr1"
180 "--disable-mipsdspr2"
181 "--disable-mipsfpu"))))
183 'strip 'add-lib-to-runpath
184 (lambda* (#:key outputs #:allow-other-keys)
185 (let* ((out (assoc-ref outputs "out"))
186 (lib (string-append out "/lib")))
187 ;; Add LIB to the RUNPATH of all the executables and libraries.
188 (with-directory-excursion out
189 (for-each (cut augment-rpath <> lib)
190 (append (find-files "bin" ".*")
191 (find-files "lib" "\\.so\\..*\\."))))))
193 (home-page "http://www.ffmpeg.org/")
194 (synopsis "Audio and video framework")
195 (description "FFmpeg is a complete, cross-platform solution to record,
196 convert and stream audio and video. It includes the libavcodec
197 audio/video codec library.")
200 ;; We need this older ffmpeg because vlc-2.1.5 doesn't work with ffmpeg-2.4.
201 (define-public ffmpeg-2.2
202 (package (inherit ffmpeg)
206 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
210 "06sli7xvihh97ss6a2mkdq4dcj3rg1w8zffrmjfc1hvyjxhc8f2r"))))))
219 "http://download.videolan.org/pub/videolan/vlc/"
220 version "/vlc-" version ".tar.xz"))
223 "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg"))))
224 (build-system gnu-build-system)
226 `(("git" ,git) ; needed for a test
227 ("pkg-config" ,pkg-config)))
228 ;; FIXME: Add optional inputs once available.
230 `(("alsa-lib" ,alsa-lib)
234 ("ffmpeg" ,ffmpeg-2.2) ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4
235 ("fontconfig" ,fontconfig)
236 ("freetype" ,freetype)
239 ("libgcrypt" ,libgcrypt)
244 ("libsamplerate" ,libsamplerate)
246 ("libvorbis" ,libvorbis)
247 ("libtheora" ,libtheora)
249 ("libxinerama" ,libxinerama)
256 ("pulseaudio" ,pulseaudio)
257 ("python" ,python-wrapper)
260 ("sdl-image" ,sdl-image)
262 ("xcb-util-keysyms" ,xcb-util-keysyms)))
265 `("--disable-a52" ; FIXME: reenable once available
266 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
267 (assoc-ref %build-inputs "ffmpeg")
268 "/lib")))) ; needed for the tests
269 (home-page "https://www.videolan.org/")
270 (synopsis "Audio and video framework")
271 (description "VLC is a cross-platform multimedia player and framework
272 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
273 treaming protocols.")
276 (define-public mplayer
283 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
287 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
288 (build-system gnu-build-system)
289 ;; FIXME: Add additional inputs once available.
291 `(("pkg-config" ,pkg-config)))
293 `(("alsa-lib" ,alsa-lib)
294 ("cdparanoia" ,cdparanoia)
295 ("fontconfig" ,fontconfig)
296 ("freetype" ,freetype)
298 ("libmpg123" ,mpg123) ; audio codec for MP3
299 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
302 ("libtheora" ,libtheora)
303 ("libvorbis" ,libvorbis)
305 ("libxxf86dga" ,libxxf86dga)
306 ("libxinerama" ,libxinerama)
310 ("pulseaudio" ,pulseaudio)
311 ("python" ,python-wrapper)
317 `(#:tests? #f ; no test target
321 ;; configure does not work followed by "SHELL=..." and
322 ;; "CONFIG_SHELL=..."; set environment variables instead
323 (lambda* (#:key inputs outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out"))
325 (libx11 (assoc-ref inputs "libx11")))
326 (substitute* "configure"
327 (("#! /bin/sh") (string-append "#!" (which "bash"))))
328 (setenv "SHELL" (which "bash"))
329 (setenv "CONFIG_SHELL" (which "bash"))
332 (string-append "--extra-cflags=-I"
333 libx11 "/include") ; to detect libx11
334 "--disable-tremor-internal" ; forces external libvorbis
335 (string-append "--prefix=" out)
336 ;; Enable runtime cpu detection where supported,
337 ;; and choose a suitable target.
338 ,@(match (or (%current-target-system)
341 '("--enable-runtime-cpudetection"
342 "--target=x86_64-linux"))
344 '("--enable-runtime-cpudetection"
345 "--target=i686-linux"))
347 '("--target=mips3-linux")))
354 "--disable-iwmmxt"))))
356 (home-page "http://www.mplayerhq.hu/design7/news.html")
357 (synopsis "Audio and video player")
358 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
359 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
360 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
361 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
364 (define-public libvpx
370 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
374 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
375 (build-system gnu-build-system)
377 '(#:phases (alist-replace
379 (lambda* (#:key outputs #:allow-other-keys)
380 (setenv "CONFIG_SHELL" (which "bash"))
381 (let ((out (assoc-ref outputs "out")))
382 (zero? (system* "./configure"
385 (string-append "--prefix=" out)))))
387 #:tests? #f)) ; no check target
391 (synopsis "VP8/VP9 video codec")
392 (description "libvpx is a codec for the VP8/VP9 video compression format.")
394 (home-page "http://www.webmproject.org/")))
396 (define-public youtube-dl
399 (version "2015.01.23.4")
402 (uri (string-append "http://youtube-dl.org/downloads/"
403 version "/youtube-dl-"
407 "0pvvab9dk1righ3fa79000iz8fzdlcxakscx5sd31730c37j3kj2"))))
408 (build-system python-build-system)
409 (inputs `(("setuptools" ,python-setuptools)))
410 (home-page "http://youtube-dl.org")
411 (synopsis "Download videos from YouTube.com and other sites")
413 "youtube-dl is a small command-line program to download videos from
414 YouTube.com and a few more sites.")
415 (license public-domain)))
417 (define-public libdvdread
423 (uri (string-append "http://download.videolan.org/videolan/"
425 name "-" version ".tar.bz2"))
428 "052z62l3x8ka5jpf5bi1mzp5p323n1z9rxj74nq5c35a88x1myv6"))))
429 (build-system gnu-build-system)
430 (home-page "http://dvdnav.mplayerhq.hu/")
431 (synopsis "Library for reading video DVDs")
433 "Libdvdread provides a simple foundation for reading DVD video
434 disks. It provides the functionality that is required to access many
435 DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
436 authentication and descrambling (if an external libdvdcss library is
440 (define-public libdvdnav
446 (uri (string-append "http://download.videolan.org/videolan/"
448 name "-" version ".tar.bz2"))
451 "1ad2lkkiydgwiyqfysra9lkwjv9yqnvcg4hv92hx8qzics1cpcbj"))))
452 (build-system gnu-build-system)
454 `(("pkg-config" ,pkg-config)))
456 `(("libdvdread" ,libdvdread)))
457 (home-page "http://dvdnav.mplayerhq.hu/")
458 (synopsis "Library for video DVD navigation features")
460 "Libdvdnav is a library for developers of multimedia
461 applications. It allows easy use of sophisticated DVD navigation features
462 such as DVD menus, multiangle playback and even interactive DVD games. All
463 this functionality is provided through a simple API which provides the DVD
464 playback as a single logical stream of blocks, intermitted by special
465 dvdnav events to report certain conditions. The main usage of libdvdnav is
466 a loop regularly calling a function to get the next block, surrounded by
467 additional calls to tell the library of user interaction. The whole
468 DVD virtual machine and internal playback states are completely