gnu: ffmpeg-2.2: Update to 2.2.10.
[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 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
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.
12 ;;;
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.
17 ;;;
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/>.
20
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))
57
58 (define-public ffmpeg
59 (package
60 (name "ffmpeg")
61 (version "2.4.3")
62 (source (origin
63 (method url-fetch)
64 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
65 version ".tar.bz2"))
66 (sha256
67 (base32
68 "00p6qi7kwc2rv7h98bczrdssa7nbda3fpz7avjwl77jg1qy3wp6a"))))
69 (build-system gnu-build-system)
70 (inputs
71 `(("fontconfig" ,fontconfig)
72 ("freetype" ,freetype)
73 ("opus" ,opus)
74 ("libtheora" ,libtheora)
75 ("libvorbis" ,libvorbis)
76 ("libvpx" ,libvpx)
77 ("patchelf" ,patchelf)
78 ("speex" ,speex)
79 ("zlib", zlib)))
80 (native-inputs
81 `(("bc" ,bc)
82 ("bzip2" ,bzip2)
83 ("perl" ,perl)
84 ("pkg-config" ,pkg-config)
85 ("python" ,python-2) ; scripts use interpreter python2
86 ("speex" ,speex)
87 ("yasm" ,yasm)))
88 (arguments
89 `(#:test-target "fate"
90 #:modules ((guix build gnu-build-system)
91 (guix build utils)
92 (guix build rpath)
93 (srfi srfi-26))
94 #:imported-modules ((guix build gnu-build-system)
95 (guix build utils)
96 (guix build rpath))
97 #:phases
98 (alist-replace
99 'configure
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]
160 (zero? (system*
161 "./configure"
162 (string-append "--prefix=" out)
163 "--enable-gpl" ; enable optional gpl licensed parts
164 "--enable-shared"
165 "--enable-fontconfig"
166 ;; "--enable-gnutls" ; causes test failures
167 "--enable-libfreetype"
168 "--enable-libopus"
169 "--enable-libspeex"
170 "--enable-libtheora"
171 "--enable-libvorbis"
172 "--enable-libvpx"
173
174 "--enable-runtime-cpudetect"
175
176 ;; Runtime cpu detection is not implemented on
177 ;; MIPS, so we disable some features.
178 "--disable-mips32r2"
179 "--disable-mipsdspr1"
180 "--disable-mipsdspr2"
181 "--disable-mipsfpu"))))
182 (alist-cons-after
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" ".*")))))
191 %standard-phases))))
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.")
197 (license gpl2+)))
198
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)
202 (version "2.2.10")
203 (source (origin
204 (method url-fetch)
205 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
206 version ".tar.bz2"))
207 (sha256
208 (base32
209 "14d83ijp5lxdr6nl9rqhc4598jp020paxrg64r9ifxqhbigl0yqm"))))))
210
211 (define-public vlc
212 (package
213 (name "vlc")
214 (version "2.1.5")
215 (source (origin
216 (method url-fetch)
217 (uri (string-append
218 "http://download.videolan.org/pub/videolan/vlc/"
219 version "/vlc-" version ".tar.xz"))
220 (sha256
221 (base32
222 "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg"))))
223 (build-system gnu-build-system)
224 (native-inputs
225 `(("git" ,git) ; needed for a test
226 ("pkg-config" ,pkg-config)))
227 ;; FIXME: Add optional inputs once available.
228 (inputs
229 `(("alsa-lib" ,alsa-lib)
230 ("avahi" ,avahi)
231 ("dbus" ,dbus)
232 ("flac" ,flac)
233 ("ffmpeg" ,ffmpeg-2.2) ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4
234 ("fontconfig" ,fontconfig)
235 ("freetype" ,freetype)
236 ("gnutls" ,gnutls)
237 ("libcddb" ,libcddb)
238 ("libgcrypt" ,libgcrypt)
239 ("libkate" ,libkate)
240 ("libmad" ,libmad)
241 ("libogg" ,libogg)
242 ("libpng" ,libpng)
243 ("libsamplerate" ,libsamplerate)
244 ("libssh2" ,libssh2)
245 ("libvorbis" ,libvorbis)
246 ("libtheora" ,libtheora)
247 ("libxext" ,libxext)
248 ("libxinerama" ,libxinerama)
249 ("libxml2" ,libxml2)
250 ("libxpm" ,libxpm)
251 ("lua" ,lua-5.1)
252 ("mesa" ,mesa)
253 ("opus" ,opus)
254 ("perl" ,perl)
255 ("pulseaudio" ,pulseaudio)
256 ("python" ,python-wrapper)
257 ("qt" ,qt-4)
258 ("sdl" ,sdl)
259 ("sdl-image" ,sdl-image)
260 ("speex" ,speex)
261 ("xcb-util-keysyms" ,xcb-util-keysyms)))
262 (arguments
263 `(#:configure-flags
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.")
273 (license gpl2+)))
274
275 (define-public mplayer
276 (package
277 (name "mplayer")
278 (version "1.1.1")
279 (source (origin
280 (method url-fetch)
281 (uri (string-append
282 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
283 version ".tar.xz"))
284 (sha256
285 (base32
286 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
287 (build-system gnu-build-system)
288 ;; FIXME: Add additional inputs once available.
289 (native-inputs
290 `(("pkg-config" ,pkg-config)))
291 (inputs
292 `(("alsa-lib" ,alsa-lib)
293 ("cdparanoia" ,cdparanoia)
294 ("fontconfig" ,fontconfig)
295 ("freetype" ,freetype)
296 ("lame" ,lame)
297 ("libmpg123" ,mpg123) ; audio codec for MP3
298 ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
299 ("libjpeg" ,libjpeg)
300 ("libpng" ,libpng)
301 ("libtheora" ,libtheora)
302 ("libvorbis" ,libvorbis)
303 ("libx11" ,libx11)
304 ("libxxf86dga" ,libxxf86dga)
305 ("libxinerama" ,libxinerama)
306 ("libxv" ,libxv)
307 ("mesa" ,mesa)
308 ("perl" ,perl)
309 ("pulseaudio" ,pulseaudio)
310 ("python" ,python-wrapper)
311 ("sdl" ,sdl)
312 ("speex" ,speex)
313 ("yasm" ,yasm)
314 ("zlib" ,zlib)))
315 (arguments
316 `(#:tests? #f ; no test target
317 #:phases
318 (alist-replace
319 'configure
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"))
329 (zero? (system*
330 "./configure"
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)
338 (%current-system))
339 ("x86_64-linux"
340 '("--enable-runtime-cpudetection"
341 "--target=x86_64-linux"))
342 ("i686-linux"
343 '("--enable-runtime-cpudetection"
344 "--target=i686-linux"))
345 ("mips64el-linux"
346 '("--target=mips3-linux")))
347 "--disable-armv5te"
348 "--disable-armv6"
349 "--disable-armv6t2"
350 "--disable-armvfp"
351 "--disable-neon"
352 "--disable-thumb"
353 "--disable-iwmmxt"))))
354 %standard-phases)))
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.")
361 (license gpl2)))
362
363 (define-public libvpx
364 (package
365 (name "libvpx")
366 (version "1.3.0")
367 (source (origin
368 (method url-fetch)
369 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
370 version ".tar.bz2"))
371 (sha256
372 (base32
373 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))))
374 (build-system gnu-build-system)
375 (arguments
376 '(#:phases (alist-replace
377 'configure
378 (lambda* (#:key outputs #:allow-other-keys)
379 (setenv "CONFIG_SHELL" (which "bash"))
380 (let ((out (assoc-ref outputs "out")))
381 (zero? (system* "./configure"
382 "--enable-shared"
383 "--as=yasm"
384 (string-append "--prefix=" out)))))
385 %standard-phases)
386 #:tests? #f)) ; no check target
387 (native-inputs
388 `(("perl" ,perl)
389 ("yasm" ,yasm)))
390 (synopsis "VP8/VP9 video codec")
391 (description "libvpx is a codec for the VP8/VP9 video compression format.")
392 (license bsd-3)
393 (home-page "http://www.webmproject.org/")))
394
395 (define-public youtube-dl
396 (package
397 (name "youtube-dl")
398 (version "2014.09.06")
399 (source (origin
400 (method url-fetch)
401 (uri (string-append "http://youtube-dl.org/downloads/"
402 version "/youtube-dl-"
403 version ".tar.gz"))
404 (sha256
405 (base32
406 "1a50vqgzp9wjh2763shald6dlmdd5qlqy83vg4yrihdrlh8sk6dd"))))
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")
411 (description
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)))