1 # TODO: libilbc, libfdk-aac, flite
3 # How to deal with ffmpeg/opencv checken-egg problem:
4 # 1. make-request -r --without opencv ffmpeg.spec
5 # 2. make-request -r opencv.spec
6 # 3. bump release of ffmpeg.spec
7 # 4. make-request -r ffmpeg.spec
10 %bcond_with nonfree # non free options of package (currently: faac)
11 %bcond_with aacplus # AAC+ encoding via libaacplus (requires nonfree)
12 %bcond_without autoreqdep # don't care about package name deps generated by rpm
13 %bcond_without caca # textual display using libcaca
14 %bcond_with flite # flite voice synthesis support [ffmpeg expects more voices]
15 %bcond_without frei0r # build without frei0r video filtering
16 %bcond_without openal # build without OpenAL 1.1 capture support
17 %bcond_without opencv # build without opencv video filtering
18 %bcond_without pulseaudio # build without PulseAudio input support
19 %bcond_without x264 # build without x264 encoder
20 %bcond_without utvideo # build without Ut Video decoder
21 %bcond_without va # VAAPI (Video Acceleration API)
22 %bcond_without vpx # VP8, a high-quality video codec
23 %bcond_without doc # don't build docs
25 Summary: FFmpeg - a very fast video and audio converter
26 Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
30 # LGPL or GPL, chosen at configure time (GPL version is more featured)
31 # (postprocessing, some filters, x264, xavs, xvid, x11grab)
32 # using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
33 License: GPL v3+ with LGPL v3+ parts
34 Group: Applications/Multimedia
35 Source0: http://ffmpeg.org/releases/%{name}-%{version}.tar.bz2
36 # Source0-md5: 3ed526cea20c1bffb5a37f7730f710bd
37 Source1: ffserver.init
38 Source2: ffserver.sysconfig
39 Source3: ffserver.conf
40 Patch0: %{name}-gsm.patch
41 Patch1: %{name}-opencv24.patch
42 Patch2: %{name}-openjpeg.patch
43 URL: http://www.ffmpeg.org/
44 %{?with_openal:BuildRequires: OpenAL-devel}
45 BuildRequires: SDL-devel >= 1.2.1
46 BuildRequires: alsa-lib-devel
47 BuildRequires: bzip2-devel
48 BuildRequires: celt-devel >= 0.11.0
49 %{?with_nonfree:BuildRequires: faac-devel}
50 %{?with_flite:BuildRequires: flite-devel}
51 BuildRequires: fontconfig-devel
52 BuildRequires: freetype-devel
53 %{?with_frei0r:BuildRequires: frei0r-devel}
55 # require version with altivec support fixed
56 BuildRequires: gcc >= 5:3.3.2-3
58 BuildRequires: gnutls-devel
59 BuildRequires: jack-audio-connection-kit-devel
60 BuildRequires: lame-libs-devel >= 3.98.3
61 %{?with_aacplus:BuildRequires: libaacplus-devel >= 2.0.0}
62 BuildRequires: libass-devel
63 BuildRequires: libavc1394-devel
64 BuildRequires: libbluray-devel
65 %{?with_caca:BuildRequires: libcaca-devel}
66 BuildRequires: libcdio-devel
67 BuildRequires: libdc1394-devel >= 2
68 BuildRequires: libgsm-devel
69 BuildRequires: libiec61883-devel
70 BuildRequires: libmodplug-devel
71 BuildRequires: libnut-devel
72 BuildRequires: libraw1394-devel >= 2
73 BuildRequires: librtmp-devel
74 BuildRequires: libtheora-devel >= 1.0-0.beta3
75 BuildRequires: libtool >= 2:1.4d-3
76 BuildRequires: libv4l-devel
77 %{?with_va:BuildRequires: libva-devel >= 1.0.3}
78 BuildRequires: libvdpau-devel >= 0.2
79 BuildRequires: libvorbis-devel
80 %{?with_vpx:BuildRequires: libvpx-devel >= 0.9.6}
82 %{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245}
88 BuildRequires: opencore-amr-devel
89 %{?with_opencv:BuildRequires: opencv-devel}
90 BuildRequires: openjpeg-devel >= 1.5
91 BuildRequires: opus-devel
92 BuildRequires: perl-Encode
93 BuildRequires: perl-tools-pod
94 BuildRequires: pkgconfig
95 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
96 BuildRequires: rpmbuild(macros) >= 1.470
97 BuildRequires: schroedinger-devel
98 BuildRequires: speex-devel >= 1:1.2-rc1
99 %{?with_doc:BuildRequires: tetex}
100 %{?with_doc:BuildRequires: texi2html}
101 %{?with_doc:BuildRequires: texinfo}
102 BuildRequires: twolame-devel
103 %{?with_utvideo:BuildRequires: utvideo-devel}
105 BuildRequires: vo-aacenc-devel
106 BuildRequires: vo-amrwbenc-devel
107 BuildRequires: xavs-devel
108 BuildRequires: xorg-lib-libXext-devel
109 BuildRequires: xorg-lib-libXfixes-devel
110 BuildRequires: xvid-devel >= 1:1.1.0
111 BuildRequires: zlib-devel
112 %{?with_autoreqdep:BuildConflicts: libpostproc}
113 # overflows maximum hash table size
114 BuildConflicts: pdksh < 5.2.14-57
115 Requires: %{name}-libs = %{version}-%{release}
116 Requires: xvid >= 1:1.1.0
117 Obsoletes: libpostproc
118 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
120 %define _noautoreqdep libGL.so.1 libGLU.so.1
122 %define specflags -fno-strict-aliasing
124 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
125 %define specflags_ia32 -fomit-frame-pointer
126 # -mmmx is needed to enable <mmintrin.h> code.
127 %define specflags_i586 -mmmx
128 %define specflags_i686 -mmmx
129 %define specflags_ppc -fPIC
132 FFmpeg is a complete solution to record, convert and stream audio and
133 video. It is a command line tool to convert one video file format to
134 another. It also supports grabbing and encoding in real time from a TV
137 %description -l pl.UTF-8
138 FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
139 strumieni dźwięku i obrazu. Jest to działające z linii poleceń
140 narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
141 także przechwytywanie i kodowanie w czasie rzeczywistym z karty
145 Summary: ffmpeg libraries
146 Summary(pl.UTF-8): Biblioteki ffmpeg
150 This package contains the ffmpeg shared libraries:
151 - the codec library (libavcodec). It supports most existing encoding
152 formats (MPEG, DivX, MPEG4, AC3, DV...),
153 - demuxer library (libavformat). It supports most existing file
154 formats (AVI, MPEG, OGG, Matroska, ASF...),
155 - video postprocessing library (libpostproc).
157 %description libs -l pl.UTF-8
158 Ten pakiet zawiera biblioteki współdzielone ffmpeg:
159 - bibliotekę kodeków (libavcodec); obsługuje większość istniejących
160 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
161 - bibliotekę demuksera (libavformat); obsługuje większość istniejących
162 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
163 - bibliotekę postprocessingu (libpostproc).
166 Summary: ffmpeg header files
167 Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
168 Group: Development/Libraries
169 Requires: %{name}-libs = %{version}-%{release}
170 # Libs.private from *.pc (unreasonably they are all the same)
171 Requires: SDL-devel >= 1.2.1
172 Requires: alsa-lib-devel
173 Requires: bzip2-devel
174 Requires: celt-devel >= 0.11.0
175 %{?with_nonfree:Requires: faac-devel}
176 Requires: fontconfig-devel
177 Requires: freetype-devel
178 Requires: jack-audio-connection-kit-devel
179 %{?with_flite:Requires: flite-devel}
180 Requires: lame-libs-devel >= 3.98.3
181 %{?with_aacplus:Requires: libaacplus-devel >= 2.0.0}
182 Requires: libass-devel
183 Requires: libavc1394-devel
184 Requires: libbluray-devel
185 Requires: libcdio-devel
186 Requires: libdc1394-devel >= 2
187 Requires: libgsm-devel
188 Requires: libiec61883-devel
189 Requires: libmodplug-devel
190 Requires: libnut-devel
191 Requires: libraw1394-devel >= 2
192 Requires: librtmp-devel
193 Requires: libtheora-devel >= 1.0-0.beta3
194 %{?with_va:Requires: libva-devel >= 1.0.3}
195 Requires: libvorbis-devel
196 %{?with_vpx:Requires: libvpx-devel >= 0.9.6}
197 %{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245}
198 Requires: opencore-amr-devel
199 Requires: openjpeg-devel >= 1.5
200 Requires: schroedinger-devel
201 Requires: speex-devel >= 1:1.2-rc1
202 Requires: twolame-devel
203 Requires: vo-aacenc-devel
204 Requires: vo-amrwbenc-devel
206 Requires: xorg-lib-libXext-devel
207 Requires: xorg-lib-libXfixes-devel
208 Requires: xvid-devel >= 1:1.1.0
210 Obsoletes: libpostproc-devel
215 %description devel -l pl.UTF-8
216 Pliki nagłówkowe ffmpeg.
219 Summary: ffmpeg static libraries
220 Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
221 Group: Development/Libraries
222 Requires: %{name}-devel = %{version}-%{release}
225 ffmpeg static libraries (libavcodec and libavformat).
227 %description static -l pl.UTF-8
228 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
231 Summary: FFplay - SDL-based media player
232 Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
233 Group: Applications/Multimedia
234 Requires: %{name}-libs = %{version}-%{release}
237 FFplay is a very simple and portable media player using the FFmpeg
238 libraries and the SDL library. It is mostly used as a test bench for
239 the various APIs of FFmpeg.
241 %description ffplay -l pl.UTF-8
242 FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
243 bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
244 testowania różnych API FFmpeg.
247 Summary: FFserver video server
248 Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
250 Requires(post,preun): /sbin/chkconfig
251 Requires: %{name}-libs = %{version}-%{release}
252 Requires: rc-scripts >= 0.4.0.10
254 %description ffserver
255 FFserver is a streaming server for both audio and video. It supports
256 several live feeds, streaming from files and time shifting on live
257 feeds (you can seek to positions in the past on each live feed,
258 provided you specify a big enough feed storage in ffserver.conf).
260 %description ffserver -l pl.UTF-8
261 FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
262 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
263 czasie dla źródeł na żywo (można przeskakiwać na położenia w
264 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
265 dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
273 # package the grep result for mplayer, the result formatted as ./mplayer/configure
274 cat <<EOF > ffmpeg-avconfig
276 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
277 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
278 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
279 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
280 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
281 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
282 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
284 cat <<'EOF' >> ffmpeg-avconfig
288 echo $_libavdecoders_all
291 echo $_libavencoders_all
294 echo $_libavparsers_all
300 echo $_libavdemuxers_all
303 echo $_libavmuxers_all
306 echo $_libavprotocols_all
328 # - it's not autoconf configure
329 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
331 --arch=%{_target_base_arch} \
332 --prefix=%{_prefix} \
333 --libdir=%{_libdir} \
334 --shlibdir=%{_libdir} \
335 --mandir=%{_mandir} \
336 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
337 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
340 --disable-optimizations \
341 --disable-stripping \
343 --enable-avresample \
347 --enable-fontconfig \
348 %{?with_frei0r:--enable-frei0r} \
349 %{?with_aacplus:--enable-libaacplus} \
352 %{?with_libcaca:--enable-libcaca} \
356 %{?with_flite:--enable-libflite} \
357 --enable-libfreetype \
359 --enable-libiec61883 \
360 --enable-libmodplug \
361 --enable-libmp3lame \
363 --enable-libopencore-amrnb \
364 --enable-libopencore-amrwb \
365 %{?with_opencv:--enable-libopencv} \
366 --enable-libopenjpeg \
368 %{?with_pulseaudio:--enable-libpulse} \
370 --enable-libschroedinger \
373 --enable-libtwolame \
374 %{?with_utvideo:--enable-libutvideo} \
376 --enable-libvo-aacenc \
377 --enable-libvo-amrwbenc \
379 %{?with_vpx:--enable-libvpx} \
380 %{?with_x264:--enable-libx264} \
383 %{?with_openal:--enable-openal} \
388 %{?with_va:--enable-vaapi} \
391 %ifnarch %{ix86} %{x8664}
401 --enable-runtime-cpudetect
403 # force oldscaler build
404 %{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
409 # CC_O to add -c to commandline. makefile should be patched
410 %{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
413 rm -rf $RPM_BUILD_ROOT
414 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
415 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
416 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
419 DESTDIR=$RPM_BUILD_ROOT \
422 cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
423 cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
424 cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
425 cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
426 cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
427 for a in libavutil/*/bswap.h; do
428 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
430 cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
431 cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
432 # for lim-omx ffmpeg components
433 cp -a libavcodec/audioconvert.h $RPM_BUILD_ROOT%{_includedir}/libavcodec
435 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
436 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
437 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
438 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
439 install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
441 # install as ffmpeg-avconfig to avoid with possible programs looking for
442 # ffmpeg-config and expecting --libs output from it which is not implemented
443 # simple to do (by querying pkgconfig), but why?
444 install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
447 rm -rf $RPM_BUILD_ROOT
449 %post libs -p /sbin/ldconfig
450 %postun libs -p /sbin/ldconfig
453 %groupadd -g 167 ffserver
454 %useradd -g ffserver -u 167 ffserver
457 /sbin/chkconfig --add ffserver
458 %service ffserver restart
461 if [ "$1" = 0 ]; then
462 %service ffserver stop
463 /sbin/chkconfig --del ffserver
467 if [ "$1" = 0 ]; then
469 %groupremove ffserver
473 %defattr(644,root,root,755)
474 %doc CREDITS LICENSE MAINTAINERS README doc/{APIchanges,RELEASE_NOTES} %{?with_doc:doc/*.html}
475 %attr(755,root,root) %{_bindir}/ffmpeg
476 %attr(755,root,root) %{_bindir}/ffprobe
477 %attr(755,root,root) %{_bindir}/qt-faststart
478 %dir %{_datadir}/ffmpeg
479 %{_datadir}/ffmpeg/*.ffpreset
480 %{_datadir}/ffmpeg/ffprobe.xsd
481 %{?with_doc:%{_mandir}/man1/ffmpeg.1*}
482 %{?with_doc:%{_mandir}/man1/ffprobe.1*}
485 %defattr(644,root,root,755)
486 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
487 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.54
488 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
489 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.54
490 %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
491 %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.3
492 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
493 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.54
494 %attr(755,root,root) %{_libdir}/libavresample.so.*.*.*
495 %attr(755,root,root) %ghost %{_libdir}/libavresample.so.0
496 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
497 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
498 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
499 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.52
500 %attr(755,root,root) %{_libdir}/libswresample.so.*.*.*
501 %attr(755,root,root) %ghost %{_libdir}/libswresample.so.0
502 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
503 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
506 %defattr(644,root,root,755)
507 %doc doc/optimization.txt
508 %attr(755,root,root) %{_bindir}/ffmpeg-avconfig
509 %attr(755,root,root) %{_libdir}/libavcodec.so
510 %attr(755,root,root) %{_libdir}/libavdevice.so
511 %attr(755,root,root) %{_libdir}/libavfilter.so
512 %attr(755,root,root) %{_libdir}/libavformat.so
513 %attr(755,root,root) %{_libdir}/libavresample.so
514 %attr(755,root,root) %{_libdir}/libavutil.so
515 %attr(755,root,root) %{_libdir}/libpostproc.so
516 %attr(755,root,root) %{_libdir}/libswresample.so
517 %attr(755,root,root) %{_libdir}/libswscale.so
518 %{_includedir}/ffmpeg
519 %{_includedir}/libavcodec
520 %{_includedir}/libavdevice
521 %{_includedir}/libavfilter
522 %{_includedir}/libavformat
523 %{_includedir}/libavresample
524 %{_includedir}/libavutil
525 %{_includedir}/libpostproc
526 %{_includedir}/libswresample
527 %{_includedir}/libswscale
528 %{_pkgconfigdir}/libavcodec.pc
529 %{_pkgconfigdir}/libavdevice.pc
530 %{_pkgconfigdir}/libavfilter.pc
531 %{_pkgconfigdir}/libavformat.pc
532 %{_pkgconfigdir}/libavresample.pc
533 %{_pkgconfigdir}/libavutil.pc
534 %{_pkgconfigdir}/libpostproc.pc
535 %{_pkgconfigdir}/libswresample.pc
536 %{_pkgconfigdir}/libswscale.pc
539 %defattr(644,root,root,755)
540 %{_libdir}/libavcodec.a
541 %{_libdir}/libavdevice.a
542 %{_libdir}/libavfilter.a
543 %{_libdir}/libavformat.a
544 %{_libdir}/libavresample.a
545 %{_libdir}/libavutil.a
546 %{_libdir}/libpostproc.a
547 %{_libdir}/libswresample.a
548 %{_libdir}/libswscale.a
551 %defattr(644,root,root,755)
552 %attr(755,root,root) %{_bindir}/ffplay
553 %{?with_doc:%{_mandir}/man1/ffplay.1*}
556 %defattr(644,root,root,755)
557 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
558 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
559 %attr(755,root,root) %{_sbindir}/ffserver
560 %attr(754,root,root) /etc/rc.d/init.d/ffserver
561 %{?with_doc:%{_mandir}/man1/ffserver.1*}
562 %dir %attr(770,root,ffserver) /var/cache/ffserver
563 %dir %attr(770,root,ffserver) /var/log/ffserver