doc: Write about file system configuration.
[jackhill/guix/guix.git] / gnu / packages / video.scm
CommitLineData
39efcc9b 1;;; GNU Guix --- Functional package management for GNU
93e48d19 2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
d0ed39be 3;;; Copyright © 2014 David Thompson <davet@gnu.org>
39efcc9b
AE
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)
d0ed39be 21 #:use-module ((guix licenses) #:select (gpl2 gpl2+ bsd-3))
39efcc9b
AE
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages algebra)
d5a748e8
AE
26 #:use-module (gnu packages avahi)
27 #:use-module (gnu packages cdrom)
39efcc9b 28 #:use-module (gnu packages compression)
f22e0e26 29 #:use-module (gnu packages elf)
39efcc9b 30 #:use-module (gnu packages fontutils)
d5a748e8
AE
31 #:use-module (gnu packages gl)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages gnutls)
e55354b8 35 #:use-module (gnu packages image)
d5a748e8
AE
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages lua)
38 #:use-module (gnu packages mp3)
39efcc9b
AE
39 #:use-module (gnu packages openssl)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
d5a748e8 42 #:use-module (gnu packages pulseaudio)
39efcc9b 43 #:use-module (gnu packages python)
d5a748e8
AE
44 #:use-module (gnu packages qt)
45 #:use-module (gnu packages sdl)
46 #:use-module (gnu packages ssh)
47 #:use-module (gnu packages version-control)
54ff0b7d 48 #:use-module (gnu packages xiph)
d5a748e8
AE
49 #:use-module (gnu packages xml)
50 #:use-module (gnu packages xorg)
39efcc9b
AE
51 #:use-module (gnu packages yasm))
52
53(define-public ffmpeg
54 (package
55 (name "ffmpeg")
772d6365 56 (version "2.2.1")
39efcc9b
AE
57 (source (origin
58 (method url-fetch)
59 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
60 version ".tar.bz2"))
61 (sha256
62 (base32
772d6365 63 "153kfk8rzrfxx930rrk417b2m695dvy47v4hci3nd49iggx9jzz1"))))
39efcc9b
AE
64 (build-system gnu-build-system)
65 (inputs
c4c4cc05 66 `(("fontconfig" ,fontconfig)
39efcc9b 67 ("freetype" ,freetype)
e816b348 68 ("opus" ,opus)
39efcc9b
AE
69 ("libtheora" ,libtheora)
70 ("libvorbis" ,libvorbis)
dc55b8b2 71 ("libvpx" ,libvpx)
f22e0e26 72 ("patchelf" ,patchelf)
c4c4cc05
JD
73 ("speex" ,speex)
74 ("zlib", zlib)))
75 (native-inputs
76 `(("bc" ,bc)
77 ("bzip2" ,bzip2)
39efcc9b
AE
78 ("perl" ,perl)
79 ("pkg-config" ,pkg-config)
80 ("python" ,python-2) ; scripts use interpreter python2
81 ("speex" ,speex)
c4c4cc05 82 ("yasm" ,yasm)))
39efcc9b 83 (arguments
31f9322e 84 `(#:test-target "fate"
f22e0e26
AE
85 #:modules ((guix build gnu-build-system)
86 (guix build utils)
87 (guix build rpath)
88 (srfi srfi-26))
89 #:imported-modules ((guix build gnu-build-system)
90 (guix build utils)
91 (guix build rpath))
31f9322e 92 #:phases
39efcc9b
AE
93 (alist-replace
94 'configure
95 ;; configure does not work followed by "SHELL=..." and
96 ;; "CONFIG_SHELL=..."; set environment variables instead
97 (lambda* (#:key outputs configure-flags #:allow-other-keys)
98 (let ((out (assoc-ref outputs "out")))
99 (substitute* "configure"
100 (("#! /bin/sh") (string-append "#!" (which "bash"))))
101 (setenv "SHELL" (which "bash"))
102 (setenv "CONFIG_SHELL" (which "bash"))
103;; possible additional inputs:
104;; --enable-avisynth enable reading of AviSynth script files [no]
105;; --enable-frei0r enable frei0r video filtering
106;; --enable-ladspa enable LADSPA audio filtering
107;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
108;; --enable-libass enable libass subtitles rendering [no]
109;; --enable-libbluray enable BluRay reading using libbluray [no]
110;; --enable-libcaca enable textual display using libcaca
111;; --enable-libcelt enable CELT decoding via libcelt [no]
112;; --enable-libcdio enable audio CD grabbing with libcdio
113;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
114;; and libraw1394 [no]
115;; --enable-libfaac enable AAC encoding via libfaac [no]
116;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
117;; --enable-libflite enable flite (voice synthesis) support via libflite [no]
118;; --enable-libgme enable Game Music Emu via libgme [no]
119;; --enable-libgsm enable GSM de/encoding via libgsm [no]
120;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
121;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
122;; --enable-libmodplug enable ModPlug via libmodplug [no]
123;; --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
124;; --enable-libnut enable NUT (de)muxing via libnut,
125;; native (de)muxer exists [no]
126;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
127;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
128;; --enable-libopencv enable video filtering via libopencv [no]
129;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
39efcc9b
AE
130;; --enable-libpulse enable Pulseaudio input via libpulse [no]
131;; --enable-libquvi enable quvi input via libquvi [no]
132;; --enable-librtmp enable RTMP[E] support via librtmp [no]
133;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
134;; --enable-libshine enable fixed-point MP3 encoding via libshine [no]
135;; --enable-libsoxr enable Include libsoxr resampling [no]
136;; --enable-libssh enable SFTP protocol via libssh [no]
137;; (libssh2 does not work)
138;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
139;; --enable-libtwolame enable MP2 encoding via libtwolame [no]
140;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
141;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
142;; --enable-libvidstab enable video stabilization using vid.stab [no]
143;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
144;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
39efcc9b
AE
145;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
146;; --enable-libx264 enable H.264 encoding via x264 [no]
147;; --enable-libxavs enable AVS encoding via xavs [no]
148;; --enable-libxvid enable Xvid encoding via xvidcore,
149;; native MPEG-4/Xvid encoder exists [no]
150;; --enable-libzmq enable message passing via libzmq [no]
151;; --enable-libzvbi enable teletext support via libzvbi [no]
152;; --enable-openal enable OpenAL 1.1 capture support [no]
153;; --enable-opencl enable OpenCL code
154;; --enable-x11grab enable X11 grabbing [no]
155 (zero? (system*
156 "./configure"
157 (string-append "--prefix=" out)
158 "--enable-gpl" ; enable optional gpl licensed parts
159 "--enable-shared"
160 "--enable-fontconfig"
161 ;; "--enable-gnutls" ; causes test failures
162 "--enable-libfreetype"
e816b348 163 "--enable-libopus"
39efcc9b
AE
164 "--enable-libspeex"
165 "--enable-libtheora"
166 "--enable-libvorbis"
dc55b8b2 167 "--enable-libvpx"
39efcc9b
AE
168 ;; drop special machine instructions not supported
169 ;; on all instances of the target
170 ,@(if (string-prefix? "x86_64"
171 (or (%current-target-system)
172 (%current-system)))
173 '()
798e4f42
AE
174 '("--disable-amd3dnow"
175 "--disable-amd3dnowext"
39efcc9b
AE
176 "--disable-mmx"
177 "--disable-mmxext"
178 "--disable-sse"
179 "--disable-sse2"))
180 "--disable-altivec"
181 "--disable-sse3"
182 "--disable-ssse3"
183 "--disable-sse4"
184 "--disable-sse42"
185 "--disable-avx"
186 "--disable-fma4"
187 "--disable-avx2"
188 "--disable-armv5te"
189 "--disable-armv6"
190 "--disable-armv6t2"
191 "--disable-vfp"
192 "--disable-neon"
193 "--disable-vis"
194 "--disable-mips32r2"
195 "--disable-mipsdspr1"
196 "--disable-mipsdspr2"
197 "--disable-mipsfpu"))))
f22e0e26
AE
198 (alist-cons-after
199 'strip 'add-lib-to-runpath
200 (lambda* (#:key outputs #:allow-other-keys)
201 (let* ((out (assoc-ref outputs "out"))
202 (lib (string-append out "/lib")))
203 ;; Add LIB to the RUNPATH of all the executables.
204 (with-directory-excursion out
205 (for-each (cut augment-rpath <> lib)
206 (find-files "bin" ".*")))))
207 %standard-phases))))
39efcc9b
AE
208 (home-page "http://www.ffmpeg.org/")
209 (synopsis "Audio and video framework")
210 (description "FFmpeg is a complete, cross-platform solution to record,
211convert and stream audio and video. It includes the libavcodec
212audio/video codec library.")
213 (license gpl2+)))
d5a748e8
AE
214
215(define-public vlc
216 (package
217 (name "vlc")
218 (version "2.1.4")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append
222 "http://download.videolan.org/pub/videolan/vlc/"
223 version "/vlc-" version ".tar.xz"))
224 (sha256
225 (base32
226 "1lymhbb2bns73qivdaqanhggjjhyc9fwfgf5ikhng0a74msnqmiy"))))
227 (build-system gnu-build-system)
228 (native-inputs
229 `(("git" ,git) ; needed for a test
230 ("pkg-config" ,pkg-config)))
231 ;; FIXME: Add optional inputs once available.
232 (inputs
233 `(("alsa-lib" ,alsa-lib)
234 ("avahi" ,avahi)
235 ("dbus" ,dbus)
236 ("flac" ,flac)
237 ("ffmpeg" ,ffmpeg)
238 ("fontconfig" ,fontconfig)
239 ("freetype" ,freetype)
240 ("gnutls" ,gnutls)
241 ("libcddb" ,libcddb)
242 ("libgcrypt" ,libgcrypt)
243 ("libkate" ,libkate)
244 ("libmad" ,libmad)
245 ("libogg" ,libogg)
246 ("libpng" ,libpng)
247 ("libsamplerate" ,libsamplerate)
248 ("libssh2" ,libssh2)
249 ("libvorbis" ,libvorbis)
250 ("libtheora" ,libtheora)
251 ("libxext" ,libxext)
252 ("libxinerama" ,libxinerama)
253 ("libxml2" ,libxml2)
254 ("libxpm" ,libxpm)
255 ("lua" ,lua-5.1)
256 ("mesa" ,mesa)
257 ("opus" ,opus)
258 ("perl" ,perl)
259 ("pulseaudio" ,pulseaudio)
260 ("python" ,python-wrapper)
261 ("qt" ,qt-4)
262 ("sdl" ,sdl)
263 ("sdl-image" ,sdl-image)
264 ("speex" ,speex)
265 ("xcb-util-keysyms" ,xcb-util-keysyms)))
266 (arguments
267 `(#:configure-flags
268 `("--disable-a52" ; FIXME: reenable once available
269 "--disable-mmx" ; FIXME: may be enabled on x86_64
270 "--disable-sse" ; 1-4, no separate options available
271 "--disable-neon"
272 "--disable-altivec"
273 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
274 (assoc-ref %build-inputs "ffmpeg")
275 "/lib")))) ; needed for the tests
276 (home-page "https://www.videolan.org/")
277 (synopsis "Audio and video framework")
278 (description "VLC is a cross-platform multimedia player and framework
279that plays most multimedia files as well as DVD, Audio CD, VCD, and various
280treaming protocols.")
281 (license gpl2+)))
ace69243
AE
282
283(define-public mplayer
284 (package
285 (name "mplayer")
286 (version "1.1.1")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append
290 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
291 version ".tar.xz"))
292 (sha256
293 (base32
294 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
295 (build-system gnu-build-system)
296 ;; FIXME: Add additional inputs once available.
297 (native-inputs
298 `(("pkg-config" ,pkg-config)))
299 (inputs
300 `(("alsa-lib" ,alsa-lib)
301 ("cdparanoia" ,cdparanoia)
302 ("fontconfig" ,fontconfig)
303 ("freetype" ,freetype)
304 ("lame" ,lame)
60bbd4f1 305 ("libmpg123" ,mpg123) ; audio codec for MP3
ace69243
AE
306;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
307 ("libjpeg" ,libjpeg)
308 ("libpng" ,libpng)
309 ("libtheora" ,libtheora)
310 ("libvorbis" ,libvorbis)
311 ("libx11" ,libx11)
312 ("libxxf86dga" ,libxxf86dga)
313 ("libxinerama" ,libxinerama)
314 ("libxv" ,libxv)
315 ("mesa" ,mesa)
316 ("perl" ,perl)
317 ("pulseaudio" ,pulseaudio)
318 ("python" ,python-wrapper)
319 ("sdl" ,sdl)
320 ("speex" ,speex)
321 ("yasm" ,yasm)
322 ("zlib" ,zlib)))
323 (arguments
324 `(#:tests? #f ; no test target
325 #:phases
326 (alist-replace
327 'configure
328 ;; configure does not work followed by "SHELL=..." and
329 ;; "CONFIG_SHELL=..."; set environment variables instead
330 (lambda* (#:key inputs outputs #:allow-other-keys)
331 (let ((out (assoc-ref outputs "out"))
332 (libx11 (assoc-ref inputs "libx11")))
333 (substitute* "configure"
334 (("#! /bin/sh") (string-append "#!" (which "bash"))))
335 (setenv "SHELL" (which "bash"))
336 (setenv "CONFIG_SHELL" (which "bash"))
337 (zero? (system*
338 "./configure"
339 (string-append "--extra-cflags=-I"
340 libx11 "/include") ; to detect libx11
341 "--disable-tremor-internal" ; forces external libvorbis
342 (string-append "--prefix=" out)
343 ;; drop special machine instructions not supported
344 ;; on all instances of the target
345 ,@(if (string-prefix? "x86_64"
346 (or (%current-target-system)
347 (%current-system)))
348 '()
349 '("--disable-3dnow"
350 "--disable-3dnowext"
351 "--disable-mmx"
352 "--disable-mmxext"
353 "--disable-sse"
354 "--disable-sse2"))
355 "--disable-ssse3"
356 "--disable-altivec"
357 "--disable-armv5te"
358 "--disable-armv6"
359 "--disable-armv6t2"
360 "--disable-armvfp"
361 "--disable-neon"
362 "--disable-thumb"
363 "--disable-iwmmxt"))))
364 %standard-phases)))
365 (home-page "http://www.mplayerhq.hu/design7/news.html")
366 (synopsis "Audio and video player")
367 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
368Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
369NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
370SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
371 (license gpl2)))
d0ed39be
DT
372
373(define-public libvpx
374 (package
375 (name "libvpx")
376 (version "1.3.0")
377 (source (origin
378 (method url-fetch)
379 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
380 version ".tar.bz2"))
381 (sha256
382 (base32
383 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
384 (build-system gnu-build-system)
385 (arguments
386 '(#:phases (alist-replace
387 'configure
388 (lambda* (#:key outputs #:allow-other-keys)
389 (setenv "CONFIG_SHELL" (which "bash"))
390 (let ((out (assoc-ref outputs "out")))
391 (zero? (system* "./configure"
392 "--enable-shared"
393 "--as=yasm"
394 (string-append "--prefix=" out)))))
395 %standard-phases)
396 #:tests? #f)) ; no check target
397 (native-inputs
398 `(("perl" ,perl)
399 ("yasm" ,yasm)))
400 (synopsis "VP8/VP9 video codec")
401 (description "libvpx is a codec for the VP8/VP9 video compression format.")
402 (license bsd-3)
403 (home-page "http://www.webmproject.org/")))