2 # - is bug803 patch still needed? the code changed somehow
3 # - libnut enabled no (http://www.nut-container.org/)
5 # - libvo_aacenc, libvo_amrwbenc?
9 %bcond_with nonfree # non free options of package
10 %bcond_without autoreqdep # don't care about package name deps generated by rpm
11 %bcond_without va # VAAPI (Video Acceleration API)
12 %bcond_without vpx # VP8, a high-quality video codec
13 %bcond_without doc # don't build docs
15 Summary: FFmpeg - a very fast video and audio converter
16 Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
20 # LGPL or GPL, chosen at configure time (GPL version is more featured)
21 # (postprocessing, ac3, xvid, x264)
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: 7e9b8c8a6952de0c477027e48249f3ed
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: celt-devel
35 BuildRequires: dirac-devel >= 1.0.0
36 BuildRequires: faac-devel
37 BuildRequires: freetype-devel
39 # require version with altivec support fixed
40 BuildRequires: gcc >= 5:3.3.2-3
42 BuildRequires: jack-audio-connection-kit-devel
43 BuildRequires: lame-libs-devel >= 3.98.3
44 BuildRequires: libdc1394-devel
45 BuildRequires: libgsm-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.1}
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: xorg-lib-libXext-devel
73 BuildRequires: xorg-lib-libXfixes-devel
74 BuildRequires: xvid-devel >= 1:1.1.0
75 BuildRequires: zlib-devel
76 %{?with_autoreqdep:BuildConflicts: libpostproc}
77 Requires: %{name}-libs = %{version}-%{release}
78 Requires: xvid >= 1:1.1.0
79 Obsoletes: libpostproc
80 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 %define _noautoreqdep libGL.so.1 libGLU.so.1
84 %define specflags -fno-strict-aliasing
86 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
87 %define specflags_ia32 -fomit-frame-pointer
88 # -mmmx is needed to enable <mmintrin.h> code.
89 %define specflags_i586 -mmmx
90 %define specflags_i686 -mmmx
91 %define specflags_ppc -fPIC
94 FFmpeg is a complete solution to record, convert and stream audio and
95 video. It is a command line tool to convert one video file format to
96 another. It also supports grabbing and encoding in real time from a TV
99 %description -l pl.UTF-8
100 FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
101 strumieni dźwięku i obrazu. Jest to działające z linii poleceń
102 narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
103 także przechwytywanie i kodowanie w czasie rzeczywistym z karty
107 Summary: ffmpeg libraries
108 Summary(pl.UTF-8): Biblioteki ffmpeg
112 This package contains the ffmpeg shared libraries:
113 - the codec library (libavcodec). It supports most existing encoding
114 formats (MPEG, DivX, MPEG4, AC3, DV...),
115 - demuxer library (libavformat). It supports most existing file
116 formats (AVI, MPEG, OGG, Matroska, ASF...),
117 - video postprocessing library (libpostproc).
119 %description libs -l pl.UTF-8
120 Ten pakiet zawiera biblioteki współdzielone ffmpeg:
121 - bibliotekę kodeków (libavcodec); obsługuje większość istniejących
122 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
123 - bibliotekę demuksera (libavformat); obsługuje większość istniejących
124 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
125 - bibliotekę postprocessingu (libpostproc).
128 Summary: ffmpeg header files
129 Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
130 Group: Development/Libraries
131 Requires: %{name}-libs = %{version}-%{release}
133 Requires: dirac-devel
135 Requires: lame-libs-devel
136 Requires: libgsm-devel
137 Requires: libraw1394-devel
138 Requires: libtheora-devel >= 1.0-0.alpha7
139 Requires: libvorbis-devel
140 Requires: libx264-devel >= 0.1.2-1.20060828_2245.1
141 Requires: xvid-devel >= 1:1.1.0
143 Obsoletes: libpostproc-devel
148 %description devel -l pl.UTF-8
149 Pliki nagłówkowe ffmpeg.
152 Summary: ffmpeg static libraries
153 Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
154 Group: Development/Libraries
155 Requires: %{name}-devel = %{version}-%{release}
158 ffmpeg static libraries (libavcodec and libavformat).
160 %description static -l pl.UTF-8
161 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
164 Summary: FFplay - SDL-based media player
165 Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
166 Group: Applications/Multimedia
167 Requires: %{name}-libs = %{version}-%{release}
170 FFplay is a very simple and portable media player using the FFmpeg
171 libraries and the SDL library. It is mostly used as a test bench for
172 the various APIs of FFmpeg.
174 %description ffplay -l pl.UTF-8
175 FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
176 bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
177 testowania różnych API FFmpeg.
180 Summary: FFserver video server
181 Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
183 Requires(post,preun): /sbin/chkconfig
184 Requires: %{name}-libs = %{version}-%{release}
185 Requires: rc-scripts >= 0.4.0.10
187 %description ffserver
188 FFserver is a streaming server for both audio and video. It supports
189 several live feeds, streaming from files and time shifting on live
190 feeds (you can seek to positions in the past on each live feed,
191 provided you specify a big enough feed storage in ffserver.conf).
193 %description ffserver -l pl.UTF-8
194 FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
195 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
196 czasie dla źródeł na żywo (można przeskakiwać na położenia w
197 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
198 dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
205 # package the grep result for mplayer, the result formatted as ./mplayer/configure
206 cat <<EOF > ffmpeg-avconfig
208 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
209 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
210 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
211 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
212 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
213 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
214 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
216 cat <<'EOF' >> ffmpeg-avconfig
220 echo $_libavdecoders_all
223 echo $_libavencoders_all
226 echo $_libavparsers_all
232 echo $_libavdemuxers_all
235 echo $_libavmuxers_all
238 echo $_libavprotocols_all
260 # - it's not autoconf configure
261 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
263 --arch=%{_target_base_arch} \
264 --prefix=%{_prefix} \
265 --libdir=%{_libdir} \
266 --shlibdir=%{_libdir} \
267 --mandir=%{_mandir} \
269 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
270 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
272 --disable-optimizations \
273 --disable-stripping \
281 --enable-libmp3lame \
282 --enable-libopencore-amrnb \
283 --enable-libopencore-amrwb \
284 --enable-libopenjpeg \
286 --enable-libschroedinger \
290 %{?with_vpx:--enable-libvpx} \
299 %ifnarch %{ix86} %{x8664}
309 --enable-runtime-cpudetect
311 # --enable-libopencv would cause dependency loop
313 # force oldscaler build
314 %{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
319 # CC_O to add -c to commandline. makefile should be patched
320 %{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
323 rm -rf $RPM_BUILD_ROOT
324 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
325 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
326 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
329 DESTDIR=$RPM_BUILD_ROOT \
332 cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
333 cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
334 cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
335 cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
336 cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
337 for a in libavutil/*/bswap.h; do
338 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
340 cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
341 cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
343 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
344 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
345 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
346 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
347 install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
349 # install as ffmpeg-avconfig to avoid with possible programs looking for
350 # ffmpeg-config and expecting --libs output from it which is not implemented
351 # simple to do (by querying pkgconfig), but why?
352 install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
355 rm -rf $RPM_BUILD_ROOT
357 %post libs -p /sbin/ldconfig
358 %postun libs -p /sbin/ldconfig
361 %groupadd -g 167 ffserver
362 %useradd -g ffserver -u 167 ffserver
365 /sbin/chkconfig --add ffserver
366 %service ffserver restart
369 if [ "$1" = 0 ]; then
370 %service ffserver stop
371 /sbin/chkconfig --del ffserver
375 if [ "$1" = 0 ]; then
377 %groupremove ffserver
381 %defattr(644,root,root,755)
382 %doc CREDITS LICENSE MAINTAINERS README doc/{APIchanges,RELEASE_NOTES,TODO} %{?with_doc:doc/*.html}
383 %attr(755,root,root) %{_bindir}/ffmpeg
384 %attr(755,root,root) %{_bindir}/ffprobe
385 %attr(755,root,root) %{_bindir}/qt-faststart
386 %dir %{_datadir}/ffmpeg
387 %{_datadir}/ffmpeg/*.ffpreset
388 %{?with_doc:%{_mandir}/man1/ffmpeg.1*}
389 %{?with_doc:%{_mandir}/man1/ffprobe.1*}
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
394 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.53
395 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
396 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.53
397 %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
398 %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.2
399 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
400 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.53
401 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
402 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
403 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
404 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51
405 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
406 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
409 %defattr(644,root,root,755)
410 %doc doc/optimization.txt
411 %attr(755,root,root) %{_bindir}/ffmpeg-avconfig
412 %attr(755,root,root) %{_libdir}/libavcodec.so
413 %attr(755,root,root) %{_libdir}/libavdevice.so
414 %attr(755,root,root) %{_libdir}/libavfilter.so
415 %attr(755,root,root) %{_libdir}/libavformat.so
416 %attr(755,root,root) %{_libdir}/libavutil.so
417 %attr(755,root,root) %{_libdir}/libpostproc.so
418 %attr(755,root,root) %{_libdir}/libswscale.so
419 %{_includedir}/ffmpeg
420 %{_includedir}/libavcodec
421 %{_includedir}/libavdevice
422 %{_includedir}/libavfilter
423 %{_includedir}/libavformat
424 %{_includedir}/libavutil
425 %{_includedir}/libpostproc
426 %{_includedir}/libswscale
427 %{_pkgconfigdir}/libavcodec.pc
428 %{_pkgconfigdir}/libavdevice.pc
429 %{_pkgconfigdir}/libavfilter.pc
430 %{_pkgconfigdir}/libavformat.pc
431 %{_pkgconfigdir}/libavutil.pc
432 %{_pkgconfigdir}/libpostproc.pc
433 %{_pkgconfigdir}/libswscale.pc
436 %defattr(644,root,root,755)
437 %{_libdir}/libavcodec.a
438 %{_libdir}/libavdevice.a
439 %{_libdir}/libavfilter.a
440 %{_libdir}/libavformat.a
441 %{_libdir}/libavutil.a
442 %{_libdir}/libpostproc.a
443 %{_libdir}/libswscale.a
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{_bindir}/ffplay
448 %{?with_doc:%{_mandir}/man1/ffplay.1*}
451 %defattr(644,root,root,755)
452 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
453 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
454 %attr(755,root,root) %{_sbindir}/ffserver
455 %attr(754,root,root) /etc/rc.d/init.d/ffserver
456 %{?with_doc:%{_mandir}/man1/ffserver.1*}
457 %dir %attr(770,root,ffserver) /var/cache/ffserver
458 %dir %attr(770,root,ffserver) /var/log/ffserver