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