gnu: docbook-xsl update to 1.78.1
[jackhill/guix/guix.git] / gnu / packages / video.scm
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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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.
11 ;;;
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.
16 ;;;
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/>.
19
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))
55
56 (define-public ffmpeg
57 (package
58 (name "ffmpeg")
59 (version "2.2.1")
60 (source (origin
61 (method url-fetch)
62 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
63 version ".tar.bz2"))
64 (sha256
65 (base32
66 "153kfk8rzrfxx930rrk417b2m695dvy47v4hci3nd49iggx9jzz1"))))
67 (build-system gnu-build-system)
68 (inputs
69 `(("fontconfig" ,fontconfig)
70 ("freetype" ,freetype)
71 ("opus" ,opus)
72 ("libtheora" ,libtheora)
73 ("libvorbis" ,libvorbis)
74 ("libvpx" ,libvpx)
75 ("patchelf" ,patchelf)
76 ("speex" ,speex)
77 ("zlib", zlib)))
78 (native-inputs
79 `(("bc" ,bc)
80 ("bzip2" ,bzip2)
81 ("perl" ,perl)
82 ("pkg-config" ,pkg-config)
83 ("python" ,python-2) ; scripts use interpreter python2
84 ("speex" ,speex)
85 ("yasm" ,yasm)))
86 (arguments
87 `(#:test-target "fate"
88 #:modules ((guix build gnu-build-system)
89 (guix build utils)
90 (guix build rpath)
91 (srfi srfi-26))
92 #:imported-modules ((guix build gnu-build-system)
93 (guix build utils)
94 (guix build rpath))
95 #:phases
96 (alist-replace
97 'configure
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]
158 (zero? (system*
159 "./configure"
160 (string-append "--prefix=" out)
161 "--enable-gpl" ; enable optional gpl licensed parts
162 "--enable-shared"
163 "--enable-fontconfig"
164 ;; "--enable-gnutls" ; causes test failures
165 "--enable-libfreetype"
166 "--enable-libopus"
167 "--enable-libspeex"
168 "--enable-libtheora"
169 "--enable-libvorbis"
170 "--enable-libvpx"
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)
175 (%current-system)))
176 '()
177 '("--disable-amd3dnow"
178 "--disable-amd3dnowext"
179 "--disable-mmx"
180 "--disable-mmxext"
181 "--disable-sse"
182 "--disable-sse2"))
183 "--disable-altivec"
184 "--disable-sse3"
185 "--disable-ssse3"
186 "--disable-sse4"
187 "--disable-sse42"
188 "--disable-avx"
189 "--disable-fma4"
190 "--disable-avx2"
191 "--disable-armv5te"
192 "--disable-armv6"
193 "--disable-armv6t2"
194 "--disable-vfp"
195 "--disable-neon"
196 "--disable-vis"
197 "--disable-mips32r2"
198 "--disable-mipsdspr1"
199 "--disable-mipsdspr2"
200 "--disable-mipsfpu"))))
201 (alist-cons-after
202 'strip 'add-lib-to-runpath
203 (lambda* (#:key outputs #:allow-other-keys)
204 (let* ((out (assoc-ref outputs "out"))
205 (lib (string-append out "/lib")))
206 ;; Add LIB to the RUNPATH of all the executables.
207 (with-directory-excursion out
208 (for-each (cut augment-rpath <> lib)
209 (find-files "bin" ".*")))))
210 %standard-phases))))
211 (home-page "http://www.ffmpeg.org/")
212 (synopsis "Audio and video framework")
213 (description "FFmpeg is a complete, cross-platform solution to record,
214 convert and stream audio and video. It includes the libavcodec
215 audio/video codec library.")
216 (license gpl2+)))
217
218 (define-public vlc
219 (package
220 (name "vlc")
221 (version "2.1.4")
222 (source (origin
223 (method url-fetch)
224 (uri (string-append
225 "http://download.videolan.org/pub/videolan/vlc/"
226 version "/vlc-" version ".tar.xz"))
227 (sha256
228 (base32
229 "1lymhbb2bns73qivdaqanhggjjhyc9fwfgf5ikhng0a74msnqmiy"))))
230 (build-system gnu-build-system)
231 (native-inputs
232 `(("git" ,git) ; needed for a test
233 ("pkg-config" ,pkg-config)))
234 ;; FIXME: Add optional inputs once available.
235 (inputs
236 `(("alsa-lib" ,alsa-lib)
237 ("avahi" ,avahi)
238 ("dbus" ,dbus)
239 ("flac" ,flac)
240 ("ffmpeg" ,ffmpeg)
241 ("fontconfig" ,fontconfig)
242 ("freetype" ,freetype)
243 ("gnutls" ,gnutls)
244 ("libcddb" ,libcddb)
245 ("libgcrypt" ,libgcrypt)
246 ("libkate" ,libkate)
247 ("libmad" ,libmad)
248 ("libogg" ,libogg)
249 ("libpng" ,libpng)
250 ("libsamplerate" ,libsamplerate)
251 ("libssh2" ,libssh2)
252 ("libvorbis" ,libvorbis)
253 ("libtheora" ,libtheora)
254 ("libxext" ,libxext)
255 ("libxinerama" ,libxinerama)
256 ("libxml2" ,libxml2)
257 ("libxpm" ,libxpm)
258 ("lua" ,lua-5.1)
259 ("mesa" ,mesa)
260 ("opus" ,opus)
261 ("perl" ,perl)
262 ("pulseaudio" ,pulseaudio)
263 ("python" ,python-wrapper)
264 ("qt" ,qt-4)
265 ("sdl" ,sdl)
266 ("sdl-image" ,sdl-image)
267 ("speex" ,speex)
268 ("xcb-util-keysyms" ,xcb-util-keysyms)))
269 (arguments
270 `(#:configure-flags
271 `("--disable-a52" ; FIXME: reenable once available
272 "--disable-mmx" ; FIXME: may be enabled on x86_64
273 "--disable-sse" ; 1-4, no separate options available
274 "--disable-neon"
275 "--disable-altivec"
276 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
277 (assoc-ref %build-inputs "ffmpeg")
278 "/lib")))) ; needed for the tests
279 (home-page "https://www.videolan.org/")
280 (synopsis "Audio and video framework")
281 (description "VLC is a cross-platform multimedia player and framework
282 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
283 treaming protocols.")
284 (license gpl2+)))
285
286 (define-public mplayer
287 (package
288 (name "mplayer")
289 (version "1.1.1")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append
293 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
294 version ".tar.xz"))
295 (sha256
296 (base32
297 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
298 (build-system gnu-build-system)
299 ;; FIXME: Add additional inputs once available.
300 (native-inputs
301 `(("pkg-config" ,pkg-config)))
302 (inputs
303 `(("alsa-lib" ,alsa-lib)
304 ("cdparanoia" ,cdparanoia)
305 ("fontconfig" ,fontconfig)
306 ("freetype" ,freetype)
307 ("lame" ,lame)
308 ("libmpg123" ,mpg123) ; audio codec for MP3
309 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
310 ("libjpeg" ,libjpeg)
311 ("libpng" ,libpng)
312 ("libtheora" ,libtheora)
313 ("libvorbis" ,libvorbis)
314 ("libx11" ,libx11)
315 ("libxxf86dga" ,libxxf86dga)
316 ("libxinerama" ,libxinerama)
317 ("libxv" ,libxv)
318 ("mesa" ,mesa)
319 ("perl" ,perl)
320 ("pulseaudio" ,pulseaudio)
321 ("python" ,python-wrapper)
322 ("sdl" ,sdl)
323 ("speex" ,speex)
324 ("yasm" ,yasm)
325 ("zlib" ,zlib)))
326 (arguments
327 `(#:tests? #f ; no test target
328 #:phases
329 (alist-replace
330 'configure
331 ;; configure does not work followed by "SHELL=..." and
332 ;; "CONFIG_SHELL=..."; set environment variables instead
333 (lambda* (#:key inputs outputs #:allow-other-keys)
334 (let ((out (assoc-ref outputs "out"))
335 (libx11 (assoc-ref inputs "libx11")))
336 (substitute* "configure"
337 (("#! /bin/sh") (string-append "#!" (which "bash"))))
338 (setenv "SHELL" (which "bash"))
339 (setenv "CONFIG_SHELL" (which "bash"))
340 (zero? (system*
341 "./configure"
342 (string-append "--extra-cflags=-I"
343 libx11 "/include") ; to detect libx11
344 "--disable-tremor-internal" ; forces external libvorbis
345 (string-append "--prefix=" out)
346 ;; drop special machine instructions not supported
347 ;; on all instances of the target
348 ,@(if (string-prefix? "x86_64"
349 (or (%current-target-system)
350 (%current-system)))
351 '()
352 '("--disable-3dnow"
353 "--disable-3dnowext"
354 "--disable-mmx"
355 "--disable-mmxext"
356 "--disable-sse"
357 "--disable-sse2"))
358 "--disable-ssse3"
359 "--disable-altivec"
360 "--disable-armv5te"
361 "--disable-armv6"
362 "--disable-armv6t2"
363 "--disable-armvfp"
364 "--disable-neon"
365 "--disable-thumb"
366 "--disable-iwmmxt"))))
367 %standard-phases)))
368 (home-page "http://www.mplayerhq.hu/design7/news.html")
369 (synopsis "Audio and video player")
370 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
371 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
372 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
373 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
374 (license gpl2)))
375
376 (define-public libvpx
377 (package
378 (name "libvpx")
379 (version "1.3.0")
380 (source (origin
381 (method url-fetch)
382 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
383 version ".tar.bz2"))
384 (sha256
385 (base32
386 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
387 (build-system gnu-build-system)
388 (arguments
389 '(#:phases (alist-replace
390 'configure
391 (lambda* (#:key outputs #:allow-other-keys)
392 (setenv "CONFIG_SHELL" (which "bash"))
393 (let ((out (assoc-ref outputs "out")))
394 (zero? (system* "./configure"
395 "--enable-shared"
396 "--as=yasm"
397 (string-append "--prefix=" out)))))
398 %standard-phases)
399 #:tests? #f)) ; no check target
400 (native-inputs
401 `(("perl" ,perl)
402 ("yasm" ,yasm)))
403 (synopsis "VP8/VP9 video codec")
404 (description "libvpx is a codec for the VP8/VP9 video compression format.")
405 (license bsd-3)
406 (home-page "http://www.webmproject.org/")))
407
408 (define-public youtube-dl
409 (package
410 (name "youtube-dl")
411 (version "2014.06.26")
412 (source (origin
413 (method url-fetch)
414 (uri (string-append "http://youtube-dl.org/downloads/"
415 version "/youtube-dl-"
416 version ".tar.gz"))
417 (sha256
418 (base32
419 "0jl90plg9mz4mwich219a58y4npwi33myx0cx44v8pymkqykv5cd"))))
420 (build-system python-build-system)
421 (inputs `(("setuptools" ,python-setuptools)))
422 (home-page "http://youtube-dl.org")
423 (synopsis "Download videos from YouTube.com and other sites")
424 (description
425 "youtube-dl is a small command-line program to download videos from
426 YouTube.com and a few more sites.")
427 (license public-domain)))