gnu: libvpx: Apply bug fixes.
[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>
3b02429c 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
39efcc9b
AE
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)
fe138965 22 #:use-module (ice-9 match)
615215a5
LC
23 #:use-module ((guix licenses)
24 #:select (gpl2 gpl2+ bsd-3 public-domain))
39efcc9b
AE
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
615215a5 28 #:use-module (guix build-system python)
3b02429c 29 #:use-module (gnu packages)
39efcc9b 30 #:use-module (gnu packages algebra)
d5a748e8
AE
31 #:use-module (gnu packages avahi)
32 #:use-module (gnu packages cdrom)
39efcc9b 33 #:use-module (gnu packages compression)
615215a5 34 #:use-module (gnu packages zip)
f22e0e26 35 #:use-module (gnu packages elf)
39efcc9b 36 #:use-module (gnu packages fontutils)
d5a748e8
AE
37 #:use-module (gnu packages gl)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gnupg)
40 #:use-module (gnu packages gnutls)
e55354b8 41 #:use-module (gnu packages image)
d5a748e8
AE
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages lua)
44 #:use-module (gnu packages mp3)
39efcc9b
AE
45 #:use-module (gnu packages openssl)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
d5a748e8 48 #:use-module (gnu packages pulseaudio)
39efcc9b 49 #:use-module (gnu packages python)
d5a748e8
AE
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages sdl)
52 #:use-module (gnu packages ssh)
53 #:use-module (gnu packages version-control)
54ff0b7d 54 #:use-module (gnu packages xiph)
d5a748e8
AE
55 #:use-module (gnu packages xml)
56 #:use-module (gnu packages xorg)
39efcc9b
AE
57 #:use-module (gnu packages yasm))
58
59(define-public ffmpeg
60 (package
61 (name "ffmpeg")
9f496d43 62 (version "2.5.3")
39efcc9b
AE
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
66 version ".tar.bz2"))
67 (sha256
68 (base32
9f496d43 69 "06j1cgw9h9ya5z8gpcf9v9zik3l4xz7sr4wshj06kznzz5z3sf4x"))))
39efcc9b
AE
70 (build-system gnu-build-system)
71 (inputs
c4c4cc05 72 `(("fontconfig" ,fontconfig)
39efcc9b 73 ("freetype" ,freetype)
e816b348 74 ("opus" ,opus)
39efcc9b
AE
75 ("libtheora" ,libtheora)
76 ("libvorbis" ,libvorbis)
dc55b8b2 77 ("libvpx" ,libvpx)
f22e0e26 78 ("patchelf" ,patchelf)
c4c4cc05
JD
79 ("speex" ,speex)
80 ("zlib", zlib)))
81 (native-inputs
82 `(("bc" ,bc)
83 ("bzip2" ,bzip2)
39efcc9b
AE
84 ("perl" ,perl)
85 ("pkg-config" ,pkg-config)
86 ("python" ,python-2) ; scripts use interpreter python2
87 ("speex" ,speex)
c4c4cc05 88 ("yasm" ,yasm)))
39efcc9b 89 (arguments
31f9322e 90 `(#:test-target "fate"
f22e0e26
AE
91 #:modules ((guix build gnu-build-system)
92 (guix build utils)
93 (guix build rpath)
94 (srfi srfi-26))
95 #:imported-modules ((guix build gnu-build-system)
96 (guix build utils)
97 (guix build rpath))
31f9322e 98 #:phases
39efcc9b
AE
99 (alist-replace
100 'configure
101 ;; configure does not work followed by "SHELL=..." and
102 ;; "CONFIG_SHELL=..."; set environment variables instead
103 (lambda* (#:key outputs configure-flags #:allow-other-keys)
104 (let ((out (assoc-ref outputs "out")))
105 (substitute* "configure"
106 (("#! /bin/sh") (string-append "#!" (which "bash"))))
107 (setenv "SHELL" (which "bash"))
108 (setenv "CONFIG_SHELL" (which "bash"))
109;; possible additional inputs:
110;; --enable-avisynth enable reading of AviSynth script files [no]
111;; --enable-frei0r enable frei0r video filtering
112;; --enable-ladspa enable LADSPA audio filtering
113;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
114;; --enable-libass enable libass subtitles rendering [no]
115;; --enable-libbluray enable BluRay reading using libbluray [no]
116;; --enable-libcaca enable textual display using libcaca
117;; --enable-libcelt enable CELT decoding via libcelt [no]
118;; --enable-libcdio enable audio CD grabbing with libcdio
119;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
120;; and libraw1394 [no]
121;; --enable-libfaac enable AAC encoding via libfaac [no]
122;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
123;; --enable-libflite enable flite (voice synthesis) support via libflite [no]
124;; --enable-libgme enable Game Music Emu via libgme [no]
125;; --enable-libgsm enable GSM de/encoding via libgsm [no]
126;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
127;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
128;; --enable-libmodplug enable ModPlug via libmodplug [no]
129;; --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
130;; --enable-libnut enable NUT (de)muxing via libnut,
131;; native (de)muxer exists [no]
132;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
133;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
134;; --enable-libopencv enable video filtering via libopencv [no]
135;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
39efcc9b
AE
136;; --enable-libpulse enable Pulseaudio input via libpulse [no]
137;; --enable-libquvi enable quvi input via libquvi [no]
138;; --enable-librtmp enable RTMP[E] support via librtmp [no]
139;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
140;; --enable-libshine enable fixed-point MP3 encoding via libshine [no]
141;; --enable-libsoxr enable Include libsoxr resampling [no]
142;; --enable-libssh enable SFTP protocol via libssh [no]
143;; (libssh2 does not work)
144;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
145;; --enable-libtwolame enable MP2 encoding via libtwolame [no]
146;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
147;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
148;; --enable-libvidstab enable video stabilization using vid.stab [no]
149;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
150;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
39efcc9b
AE
151;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
152;; --enable-libx264 enable H.264 encoding via x264 [no]
153;; --enable-libxavs enable AVS encoding via xavs [no]
154;; --enable-libxvid enable Xvid encoding via xvidcore,
155;; native MPEG-4/Xvid encoder exists [no]
156;; --enable-libzmq enable message passing via libzmq [no]
157;; --enable-libzvbi enable teletext support via libzvbi [no]
158;; --enable-openal enable OpenAL 1.1 capture support [no]
159;; --enable-opencl enable OpenCL code
160;; --enable-x11grab enable X11 grabbing [no]
161 (zero? (system*
162 "./configure"
163 (string-append "--prefix=" out)
164 "--enable-gpl" ; enable optional gpl licensed parts
165 "--enable-shared"
166 "--enable-fontconfig"
167 ;; "--enable-gnutls" ; causes test failures
168 "--enable-libfreetype"
e816b348 169 "--enable-libopus"
39efcc9b
AE
170 "--enable-libspeex"
171 "--enable-libtheora"
172 "--enable-libvorbis"
dc55b8b2 173 "--enable-libvpx"
82fce926
MW
174
175 "--enable-runtime-cpudetect"
176
177 ;; Runtime cpu detection is not implemented on
178 ;; MIPS, so we disable some features.
39efcc9b
AE
179 "--disable-mips32r2"
180 "--disable-mipsdspr1"
181 "--disable-mipsdspr2"
182 "--disable-mipsfpu"))))
f22e0e26
AE
183 (alist-cons-after
184 'strip 'add-lib-to-runpath
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let* ((out (assoc-ref outputs "out"))
187 (lib (string-append out "/lib")))
622c8f0a 188 ;; Add LIB to the RUNPATH of all the executables and libraries.
f22e0e26
AE
189 (with-directory-excursion out
190 (for-each (cut augment-rpath <> lib)
622c8f0a
SB
191 (append (find-files "bin" ".*")
192 (find-files "lib" "\\.so\\..*\\."))))))
f22e0e26 193 %standard-phases))))
39efcc9b
AE
194 (home-page "http://www.ffmpeg.org/")
195 (synopsis "Audio and video framework")
196 (description "FFmpeg is a complete, cross-platform solution to record,
197convert and stream audio and video. It includes the libavcodec
198audio/video codec library.")
199 (license gpl2+)))
d5a748e8 200
f9e687b5
MW
201;; We need this older ffmpeg because vlc-2.1.5 doesn't work with ffmpeg-2.4.
202(define-public ffmpeg-2.2
203 (package (inherit ffmpeg)
7d05f769 204 (version "2.2.11")
f9e687b5
MW
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "http://www.ffmpeg.org/releases/ffmpeg-"
208 version ".tar.bz2"))
209 (sha256
210 (base32
7d05f769 211 "06sli7xvihh97ss6a2mkdq4dcj3rg1w8zffrmjfc1hvyjxhc8f2r"))))))
f9e687b5 212
d5a748e8
AE
213(define-public vlc
214 (package
215 (name "vlc")
23466647 216 (version "2.1.5")
d5a748e8
AE
217 (source (origin
218 (method url-fetch)
219 (uri (string-append
220 "http://download.videolan.org/pub/videolan/vlc/"
221 version "/vlc-" version ".tar.xz"))
222 (sha256
223 (base32
23466647 224 "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg"))))
d5a748e8
AE
225 (build-system gnu-build-system)
226 (native-inputs
227 `(("git" ,git) ; needed for a test
228 ("pkg-config" ,pkg-config)))
229 ;; FIXME: Add optional inputs once available.
230 (inputs
231 `(("alsa-lib" ,alsa-lib)
232 ("avahi" ,avahi)
233 ("dbus" ,dbus)
234 ("flac" ,flac)
f9e687b5 235 ("ffmpeg" ,ffmpeg-2.2) ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4
d5a748e8
AE
236 ("fontconfig" ,fontconfig)
237 ("freetype" ,freetype)
238 ("gnutls" ,gnutls)
239 ("libcddb" ,libcddb)
240 ("libgcrypt" ,libgcrypt)
241 ("libkate" ,libkate)
242 ("libmad" ,libmad)
243 ("libogg" ,libogg)
244 ("libpng" ,libpng)
245 ("libsamplerate" ,libsamplerate)
246 ("libssh2" ,libssh2)
247 ("libvorbis" ,libvorbis)
248 ("libtheora" ,libtheora)
249 ("libxext" ,libxext)
250 ("libxinerama" ,libxinerama)
251 ("libxml2" ,libxml2)
252 ("libxpm" ,libxpm)
253 ("lua" ,lua-5.1)
254 ("mesa" ,mesa)
255 ("opus" ,opus)
256 ("perl" ,perl)
257 ("pulseaudio" ,pulseaudio)
258 ("python" ,python-wrapper)
259 ("qt" ,qt-4)
260 ("sdl" ,sdl)
261 ("sdl-image" ,sdl-image)
262 ("speex" ,speex)
263 ("xcb-util-keysyms" ,xcb-util-keysyms)))
264 (arguments
265 `(#:configure-flags
266 `("--disable-a52" ; FIXME: reenable once available
d5a748e8
AE
267 ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
268 (assoc-ref %build-inputs "ffmpeg")
269 "/lib")))) ; needed for the tests
270 (home-page "https://www.videolan.org/")
271 (synopsis "Audio and video framework")
272 (description "VLC is a cross-platform multimedia player and framework
273that plays most multimedia files as well as DVD, Audio CD, VCD, and various
274treaming protocols.")
275 (license gpl2+)))
ace69243
AE
276
277(define-public mplayer
278 (package
279 (name "mplayer")
280 (version "1.1.1")
281 (source (origin
282 (method url-fetch)
283 (uri (string-append
284 "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
285 version ".tar.xz"))
286 (sha256
287 (base32
288 "0xlcg7rszrwmw29wqr0plsw5d1rq0hb7vjsq7bmmfsly2z1wg3yf"))))
289 (build-system gnu-build-system)
290 ;; FIXME: Add additional inputs once available.
291 (native-inputs
292 `(("pkg-config" ,pkg-config)))
293 (inputs
294 `(("alsa-lib" ,alsa-lib)
295 ("cdparanoia" ,cdparanoia)
296 ("fontconfig" ,fontconfig)
297 ("freetype" ,freetype)
298 ("lame" ,lame)
60bbd4f1 299 ("libmpg123" ,mpg123) ; audio codec for MP3
ace69243
AE
300;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
301 ("libjpeg" ,libjpeg)
302 ("libpng" ,libpng)
303 ("libtheora" ,libtheora)
304 ("libvorbis" ,libvorbis)
305 ("libx11" ,libx11)
306 ("libxxf86dga" ,libxxf86dga)
307 ("libxinerama" ,libxinerama)
308 ("libxv" ,libxv)
309 ("mesa" ,mesa)
310 ("perl" ,perl)
311 ("pulseaudio" ,pulseaudio)
312 ("python" ,python-wrapper)
313 ("sdl" ,sdl)
314 ("speex" ,speex)
315 ("yasm" ,yasm)
316 ("zlib" ,zlib)))
317 (arguments
318 `(#:tests? #f ; no test target
319 #:phases
320 (alist-replace
321 'configure
322 ;; configure does not work followed by "SHELL=..." and
323 ;; "CONFIG_SHELL=..."; set environment variables instead
324 (lambda* (#:key inputs outputs #:allow-other-keys)
325 (let ((out (assoc-ref outputs "out"))
326 (libx11 (assoc-ref inputs "libx11")))
327 (substitute* "configure"
328 (("#! /bin/sh") (string-append "#!" (which "bash"))))
329 (setenv "SHELL" (which "bash"))
330 (setenv "CONFIG_SHELL" (which "bash"))
331 (zero? (system*
332 "./configure"
333 (string-append "--extra-cflags=-I"
334 libx11 "/include") ; to detect libx11
335 "--disable-tremor-internal" ; forces external libvorbis
336 (string-append "--prefix=" out)
fe138965
MW
337 ;; Enable runtime cpu detection where supported,
338 ;; and choose a suitable target.
339 ,@(match (or (%current-target-system)
340 (%current-system))
341 ("x86_64-linux"
342 '("--enable-runtime-cpudetection"
343 "--target=x86_64-linux"))
344 ("i686-linux"
345 '("--enable-runtime-cpudetection"
346 "--target=i686-linux"))
347 ("mips64el-linux"
348 '("--target=mips3-linux")))
ace69243
AE
349 "--disable-armv5te"
350 "--disable-armv6"
351 "--disable-armv6t2"
352 "--disable-armvfp"
353 "--disable-neon"
354 "--disable-thumb"
355 "--disable-iwmmxt"))))
356 %standard-phases)))
357 (home-page "http://www.mplayerhq.hu/design7/news.html")
358 (synopsis "Audio and video player")
359 (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
360Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
361NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
362SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
363 (license gpl2)))
d0ed39be
DT
364
365(define-public libvpx
366 (package
367 (name "libvpx")
368 (version "1.3.0")
369 (source (origin
370 (method url-fetch)
371 (uri (string-append "http://webm.googlecode.com/files/libvpx-v"
372 version ".tar.bz2"))
373 (sha256
374 (base32
3b02429c
MW
375 "1aai0h0z1bhp89pxmg4fkrwpmqq24k39fhr15cw6q77m9bccip6k"))
376 (patches
377 (list (search-patch "libvpx-vp9-out-of-bounds-access.patch")
378 (search-patch "libvpx-fix-ssse3-quantize.patch")
379 (search-patch "libvpx-fix-armhf-link.patch")))))
d0ed39be
DT
380 (build-system gnu-build-system)
381 (arguments
3b02429c 382 `(#:phases (alist-replace
d0ed39be
DT
383 'configure
384 (lambda* (#:key outputs #:allow-other-keys)
385 (setenv "CONFIG_SHELL" (which "bash"))
386 (let ((out (assoc-ref outputs "out")))
387 (zero? (system* "./configure"
388 "--enable-shared"
389 "--as=yasm"
3b02429c
MW
390 ,@(if (and (not (%current-target-system))
391 (string-prefix?
392 "armhf-"
393 (%current-system)))
394 ;; When building on ARMv7, libvpx
395 ;; assumes that NEON will be
396 ;; available. On Guix, armhf
397 ;; does not require NEON, so we
398 ;; build for ARMv6 and -marm (since
399 ;; no thumb2 on ARMv6) to ensure
400 ;; compatibility with all ARMv7
401 ;; cores we support. Based on
402 ;; the Debian libvpx package.
403 '("--target=armv6-linux-gcc"
404 "--extra-cflags=-marm"
405 "--enable-small")
406 '())
d0ed39be
DT
407 (string-append "--prefix=" out)))))
408 %standard-phases)
409 #:tests? #f)) ; no check target
410 (native-inputs
411 `(("perl" ,perl)
412 ("yasm" ,yasm)))
413 (synopsis "VP8/VP9 video codec")
414 (description "libvpx is a codec for the VP8/VP9 video compression format.")
415 (license bsd-3)
416 (home-page "http://www.webmproject.org/")))
615215a5
LC
417
418(define-public youtube-dl
419 (package
420 (name "youtube-dl")
2f7fade9 421 (version "2015.01.23.4")
615215a5
LC
422 (source (origin
423 (method url-fetch)
424 (uri (string-append "http://youtube-dl.org/downloads/"
425 version "/youtube-dl-"
426 version ".tar.gz"))
427 (sha256
428 (base32
2f7fade9 429 "0pvvab9dk1righ3fa79000iz8fzdlcxakscx5sd31730c37j3kj2"))))
615215a5
LC
430 (build-system python-build-system)
431 (inputs `(("setuptools" ,python-setuptools)))
432 (home-page "http://youtube-dl.org")
433 (synopsis "Download videos from YouTube.com and other sites")
434 (description
435 "youtube-dl is a small command-line program to download videos from
436YouTube.com and a few more sites.")
437 (license public-domain)))
e6bdb36a
AE
438
439(define-public libdvdread
440 (package
441 (name "libdvdread")
442 (version "5.0.0")
443 (source (origin
444 (method url-fetch)
445 (uri (string-append "http://download.videolan.org/videolan/"
446 name "/" version "/"
447 name "-" version ".tar.bz2"))
448 (sha256
449 (base32
450 "052z62l3x8ka5jpf5bi1mzp5p323n1z9rxj74nq5c35a88x1myv6"))))
451 (build-system gnu-build-system)
452 (home-page "http://dvdnav.mplayerhq.hu/")
453 (synopsis "Library for reading video DVDs")
454 (description
455 "Libdvdread provides a simple foundation for reading DVD video
456disks. It provides the functionality that is required to access many
457DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
458authentication and descrambling (if an external libdvdcss library is
459installed).")
460 (license gpl2+)))
b027d919
AE
461
462(define-public libdvdnav
463 (package
464 (name "libdvdnav")
465 (version "5.0.1")
466 (source (origin
467 (method url-fetch)
468 (uri (string-append "http://download.videolan.org/videolan/"
469 name "/" version "/"
470 name "-" version ".tar.bz2"))
471 (sha256
472 (base32
473 "1ad2lkkiydgwiyqfysra9lkwjv9yqnvcg4hv92hx8qzics1cpcbj"))))
474 (build-system gnu-build-system)
475 (native-inputs
476 `(("pkg-config" ,pkg-config)))
477 (inputs
478 `(("libdvdread" ,libdvdread)))
479 (home-page "http://dvdnav.mplayerhq.hu/")
480 (synopsis "Library for video DVD navigation features")
481 (description
482 "Libdvdnav is a library for developers of multimedia
483applications. It allows easy use of sophisticated DVD navigation features
484such as DVD menus, multiangle playback and even interactive DVD games. All
485this functionality is provided through a simple API which provides the DVD
486playback as a single logical stream of blocks, intermitted by special
487dvdnav events to report certain conditions. The main usage of libdvdnav is
488a loop regularly calling a function to get the next block, surrounded by
489additional calls to tell the library of user interaction. The whole
490DVD virtual machine and internal playback states are completely
491encapsulated.")
492 (license gpl2+)))