You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
9.2 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages video)
#:use-module ((guix licenses) #:select (gpl2+))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages algebra)
#:use-module (gnu packages compression)
#:use-module (gnu packages elf)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages oggvorbis)
#:use-module (gnu packages openssl)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages yasm))
(define-public ffmpeg
(name "ffmpeg")
(version "2.1.1")
(source (origin
(method url-fetch)
(uri (string-append ""
version ".tar.bz2"))
(build-system gnu-build-system)
`(("fontconfig" ,fontconfig)
("freetype" ,freetype)
("libtheora" ,libtheora)
("libvorbis" ,libvorbis)
("patchelf" ,patchelf)
("speex" ,speex)
("zlib", zlib)))
`(("bc" ,bc)
("bzip2" ,bzip2)
("perl" ,perl)
("pkg-config" ,pkg-config)
("python" ,python-2) ; scripts use interpreter python2
("speex" ,speex)
("yasm" ,yasm)))
`(#:test-target "fate"
#:modules ((guix build gnu-build-system)
(guix build utils)
(guix build rpath)
(srfi srfi-26))
#:imported-modules ((guix build gnu-build-system)
(guix build utils)
(guix build rpath))
;; configure does not work followed by "SHELL=..." and
;; "CONFIG_SHELL=..."; set environment variables instead
(lambda* (#:key outputs configure-flags #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* "configure"
(("#! /bin/sh") (string-append "#!" (which "bash"))))
(setenv "SHELL" (which "bash"))
(setenv "CONFIG_SHELL" (which "bash"))
;; possible additional inputs:
;; --enable-avisynth enable reading of AviSynth script files [no]
;; --enable-frei0r enable frei0r video filtering
;; --enable-ladspa enable LADSPA audio filtering
;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
;; --enable-libass enable libass subtitles rendering [no]
;; --enable-libbluray enable BluRay reading using libbluray [no]
;; --enable-libcaca enable textual display using libcaca
;; --enable-libcelt enable CELT decoding via libcelt [no]
;; --enable-libcdio enable audio CD grabbing with libcdio
;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
;; and libraw1394 [no]
;; --enable-libfaac enable AAC encoding via libfaac [no]
;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
;; --enable-libflite enable flite (voice synthesis) support via libflite [no]
;; --enable-libgme enable Game Music Emu via libgme [no]
;; --enable-libgsm enable GSM de/encoding via libgsm [no]
;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
;; --enable-libmodplug enable ModPlug via libmodplug [no]
;; --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
;; --enable-libnut enable NUT (de)muxing via libnut,
;; native (de)muxer exists [no]
;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
;; --enable-libopencv enable video filtering via libopencv [no]
;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
;; --enable-libopus enable Opus decoding via libopus [no]
;; --enable-libpulse enable Pulseaudio input via libpulse [no]
;; --enable-libquvi enable quvi input via libquvi [no]
;; --enable-librtmp enable RTMP[E] support via librtmp [no]
;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
;; --enable-libshine enable fixed-point MP3 encoding via libshine [no]
;; --enable-libsoxr enable Include libsoxr resampling [no]
;; --enable-libssh enable SFTP protocol via libssh [no]
;; (libssh2 does not work)
;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
;; --enable-libtwolame enable MP2 encoding via libtwolame [no]
;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
;; --enable-libvidstab enable video stabilization using vid.stab [no]
;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
;; --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
;; --enable-libx264 enable H.264 encoding via x264 [no]
;; --enable-libxavs enable AVS encoding via xavs [no]
;; --enable-libxvid enable Xvid encoding via xvidcore,
;; native MPEG-4/Xvid encoder exists [no]
;; --enable-libzmq enable message passing via libzmq [no]
;; --enable-libzvbi enable teletext support via libzvbi [no]
;; --enable-openal enable OpenAL 1.1 capture support [no]
;; --enable-opencl enable OpenCL code
;; --enable-x11grab enable X11 grabbing [no]
(zero? (system*
(string-append "--prefix=" out)
"--enable-gpl" ; enable optional gpl licensed parts
;; "--enable-gnutls" ; causes test failures
;; drop special machine instructions not supported
;; on all instances of the target
,@(if (string-prefix? "x86_64"
(or (%current-target-system)
'strip 'add-lib-to-runpath
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(lib (string-append out "/lib")))
;; Add LIB to the RUNPATH of all the executables.
(with-directory-excursion out
(for-each (cut augment-rpath <> lib)
(find-files "bin" ".*")))))
(home-page "")
(synopsis "Audio and video framework")
(description "FFmpeg is a complete, cross-platform solution to record,
convert and stream audio and video. It includes the libavcodec
audio/video codec library.")
(license gpl2+)))