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