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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages video)
21 #:use-module ((guix licenses)
22 #:select (gpl2 gpl2+ bsd-3 public-domain))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages algebra)
28 #:use-module (gnu packages avahi)
29 #:use-module (gnu packages cdrom)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages zip)
32 #:use-module (gnu packages elf)
33 #:use-module (gnu packages fontutils)
34 #:use-module (gnu packages gl)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnupg)
37 #:use-module (gnu packages gnutls)
38 #:use-module (gnu packages image)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages lua)
41 #:use-module (gnu packages mp3)
42 #:use-module (gnu packages openssl)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages pulseaudio)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages qt)
48 #:use-module (gnu packages sdl)
49 #:use-module (gnu packages ssh)
50 #:use-module (gnu packages version-control)
51 #:use-module (gnu packages xiph)
52 #:use-module (gnu packages xml)
53 #:use-module (gnu packages xorg)
54 #:use-module (gnu packages yasm))
62 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
66 "17l0bx95al6cjhz3pzfcbwg07sbfbwqbxg34zl5lhl89w9jbngbb"))))
67 (build-system gnu-build-system)
69 `(("fontconfig" ,fontconfig)
70 ("freetype" ,freetype)
72 ("libtheora" ,libtheora)
73 ("libvorbis" ,libvorbis)
75 ("patchelf" ,patchelf)
82 ("pkg-config" ,pkg-config)
83 ("python" ,python-2) ; scripts use interpreter python2
87 `(#:test-target "fate"
88 #:modules ((guix build gnu-build-system)
92 #:imported-modules ((guix build gnu-build-system)
98 ;; configure does not work followed by "SHELL=..." and
99 ;; "CONFIG_SHELL=..."; set environment variables instead
100 (lambda* (#:key outputs configure-flags #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out")))
102 (substitute* "configure"
103 (("#! /bin/sh") (string-append "#!" (which "bash"))))
104 (setenv "SHELL" (which "bash"))
105 (setenv "CONFIG_SHELL" (which "bash"))
106 ;; possible additional inputs:
107 ;; --enable-avisynth enable reading of AviSynth script files [no]
108 ;; --enable-frei0r enable frei0r video filtering
109 ;; --enable-ladspa enable LADSPA audio filtering
110 ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
111 ;; --enable-libass enable libass subtitles rendering [no]
112 ;; --enable-libbluray enable BluRay reading using libbluray [no]
113 ;; --enable-libcaca enable textual display using libcaca
114 ;; --enable-libcelt enable CELT decoding via libcelt [no]
115 ;; --enable-libcdio enable audio CD grabbing with libcdio
116 ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
117 ;; and libraw1394 [no]
118 ;; --enable-libfaac enable AAC encoding via libfaac [no]
119 ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
120 ;; --enable-libflite enable flite (voice synthesis) support via libflite [no]
121 ;; --enable-libgme enable Game Music Emu via libgme [no]
122 ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
123 ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
124 ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
125 ;; --enable-libmodplug enable ModPlug via libmodplug [no]
126 ;; --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
127 ;; --enable-libnut enable NUT (de)muxing via libnut,
128 ;; native (de)muxer exists [no]
129 ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
130 ;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
131 ;; --enable-libopencv enable video filtering via libopencv [no]
132 ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
133 ;; --enable-libpulse enable Pulseaudio input via libpulse [no]
134 ;; --enable-libquvi enable quvi input via libquvi [no]
135 ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
136 ;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
137 ;; --enable-libshine enable fixed-point MP3 encoding via libshine [no]
138 ;; --enable-libsoxr enable Include libsoxr resampling [no]
139 ;; --enable-libssh enable SFTP protocol via libssh [no]
140 ;; (libssh2 does not work)
141 ;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
142 ;; --enable-libtwolame enable MP2 encoding via libtwolame [no]
143 ;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
144 ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
145 ;; --enable-libvidstab enable video stabilization using vid.stab [no]
146 ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
147 ;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
148 ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
149 ;; --enable-libx264 enable H.264 encoding via x264 [no]
150 ;; --enable-libxavs enable AVS encoding via xavs [no]
151 ;; --enable-libxvid enable Xvid encoding via xvidcore,
152 ;; native MPEG-4/Xvid encoder exists [no]
153 ;; --enable-libzmq enable message passing via libzmq [no]
154 ;; --enable-libzvbi enable teletext support via libzvbi [no]
155 ;; --enable-openal enable OpenAL 1.1 capture support [no]
156 ;; --enable-opencl enable OpenCL code
157 ;; --enable-x11grab enable X11 grabbing [no]
160 (string-append "--prefix=" out)
161 "--enable-gpl" ; enable optional gpl licensed parts
163 "--enable-fontconfig"
164 ;; "--enable-gnutls" ; causes test failures
165 "--enable-libfreetype"
171 ;; drop special machine instructions not supported
172 ;; on all instances of the target
173 ,@(if (string-prefix? "x86_64"
174 (or (%current-target-system)
177 '("--disable-amd3dnow"
178 "--disable-amd3dnowext"
197 "--disable-mipsdspr1"
198 "--disable-mipsdspr2"
199 "--disable-mipsfpu"))))
201 'strip 'add-lib-to-runpath
202 (lambda* (#:key outputs #:allow-other-keys)
203 (let* ((out (assoc-ref outputs "out"))
204 (lib (string-append out "/lib")))
205 ;; Add LIB to the RUNPATH of all the executables.
206 (with-directory-excursion out
207 (for-each (cut augment-rpath <> lib)
208 (find-files "bin" ".*")))))
210 (home-page "http://www.ffmpeg.org/")
211 (synopsis "Audio and video framework")
212 (description "FFmpeg is a complete, cross-platform solution to record,
213 convert and stream audio and video. It includes the libavcodec
214 audio/video codec library.")
224 "http://download.videolan.org/pub/videolan/vlc/"
225 version "/vlc-" version ".tar.xz"))
228 "1lymhbb2bns73qivdaqanhggjjhyc9fwfgf5ikhng0a74msnqmiy"))))
229 (build-system gnu-build-system)
231 `(("git" ,git) ; needed for a test
232 ("pkg-config" ,pkg-config)))
233 ;; FIXME: Add optional inputs once available.
235 `(("alsa-lib" ,alsa-lib)
240 ("fontconfig" ,fontconfig)
241 ("freetype" ,freetype)
244 ("libgcrypt" ,libgcrypt)
249 ("libsamplerate" ,libsamplerate)
251 ("libvorbis" ,libvorbis)
252 ("libtheora" ,libtheora)
254 ("libxinerama" ,libxinerama)
261 ("pulseaudio" ,pulseaudio)
262 ("python" ,python-wrapper)
265 ("sdl-image" ,sdl-image)
267 ("xcb-util-keysyms" ,xcb-util-keysyms)))
270 `("--disable-a52" ; FIXME: reenable once available
271 "--disable-mmx" ; FIXME: may be enabled on x86_64
272 "--disable-sse" ; 1-4, no separate options available
275 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
276 (assoc-ref %build-inputs "ffmpeg")
277 "/lib")))) ; needed for the tests
278 (home-page "https://www.videolan.org/")
279 (synopsis "Audio and video framework")
280 (description "VLC is a cross-platform multimedia player and framework
281 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
282 treaming protocols.")
285 (define-public mplayer
292 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
296 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
297 (build-system gnu-build-system)
298 ;; FIXME: Add additional inputs once available.
300 `(("pkg-config" ,pkg-config)))
302 `(("alsa-lib" ,alsa-lib)
303 ("cdparanoia" ,cdparanoia)
304 ("fontconfig" ,fontconfig)
305 ("freetype" ,freetype)
307 ("libmpg123" ,mpg123) ; audio codec for MP3
308 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
311 ("libtheora" ,libtheora)
312 ("libvorbis" ,libvorbis)
314 ("libxxf86dga" ,libxxf86dga)
315 ("libxinerama" ,libxinerama)
319 ("pulseaudio" ,pulseaudio)
320 ("python" ,python-wrapper)
326 `(#:tests? #f ; no test target
330 ;; configure does not work followed by "SHELL=..." and
331 ;; "CONFIG_SHELL=..."; set environment variables instead
332 (lambda* (#:key inputs outputs #:allow-other-keys)
333 (let ((out (assoc-ref outputs "out"))
334 (libx11 (assoc-ref inputs "libx11")))
335 (substitute* "configure"
336 (("#! /bin/sh") (string-append "#!" (which "bash"))))
337 (setenv "SHELL" (which "bash"))
338 (setenv "CONFIG_SHELL" (which "bash"))
341 (string-append "--extra-cflags=-I"
342 libx11 "/include") ; to detect libx11
343 "--disable-tremor-internal" ; forces external libvorbis
344 (string-append "--prefix=" out)
345 ;; drop special machine instructions not supported
346 ;; on all instances of the target
347 ,@(if (string-prefix? "x86_64"
348 (or (%current-target-system)
365 "--disable-iwmmxt"))))
367 (home-page "http://www.mplayerhq.hu/design7/news.html")
368 (synopsis "Audio and video player")
369 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
370 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
371 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
372 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
375 (define-public libvpx
381 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
385 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
386 (build-system gnu-build-system)
388 '(#:phases (alist-replace
390 (lambda* (#:key outputs #:allow-other-keys)
391 (setenv "CONFIG_SHELL" (which "bash"))
392 (let ((out (assoc-ref outputs "out")))
393 (zero? (system* "./configure"
396 (string-append "--prefix=" out)))))
398 #:tests? #f)) ; no check target
402 (synopsis "VP8/VP9 video codec")
403 (description "libvpx is a codec for the VP8/VP9 video compression format.")
405 (home-page "http://www.webmproject.org/")))
407 (define-public youtube-dl
410 (version "2014.06.26")
413 (uri (string-append "http://youtube-dl.org/downloads/"
414 version "/youtube-dl-"
418 "0jl90plg9mz4mwich219a58y4npwi33myx0cx44v8pymkqykv5cd"))))
419 (build-system python-build-system)
420 (inputs `(("setuptools" ,python-setuptools)))
421 (home-page "http://youtube-dl.org")
422 (synopsis "Download videos from YouTube.com and other sites")
424 "youtube-dl is a small command-line program to download videos from
425 YouTube.com and a few more sites.")
426 (license public-domain)))