2 # - is bug803 patch still needed? the code changed somehow
3 # - libnut enabled no (http://www.nut-container.org/)
6 %bcond_with nonfree # non free options of package
7 %bcond_without autoreqdep # don't care about package name deps generated by rpm
8 %bcond_without va # VAAPI (Video Acceleration API)
9 %bcond_without vpx # VP8, a high-quality video codec
10 %bcond_without doc # don't build docs
12 Summary: FFmpeg - a very fast video and audio converter
13 Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
17 # LGPL or GPL, chosen at configure time (GPL version is more featured)
18 # (postprocessing, ac3, xvid, x264)
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: celt-devel
32 BuildRequires: dirac-devel >= 1.0.0
33 BuildRequires: faac-devel
34 BuildRequires: freetype-devel
35 BuildRequires: frei0r-devel
37 # require version with altivec support fixed
38 BuildRequires: gcc >= 5:3.3.2-3
40 BuildRequires: jack-audio-connection-kit-devel
41 BuildRequires: lame-libs-devel >= 3.98.3
42 BuildRequires: libdc1394-devel
43 BuildRequires: libgsm-devel
44 BuildRequires: libraw1394-devel
45 BuildRequires: librtmp-devel
46 BuildRequires: libtheora-devel >= 1.0-0.beta3
47 BuildRequires: libtool >= 2:1.4d-3
48 %{?with_va:BuildRequires: libva-devel >= 1.0.3}
49 BuildRequires: libvdpau-devel
50 BuildRequires: libvorbis-devel
51 %{?with_vpx:BuildRequires: libvpx-devel >= 0.9.6}
53 BuildRequires: libx264-devel >= 0.1.3-1.20110625_2245
54 BuildRequires: opencore-amr-devel
55 BuildRequires: openjpeg-devel >= 1.3-2
56 BuildRequires: speex-devel >= 1:1.2-rc1
62 BuildRequires: perl-Encode
63 BuildRequires: perl-tools-pod
64 BuildRequires: pkgconfig
65 BuildRequires: rpmbuild(macros) >= 1.470
66 BuildRequires: schroedinger-devel
67 %{?with_doc:BuildRequires: tetex}
68 %{?with_doc:BuildRequires: texi2html}
69 %{?with_doc:BuildRequires: texinfo}
70 BuildRequires: vo-aacenc-devel
71 BuildRequires: vo-amrwbenc-devel
72 BuildRequires: xavs-devel
73 BuildRequires: xorg-lib-libXext-devel
74 BuildRequires: xorg-lib-libXfixes-devel
75 BuildRequires: xvid-devel >= 1:1.1.0
76 BuildRequires: zlib-devel
77 %{?with_autoreqdep:BuildConflicts: libpostproc}
78 Requires: %{name}-libs = %{version}-%{release}
79 Requires: xvid >= 1:1.1.0
80 Obsoletes: libpostproc
81 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83 %define _noautoreqdep libGL.so.1 libGLU.so.1
85 %define specflags -fno-strict-aliasing
87 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
88 %define specflags_ia32 -fomit-frame-pointer
89 # -mmmx is needed to enable <mmintrin.h> code.
90 %define specflags_i586 -mmmx
91 %define specflags_i686 -mmmx
92 %define specflags_ppc -fPIC
95 FFmpeg is a complete solution to record, convert and stream audio and
96 video. It is a command line tool to convert one video file format to
97 another. It also supports grabbing and encoding in real time from a TV
100 %description -l pl.UTF-8
101 FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
102 strumieni dźwięku i obrazu. Jest to działające z linii poleceń
103 narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
104 także przechwytywanie i kodowanie w czasie rzeczywistym z karty
108 Summary: ffmpeg libraries
109 Summary(pl.UTF-8): Biblioteki ffmpeg
113 This package contains the ffmpeg shared libraries:
114 - the codec library (libavcodec). It supports most existing encoding
115 formats (MPEG, DivX, MPEG4, AC3, DV...),
116 - demuxer library (libavformat). It supports most existing file
117 formats (AVI, MPEG, OGG, Matroska, ASF...),
118 - video postprocessing library (libpostproc).
120 %description libs -l pl.UTF-8
121 Ten pakiet zawiera biblioteki współdzielone ffmpeg:
122 - bibliotekę kodeków (libavcodec); obsługuje większość istniejących
123 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
124 - bibliotekę demuksera (libavformat); obsługuje większość istniejących
125 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
126 - bibliotekę postprocessingu (libpostproc).
129 Summary: ffmpeg header files
130 Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
131 Group: Development/Libraries
132 Requires: %{name}-libs = %{version}-%{release}
134 Requires: dirac-devel
136 Requires: lame-libs-devel
137 Requires: libgsm-devel
138 Requires: libraw1394-devel
139 Requires: libtheora-devel >= 1.0-0.alpha7
140 Requires: libvorbis-devel
141 Requires: libx264-devel >= 0.1.2-1.20060828_2245.1
142 Requires: xvid-devel >= 1:1.1.0
144 Obsoletes: libpostproc-devel
149 %description devel -l pl.UTF-8
150 Pliki nagłówkowe ffmpeg.
153 Summary: ffmpeg static libraries
154 Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
155 Group: Development/Libraries
156 Requires: %{name}-devel = %{version}-%{release}
159 ffmpeg static libraries (libavcodec and libavformat).
161 %description static -l pl.UTF-8
162 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
165 Summary: FFplay - SDL-based media player
166 Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
167 Group: Applications/Multimedia
168 Requires: %{name}-libs = %{version}-%{release}
171 FFplay is a very simple and portable media player using the FFmpeg
172 libraries and the SDL library. It is mostly used as a test bench for
173 the various APIs of FFmpeg.
175 %description ffplay -l pl.UTF-8
176 FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
177 bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
178 testowania różnych API FFmpeg.
181 Summary: FFserver video server
182 Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
184 Requires(post,preun): /sbin/chkconfig
185 Requires: %{name}-libs = %{version}-%{release}
186 Requires: rc-scripts >= 0.4.0.10
188 %description ffserver
189 FFserver is a streaming server for both audio and video. It supports
190 several live feeds, streaming from files and time shifting on live
191 feeds (you can seek to positions in the past on each live feed,
192 provided you specify a big enough feed storage in ffserver.conf).
194 %description ffserver -l pl.UTF-8
195 FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
196 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
197 czasie dla źródeł na żywo (można przeskakiwać na położenia w
198 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
199 dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
206 # package the grep result for mplayer, the result formatted as ./mplayer/configure
207 cat <<EOF > ffmpeg-avconfig
209 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
210 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
211 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
212 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
213 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
214 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
215 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
217 cat <<'EOF' >> ffmpeg-avconfig
221 echo $_libavdecoders_all
224 echo $_libavencoders_all
227 echo $_libavparsers_all
233 echo $_libavdemuxers_all
236 echo $_libavmuxers_all
239 echo $_libavprotocols_all
261 # - it's not autoconf configure
262 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
264 --arch=%{_target_base_arch} \
265 --prefix=%{_prefix} \
266 --libdir=%{_libdir} \
267 --shlibdir=%{_libdir} \
268 --mandir=%{_mandir} \
270 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
271 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
273 --disable-optimizations \
274 --disable-stripping \
283 --enable-libmp3lame \
284 --enable-libopencore-amrnb \
285 --enable-libopencore-amrwb \
286 --enable-libopenjpeg \
288 --enable-libschroedinger \
291 --enable-libvo-aacenc \
292 --enable-libvo-amrwbenc \
294 %{?with_vpx:--enable-libvpx} \
304 %ifnarch %{ix86} %{x8664}
314 --enable-runtime-cpudetect
316 # --enable-libopencv would cause dependency loop
318 # force oldscaler build
319 %{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
324 # CC_O to add -c to commandline. makefile should be patched
325 %{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
328 rm -rf $RPM_BUILD_ROOT
329 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
330 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
331 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
334 DESTDIR=$RPM_BUILD_ROOT \
337 cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
338 cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
339 cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
340 cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
341 cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
342 for a in libavutil/*/bswap.h; do
343 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
345 cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
346 cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
348 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
349 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
350 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
351 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
352 install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
354 # install as ffmpeg-avconfig to avoid with possible programs looking for
355 # ffmpeg-config and expecting --libs output from it which is not implemented
356 # simple to do (by querying pkgconfig), but why?
357 install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
360 rm -rf $RPM_BUILD_ROOT
362 %post libs -p /sbin/ldconfig
363 %postun libs -p /sbin/ldconfig
366 %groupadd -g 167 ffserver
367 %useradd -g ffserver -u 167 ffserver
370 /sbin/chkconfig --add ffserver
371 %service ffserver restart
374 if [ "$1" = 0 ]; then
375 %service ffserver stop
376 /sbin/chkconfig --del ffserver
380 if [ "$1" = 0 ]; then
382 %groupremove ffserver
386 %defattr(644,root,root,755)
387 %doc CREDITS LICENSE MAINTAINERS README doc/{APIchanges,RELEASE_NOTES,TODO} %{?with_doc:doc/*.html}
388 %attr(755,root,root) %{_bindir}/ffmpeg
389 %attr(755,root,root) %{_bindir}/ffprobe
390 %attr(755,root,root) %{_bindir}/qt-faststart
391 %dir %{_datadir}/ffmpeg
392 %{_datadir}/ffmpeg/*.ffpreset
393 %{?with_doc:%{_mandir}/man1/ffmpeg.1*}
394 %{?with_doc:%{_mandir}/man1/ffprobe.1*}
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
399 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.53
400 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
401 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.53
402 %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
403 %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.2
404 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
405 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.53
406 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
407 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
408 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
409 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51
410 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
411 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
414 %defattr(644,root,root,755)
415 %doc doc/optimization.txt
416 %attr(755,root,root) %{_bindir}/ffmpeg-avconfig
417 %attr(755,root,root) %{_libdir}/libavcodec.so
418 %attr(755,root,root) %{_libdir}/libavdevice.so
419 %attr(755,root,root) %{_libdir}/libavfilter.so
420 %attr(755,root,root) %{_libdir}/libavformat.so
421 %attr(755,root,root) %{_libdir}/libavutil.so
422 %attr(755,root,root) %{_libdir}/libpostproc.so
423 %attr(755,root,root) %{_libdir}/libswscale.so
424 %{_includedir}/ffmpeg
425 %{_includedir}/libavcodec
426 %{_includedir}/libavdevice
427 %{_includedir}/libavfilter
428 %{_includedir}/libavformat
429 %{_includedir}/libavutil
430 %{_includedir}/libpostproc
431 %{_includedir}/libswscale
432 %{_pkgconfigdir}/libavcodec.pc
433 %{_pkgconfigdir}/libavdevice.pc
434 %{_pkgconfigdir}/libavfilter.pc
435 %{_pkgconfigdir}/libavformat.pc
436 %{_pkgconfigdir}/libavutil.pc
437 %{_pkgconfigdir}/libpostproc.pc
438 %{_pkgconfigdir}/libswscale.pc
441 %defattr(644,root,root,755)
442 %{_libdir}/libavcodec.a
443 %{_libdir}/libavdevice.a
444 %{_libdir}/libavfilter.a
445 %{_libdir}/libavformat.a
446 %{_libdir}/libavutil.a
447 %{_libdir}/libpostproc.a
448 %{_libdir}/libswscale.a
451 %defattr(644,root,root,755)
452 %attr(755,root,root) %{_bindir}/ffplay
453 %{?with_doc:%{_mandir}/man1/ffplay.1*}
456 %defattr(644,root,root,755)
457 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
458 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
459 %attr(755,root,root) %{_sbindir}/ffserver
460 %attr(754,root,root) /etc/rc.d/init.d/ffserver
461 %{?with_doc:%{_mandir}/man1/ffserver.1*}
462 %dir %attr(770,root,ffserver) /var/cache/ffserver
463 %dir %attr(770,root,ffserver) /var/log/ffserver