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 "153kfk8rzrfxx930rrk417b2m695dvy47v4hci3nd49iggx9jzz1"))))
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"
198 "--disable-mipsdspr1"
199 "--disable-mipsdspr2"
200 "--disable-mipsfpu"))))
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" ".*")))))
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.")
225 "http://download.videolan.org/pub/videolan/vlc/"
226 version "/vlc-" version ".tar.xz"))
229 "1lymhbb2bns73qivdaqanhggjjhyc9fwfgf5ikhng0a74msnqmiy"))))
230 (build-system gnu-build-system)
232 `(("git" ,git) ; needed for a test
233 ("pkg-config" ,pkg-config)))
234 ;; FIXME: Add optional inputs once available.
236 `(("alsa-lib" ,alsa-lib)
241 ("fontconfig" ,fontconfig)
242 ("freetype" ,freetype)
245 ("libgcrypt" ,libgcrypt)
250 ("libsamplerate" ,libsamplerate)
252 ("libvorbis" ,libvorbis)
253 ("libtheora" ,libtheora)
255 ("libxinerama" ,libxinerama)
262 ("pulseaudio" ,pulseaudio)
263 ("python" ,python-wrapper)
266 ("sdl-image" ,sdl-image)
268 ("xcb-util-keysyms" ,xcb-util-keysyms)))
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
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.")
286 (define-public mplayer
293 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
297 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
298 (build-system gnu-build-system)
299 ;; FIXME: Add additional inputs once available.
301 `(("pkg-config" ,pkg-config)))
303 `(("alsa-lib" ,alsa-lib)
304 ("cdparanoia" ,cdparanoia)
305 ("fontconfig" ,fontconfig)
306 ("freetype" ,freetype)
308 ("libmpg123" ,mpg123) ; audio codec for MP3
309 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
312 ("libtheora" ,libtheora)
313 ("libvorbis" ,libvorbis)
315 ("libxxf86dga" ,libxxf86dga)
316 ("libxinerama" ,libxinerama)
320 ("pulseaudio" ,pulseaudio)
321 ("python" ,python-wrapper)
327 `(#:tests? #f ; no test target
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"))
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)
366 "--disable-iwmmxt"))))
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.")
376 (define-public libvpx
382 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
386 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
387 (build-system gnu-build-system)
389 '(#:phases (alist-replace
391 (lambda* (#:key outputs #:allow-other-keys)
392 (setenv "CONFIG_SHELL" (which "bash"))
393 (let ((out (assoc-ref outputs "out")))
394 (zero? (system* "./configure"
397 (string-append "--prefix=" out)))))
399 #:tests? #f)) ; no check target
403 (synopsis "VP8/VP9 video codec")
404 (description "libvpx is a codec for the VP8/VP9 video compression format.")
406 (home-page "http://www.webmproject.org/")))
408 (define-public youtube-dl
411 (version "2014.06.26")
414 (uri (string-append "http://youtube-dl.org/downloads/"
415 version "/youtube-dl-"
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")
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)))