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