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