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 "00p6qi7kwc2rv7h98bczrdssa7nbda3fpz7avjwl77jg1qy3wp6a"))))
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.
188 (with-directory-excursion out
189 (for-each (cut augment-rpath <> lib)
190 (find-files "bin" ".*")))))
192 (home-page "http://www.ffmpeg.org/")
193 (synopsis "Audio and video framework")
194 (description "FFmpeg is a complete, cross-platform solution to record,
195 convert and stream audio and video. It includes the libavcodec
196 audio/video codec library.")
199 ;; We need this older ffmpeg because vlc-2.1.5 doesn't work with ffmpeg-2.4.
200 (define-public ffmpeg-2.2
201 (package (inherit ffmpeg)
205 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
209 "06sli7xvihh97ss6a2mkdq4dcj3rg1w8zffrmjfc1hvyjxhc8f2r"))))))
218 "http://download.videolan.org/pub/videolan/vlc/"
219 version "/vlc-" version ".tar.xz"))
222 "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg"))))
223 (build-system gnu-build-system)
225 `(("git" ,git) ; needed for a test
226 ("pkg-config" ,pkg-config)))
227 ;; FIXME: Add optional inputs once available.
229 `(("alsa-lib" ,alsa-lib)
233 ("ffmpeg" ,ffmpeg-2.2) ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4
234 ("fontconfig" ,fontconfig)
235 ("freetype" ,freetype)
238 ("libgcrypt" ,libgcrypt)
243 ("libsamplerate" ,libsamplerate)
245 ("libvorbis" ,libvorbis)
246 ("libtheora" ,libtheora)
248 ("libxinerama" ,libxinerama)
255 ("pulseaudio" ,pulseaudio)
256 ("python" ,python-wrapper)
259 ("sdl-image" ,sdl-image)
261 ("xcb-util-keysyms" ,xcb-util-keysyms)))
264 `("--disable-a52" ; FIXME: reenable once available
265 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
266 (assoc-ref %build-inputs "ffmpeg")
267 "/lib")))) ; needed for the tests
268 (home-page "https://www.videolan.org/")
269 (synopsis "Audio and video framework")
270 (description "VLC is a cross-platform multimedia player and framework
271 that plays most multimedia files as well as DVD, Audio CD, VCD, and various
272 treaming protocols.")
275 (define-public mplayer
282 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
286 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
287 (build-system gnu-build-system)
288 ;; FIXME: Add additional inputs once available.
290 `(("pkg-config" ,pkg-config)))
292 `(("alsa-lib" ,alsa-lib)
293 ("cdparanoia" ,cdparanoia)
294 ("fontconfig" ,fontconfig)
295 ("freetype" ,freetype)
297 ("libmpg123" ,mpg123) ; audio codec for MP3
298 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
301 ("libtheora" ,libtheora)
302 ("libvorbis" ,libvorbis)
304 ("libxxf86dga" ,libxxf86dga)
305 ("libxinerama" ,libxinerama)
309 ("pulseaudio" ,pulseaudio)
310 ("python" ,python-wrapper)
316 `(#:tests? #f ; no test target
320 ;; configure does not work followed by "SHELL=..." and
321 ;; "CONFIG_SHELL=..."; set environment variables instead
322 (lambda* (#:key inputs outputs #:allow-other-keys)
323 (let ((out (assoc-ref outputs "out"))
324 (libx11 (assoc-ref inputs "libx11")))
325 (substitute* "configure"
326 (("#! /bin/sh") (string-append "#!" (which "bash"))))
327 (setenv "SHELL" (which "bash"))
328 (setenv "CONFIG_SHELL" (which "bash"))
331 (string-append "--extra-cflags=-I"
332 libx11 "/include") ; to detect libx11
333 "--disable-tremor-internal" ; forces external libvorbis
334 (string-append "--prefix=" out)
335 ;; Enable runtime cpu detection where supported,
336 ;; and choose a suitable target.
337 ,@(match (or (%current-target-system)
340 '("--enable-runtime-cpudetection"
341 "--target=x86_64-linux"))
343 '("--enable-runtime-cpudetection"
344 "--target=i686-linux"))
346 '("--target=mips3-linux")))
353 "--disable-iwmmxt"))))
355 (home-page "http://www.mplayerhq.hu/design7/news.html")
356 (synopsis "Audio and video player")
357 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
358 Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
359 NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
360 SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
363 (define-public libvpx
369 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
373 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
374 (build-system gnu-build-system)
376 '(#:phases (alist-replace
378 (lambda* (#:key outputs #:allow-other-keys)
379 (setenv "CONFIG_SHELL" (which "bash"))
380 (let ((out (assoc-ref outputs "out")))
381 (zero? (system* "./configure"
384 (string-append "--prefix=" out)))))
386 #:tests? #f)) ; no check target
390 (synopsis "VP8/VP9 video codec")
391 (description "libvpx is a codec for the VP8/VP9 video compression format.")
393 (home-page "http://www.webmproject.org/")))
395 (define-public youtube-dl
398 (version "2014.12.15")
401 (uri (string-append "http://youtube-dl.org/downloads/"
402 version "/youtube-dl-"
406 "09z7v6jxs4a36kyy681mcypcqsxipplnbdy9s3rva1rpp5f74h2z"))))
407 (build-system python-build-system)
408 (inputs `(("setuptools" ,python-setuptools)))
409 (home-page "http://youtube-dl.org")
410 (synopsis "Download videos from YouTube.com and other sites")
412 "youtube-dl is a small command-line program to download videos from
413 YouTube.com and a few more sites.")
414 (license public-domain)))