2 # - is bug803 patch still needed? the code changed somehow
5 %bcond_with nonfree # non free options of package (currently: faac)
6 %bcond_without autoreqdep # don't care about package name deps generated by rpm
7 %bcond_without va # VAAPI (Video Acceleration API)
8 %bcond_without vpx # VP8, a high-quality video codec
9 %bcond_without doc # don't build docs
11 Summary: FFmpeg - a very fast video and audio converter
12 Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
16 # LGPL or GPL, chosen at configure time (GPL version is more featured)
17 # (postprocessing, some filters, x264, xavs, xvid, x11grab)
18 # using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
19 License: GPL v3+ with LGPL v3+ parts
20 Group: Applications/Multimedia
21 Source0: http://ffmpeg.org/releases/%{name}-%{version}.tar.bz2
22 # Source0-md5: 7e9b8c8a6952de0c477027e48249f3ed
23 Source1: ffserver.init
24 Source2: ffserver.sysconfig
25 Source3: ffserver.conf
26 Patch0: %{name}-bug-803.patch
27 Patch1: %{name}-gsm.patch
28 URL: http://www.ffmpeg.org/
29 BuildRequires: SDL-devel
30 BuildRequires: alsa-lib-devel
31 BuildRequires: bzip2-devel
32 BuildRequires: celt-devel
33 BuildRequires: dirac-devel >= 1.0.0
34 %{?with_nonfree:BuildRequires: faac-devel}
35 BuildRequires: freetype-devel
36 BuildRequires: frei0r-devel
38 # require version with altivec support fixed
39 BuildRequires: gcc >= 5:3.3.2-3
41 BuildRequires: jack-audio-connection-kit-devel
42 BuildRequires: lame-libs-devel >= 3.98.3
43 BuildRequires: libdc1394-devel
44 BuildRequires: libgsm-devel
45 BuildRequires: libnut-devel
46 BuildRequires: libraw1394-devel
47 BuildRequires: librtmp-devel
48 BuildRequires: libtheora-devel >= 1.0-0.beta3
49 BuildRequires: libtool >= 2:1.4d-3
50 %{?with_va:BuildRequires: libva-devel >= 1.0.3}
51 BuildRequires: libvdpau-devel
52 BuildRequires: libvorbis-devel
53 %{?with_vpx:BuildRequires: libvpx-devel >= 0.9.6}
55 BuildRequires: libx264-devel >= 0.1.3-1.20110625_2245
56 BuildRequires: opencore-amr-devel
57 BuildRequires: openjpeg-devel >= 1.3-2
58 BuildRequires: speex-devel >= 1:1.2-rc1
64 BuildRequires: perl-Encode
65 BuildRequires: perl-tools-pod
66 BuildRequires: pkgconfig
67 BuildRequires: rpmbuild(macros) >= 1.470
68 BuildRequires: schroedinger-devel
69 %{?with_doc:BuildRequires: tetex}
70 %{?with_doc:BuildRequires: texi2html}
71 %{?with_doc:BuildRequires: texinfo}
72 BuildRequires: vo-aacenc-devel
73 BuildRequires: vo-amrwbenc-devel
74 BuildRequires: xavs-devel
75 BuildRequires: xorg-lib-libXext-devel
76 BuildRequires: xorg-lib-libXfixes-devel
77 BuildRequires: xvid-devel >= 1:1.1.0
78 BuildRequires: zlib-devel
79 %{?with_autoreqdep:BuildConflicts: libpostproc}
80 Requires: %{name}-libs = %{version}-%{release}
81 Requires: xvid >= 1:1.1.0
82 Obsoletes: libpostproc
83 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85 %define _noautoreqdep libGL.so.1 libGLU.so.1
87 %define specflags -fno-strict-aliasing
89 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
90 %define specflags_ia32 -fomit-frame-pointer
91 # -mmmx is needed to enable <mmintrin.h> code.
92 %define specflags_i586 -mmmx
93 %define specflags_i686 -mmmx
94 %define specflags_ppc -fPIC
97 FFmpeg is a complete solution to record, convert and stream audio and
98 video. It is a command line tool to convert one video file format to
99 another. It also supports grabbing and encoding in real time from a TV
102 %description -l pl.UTF-8
103 FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
104 strumieni dźwięku i obrazu. Jest to działające z linii poleceń
105 narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
106 także przechwytywanie i kodowanie w czasie rzeczywistym z karty
110 Summary: ffmpeg libraries
111 Summary(pl.UTF-8): Biblioteki ffmpeg
115 This package contains the ffmpeg shared libraries:
116 - the codec library (libavcodec). It supports most existing encoding
117 formats (MPEG, DivX, MPEG4, AC3, DV...),
118 - demuxer library (libavformat). It supports most existing file
119 formats (AVI, MPEG, OGG, Matroska, ASF...),
120 - video postprocessing library (libpostproc).
122 %description libs -l pl.UTF-8
123 Ten pakiet zawiera biblioteki współdzielone ffmpeg:
124 - bibliotekę kodeków (libavcodec); obsługuje większość istniejących
125 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
126 - bibliotekę demuksera (libavformat); obsługuje większość istniejących
127 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
128 - bibliotekę postprocessingu (libpostproc).
131 Summary: ffmpeg header files
132 Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
133 Group: Development/Libraries
134 Requires: %{name}-libs = %{version}-%{release}
135 # Libs.private from *.pc (unreasonably they are all the same)
137 Requires: alsa-lib-devel
138 Requires: bzip2-devel
140 Requires: dirac-devel >= 1.0.0
141 %{?with_nonfree:Requires: faac-devel}
142 Requires: jack-audio-connection-kit-devel
143 Requires: lame-libs-devel >= 3.98.3
144 Requires: libdc1394-devel
145 Requires: libgsm-devel
146 Requires: libnut-devel
147 Requires: libraw1394-devel
148 Requires: librtmp-devel
149 Requires: libtheora-devel >= 1.0-0.beta3
150 %{?with_va:Requires: libva-devel >= 1.0.3}
151 Requires: libvorbis-devel
152 %{?with_vpx:Requires: libvpx-devel >= 0.9.6}
153 Requires: libx264-devel >= 0.1.3-1.20110625_2245
154 Requires: opencore-amr-devel
155 Requires: openjpeg-devel >= 1.3-2
156 Requires: schroedinger-devel
157 Requires: speex-devel >= 1:1.2-rc1
158 Requires: vo-aacenc-devel
159 Requires: vo-amrwbenc-devel
161 Requires: xorg-lib-libXext-devel
162 Requires: xorg-lib-libXfixes-devel
163 Requires: xvid-devel >= 1:1.1.0
165 Obsoletes: libpostproc-devel
170 %description devel -l pl.UTF-8
171 Pliki nagłówkowe ffmpeg.
174 Summary: ffmpeg static libraries
175 Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
176 Group: Development/Libraries
177 Requires: %{name}-devel = %{version}-%{release}
180 ffmpeg static libraries (libavcodec and libavformat).
182 %description static -l pl.UTF-8
183 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
186 Summary: FFplay - SDL-based media player
187 Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
188 Group: Applications/Multimedia
189 Requires: %{name}-libs = %{version}-%{release}
192 FFplay is a very simple and portable media player using the FFmpeg
193 libraries and the SDL library. It is mostly used as a test bench for
194 the various APIs of FFmpeg.
196 %description ffplay -l pl.UTF-8
197 FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
198 bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
199 testowania różnych API FFmpeg.
202 Summary: FFserver video server
203 Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
205 Requires(post,preun): /sbin/chkconfig
206 Requires: %{name}-libs = %{version}-%{release}
207 Requires: rc-scripts >= 0.4.0.10
209 %description ffserver
210 FFserver is a streaming server for both audio and video. It supports
211 several live feeds, streaming from files and time shifting on live
212 feeds (you can seek to positions in the past on each live feed,
213 provided you specify a big enough feed storage in ffserver.conf).
215 %description ffserver -l pl.UTF-8
216 FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
217 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
218 czasie dla źródeł na żywo (można przeskakiwać na położenia w
219 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
220 dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
227 # package the grep result for mplayer, the result formatted as ./mplayer/configure
228 cat <<EOF > ffmpeg-avconfig
230 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
231 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
232 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
233 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
234 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
235 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
236 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
238 cat <<'EOF' >> ffmpeg-avconfig
242 echo $_libavdecoders_all
245 echo $_libavencoders_all
248 echo $_libavparsers_all
254 echo $_libavdemuxers_all
257 echo $_libavmuxers_all
260 echo $_libavprotocols_all
282 # - it's not autoconf configure
283 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
285 --arch=%{_target_base_arch} \
286 --prefix=%{_prefix} \
287 --libdir=%{_libdir} \
288 --shlibdir=%{_libdir} \
289 --mandir=%{_mandir} \
291 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
292 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
294 --disable-optimizations \
295 --disable-stripping \
304 --enable-libmp3lame \
306 --enable-libopencore-amrnb \
307 --enable-libopencore-amrwb \
308 --enable-libopenjpeg \
310 --enable-libschroedinger \
313 --enable-libvo-aacenc \
314 --enable-libvo-amrwbenc \
316 %{?with_vpx:--enable-libvpx} \
326 %ifnarch %{ix86} %{x8664}
336 --enable-runtime-cpudetect
338 # --enable-libopencv would cause dependency loop
340 # force oldscaler build
341 %{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
346 # CC_O to add -c to commandline. makefile should be patched
347 %{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
350 rm -rf $RPM_BUILD_ROOT
351 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
352 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
353 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
356 DESTDIR=$RPM_BUILD_ROOT \
359 cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
360 cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
361 cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
362 cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
363 cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
364 for a in libavutil/*/bswap.h; do
365 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
367 cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
368 cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
370 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
371 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
372 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
373 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
374 install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
376 # install as ffmpeg-avconfig to avoid with possible programs looking for
377 # ffmpeg-config and expecting --libs output from it which is not implemented
378 # simple to do (by querying pkgconfig), but why?
379 install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
382 rm -rf $RPM_BUILD_ROOT
384 %post libs -p /sbin/ldconfig
385 %postun libs -p /sbin/ldconfig
388 %groupadd -g 167 ffserver
389 %useradd -g ffserver -u 167 ffserver
392 /sbin/chkconfig --add ffserver
393 %service ffserver restart
396 if [ "$1" = 0 ]; then
397 %service ffserver stop
398 /sbin/chkconfig --del ffserver
402 if [ "$1" = 0 ]; then
404 %groupremove ffserver
408 %defattr(644,root,root,755)
409 %doc CREDITS LICENSE MAINTAINERS README doc/{APIchanges,RELEASE_NOTES,TODO} %{?with_doc:doc/*.html}
410 %attr(755,root,root) %{_bindir}/ffmpeg
411 %attr(755,root,root) %{_bindir}/ffprobe
412 %attr(755,root,root) %{_bindir}/qt-faststart
413 %dir %{_datadir}/ffmpeg
414 %{_datadir}/ffmpeg/*.ffpreset
415 %{?with_doc:%{_mandir}/man1/ffmpeg.1*}
416 %{?with_doc:%{_mandir}/man1/ffprobe.1*}
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
421 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.53
422 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
423 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.53
424 %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
425 %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.2
426 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
427 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.53
428 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
429 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
430 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
431 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51
432 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
433 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
436 %defattr(644,root,root,755)
437 %doc doc/optimization.txt
438 %attr(755,root,root) %{_bindir}/ffmpeg-avconfig
439 %attr(755,root,root) %{_libdir}/libavcodec.so
440 %attr(755,root,root) %{_libdir}/libavdevice.so
441 %attr(755,root,root) %{_libdir}/libavfilter.so
442 %attr(755,root,root) %{_libdir}/libavformat.so
443 %attr(755,root,root) %{_libdir}/libavutil.so
444 %attr(755,root,root) %{_libdir}/libpostproc.so
445 %attr(755,root,root) %{_libdir}/libswscale.so
446 %{_includedir}/ffmpeg
447 %{_includedir}/libavcodec
448 %{_includedir}/libavdevice
449 %{_includedir}/libavfilter
450 %{_includedir}/libavformat
451 %{_includedir}/libavutil
452 %{_includedir}/libpostproc
453 %{_includedir}/libswscale
454 %{_pkgconfigdir}/libavcodec.pc
455 %{_pkgconfigdir}/libavdevice.pc
456 %{_pkgconfigdir}/libavfilter.pc
457 %{_pkgconfigdir}/libavformat.pc
458 %{_pkgconfigdir}/libavutil.pc
459 %{_pkgconfigdir}/libpostproc.pc
460 %{_pkgconfigdir}/libswscale.pc
463 %defattr(644,root,root,755)
464 %{_libdir}/libavcodec.a
465 %{_libdir}/libavdevice.a
466 %{_libdir}/libavfilter.a
467 %{_libdir}/libavformat.a
468 %{_libdir}/libavutil.a
469 %{_libdir}/libpostproc.a
470 %{_libdir}/libswscale.a
473 %defattr(644,root,root,755)
474 %attr(755,root,root) %{_bindir}/ffplay
475 %{?with_doc:%{_mandir}/man1/ffplay.1*}
478 %defattr(644,root,root,755)
479 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
480 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
481 %attr(755,root,root) %{_sbindir}/ffserver
482 %attr(754,root,root) /etc/rc.d/init.d/ffserver
483 %{?with_doc:%{_mandir}/man1/ffserver.1*}
484 %dir %attr(770,root,ffserver) /var/cache/ffserver
485 %dir %attr(770,root,ffserver) /var/log/ffserver