]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - libvmaf [BR: libvmaf.pc, libvmaf, libvmaf.h] | |
3 | # - libndi_newtek[nonfree, BR: Processing.NDI.Lib.h] | |
4 | # - libmysofa [BR: libmysofa, mysofa.h] | |
5 | # - rkmpp[GPLv3, BR: rockchip_mpp.pc, rockchip/rk_mpi_cmd.h, libdrm] | |
6 | # | |
7 | # How to deal with ffmpeg/opencv/chromaprint checken-egg problem: | |
8 | # 1. make-request -r --with bootstrap ffmpeg.spec | |
9 | # 2 bump release of opencv.spec and chromaprint.spec | |
10 | # 3. make-request -r opencv.spec chromaprint.spec | |
11 | # 4. bump release of ffmpeg.spec | |
12 | # 5. make-request -r ffmpeg.spec | |
13 | # | |
14 | # Conditional build: | |
15 | %bcond_with bootstrap # disable features to able to build without installed ffmpeg | |
16 | %bcond_with nonfree # unblock non free options of package (currently: cuda_sdk, decklib, fdk_aac, libndi_newtek, npp, openssl) | |
17 | %bcond_without bs2b # BS2B audio filter support | |
18 | %bcond_without caca # textual display using libcaca | |
19 | %bcond_without chromaprint # audio fingerprinting with chromaprint | |
20 | %bcond_without cuda # NVIDIA CUDA code | |
21 | %bcond_with cudasdk # NVIDIA CUDA code using SDK [BR: cuda.h, non-free] | |
22 | %bcond_with cuvid # NVIDIA CUVID support | |
23 | %bcond_with decklink # Blackmagic DeskLink output support (requires nonfree) | |
24 | %bcond_with fdk_aac # AAC de/encoding via libfdk_aac (requires nonfree) | |
25 | %bcond_without flite # flite voice synthesis support | |
26 | %bcond_without frei0r # frei0r video filtering | |
27 | %bcond_without fribidi # fribidi support | |
28 | %bcond_without gme # Game Music Emu support | |
29 | %bcond_without ilbc # iLBC de/encoding via WebRTC libilbc | |
30 | %bcond_without kvazaar # Kvazaar HEVC encoder support | |
31 | %bcond_without ladspa # LADSPA audio filtering | |
32 | %bcond_with libdrm # Linux Direct Rendering Manager code | |
33 | %bcond_with librsvg # SVG rasterization via librsvg | |
34 | %bcond_with libxml2 # XML parsing using libxml2 | |
35 | %bcond_with mfx # MFX hardware acceleration support | |
36 | %bcond_with npp # NVIDIA Performance Primitives-based code (requires nonfree) [BR: libnppc+libnppi, npp.h] | |
37 | %bcond_with nvenc # NVIDIA NVENC support | |
38 | %bcond_without omx # OpenMAX IL support | |
39 | %bcond_without openal # OpenAL 1.1 capture support | |
40 | %bcond_without opencl # OpenCL 1.2 code | |
41 | %bcond_without opencv # OpenCV video filtering | |
42 | %bcond_without opengl # OpenGL rendering support | |
43 | %bcond_with openh264 # OpenH264 H.264 encoder | |
44 | %bcond_without openmpt # OpenMPT module decoder | |
45 | %bcond_without pulseaudio # PulseAudio input support | |
46 | %bcond_without rubberband # rubberband filter | |
47 | %bcond_without shine # shine fixed-point MP3 encoder | |
48 | %bcond_without snappy # Snappy compression support (needed for hap encoding) | |
49 | %bcond_without ssh # SFTP protocol support via libssh | |
50 | %bcond_with smb # SMB support via libsmbclient | |
51 | %bcond_without soxr # SoX Resampler support | |
52 | %bcond_with tesseract # OCR filter based on Tesseract | |
53 | %bcond_without x264 # H.264 x264 encoder | |
54 | %bcond_without x265 # H.265/HEVC x265 encoder | |
55 | %bcond_without va # VAAPI (Video Acceleration API) | |
56 | %bcond_without vidstab # vid.stab video stabilization support | |
57 | %bcond_without vpx # VP8, a high-quality video codec | |
58 | %bcond_without wavpack # wavpack encoding support | |
59 | %bcond_without webp # WebP encoding support | |
60 | %bcond_without zimg # zscale filter based on z.lib | |
61 | %bcond_without zmq # 0MQ message passing | |
62 | %bcond_without zvbi # teletext via libzvbi | |
63 | %bcond_without doc # don't build docs | |
64 | %bcond_with tests # "make check" (some tests fail as of 2.5) | |
65 | ||
66 | %if %{with bootstrap} | |
67 | %undefine with_opencv | |
68 | %undefine with_chromaprint | |
69 | %endif | |
70 | ||
71 | %ifnarch %{ix86} %{x8664} %{arm} | |
72 | %undefine with_x265 | |
73 | %endif | |
74 | %ifarch i386 i486 | |
75 | %undefine with_x265 | |
76 | %endif | |
77 | Summary: FFmpeg - a very fast video and audio converter | |
78 | Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo | |
79 | Name: ffmpeg | |
80 | Version: 4.1.3 | |
81 | Release: 2 | |
82 | # LGPL or GPL, chosen at configure time (GPL version is more featured) | |
83 | # (postprocessing, some filters, x264, x265, xavs, xvid, xcbgrab) | |
84 | # using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc) | |
85 | License: GPL v3+ with LGPL v3+ parts | |
86 | Group: Applications/Multimedia | |
87 | Source0: http://ffmpeg.org/releases/%{name}-%{version}.tar.xz | |
88 | # Source0-md5: dcc20dd2682ea01c678b7b8324339d43 | |
89 | Patch0: %{name}-omx-libnames.patch | |
90 | URL: http://www.ffmpeg.org/ | |
91 | %{?with_decklink:BuildRequires: Blackmagic_DeckLink_SDK >= 10.6.1} | |
92 | %{?with_openal:BuildRequires: OpenAL-devel >= 1.1} | |
93 | %{?with_opencl:BuildRequires: OpenCL-devel >= 1.2} | |
94 | %{?with_opengl:BuildRequires: OpenGL-GLX-devel} | |
95 | # libomxil-bellagio-devel or limoi-core-devel (just headers, library is dlopened at runtime) | |
96 | %{?with_omx:BuildRequires: OpenMAX-IL-devel} | |
97 | BuildRequires: SDL2-devel >= 2.0.1 | |
98 | BuildRequires: SDL2-devel < 2.1.0 | |
99 | BuildRequires: alsa-lib-devel | |
100 | BuildRequires: aom-devel >= 1.0.0 | |
101 | BuildRequires: bzip2-devel | |
102 | BuildRequires: celt-devel >= 0.11.0 | |
103 | %{?with_fdk_aac:BuildRequires: fdk-aac-devel} | |
104 | %{?with_flite:BuildRequires: flite-devel >= 1.4} | |
105 | BuildRequires: fontconfig-devel | |
106 | BuildRequires: freetype-devel | |
107 | %{?with_frei0r:BuildRequires: frei0r-devel} | |
108 | %{?with_fribidi:BuildRequires: fribidi-devel} | |
109 | %{?with_gme:BuildRequires: game-music-emu-devel} | |
110 | %ifarch ppc | |
111 | # require version with altivec support fixed | |
112 | BuildRequires: gcc >= 5:3.3.2-3 | |
113 | %endif | |
114 | BuildRequires: gmp-devel | |
115 | BuildRequires: gnutls-devel | |
116 | BuildRequires: jack-audio-connection-kit-devel | |
117 | %{?with_kvazaar:BuildRequires: kvazaar-devel >= 0.8.1} | |
118 | %{?with_ladspa:BuildRequires: ladspa-devel} | |
119 | BuildRequires: lame-libs-devel >= 3.98.3 | |
120 | BuildRequires: libass-devel | |
121 | BuildRequires: libavc1394-devel | |
122 | %{?with_bs2b:BuildRequires: libbs2b-devel} | |
123 | BuildRequires: libbluray-devel | |
124 | %{?with_caca:BuildRequires: libcaca-devel} | |
125 | BuildRequires: libcdio-paranoia-devel >= 0.90-2 | |
126 | %{?with_chromaprint:BuildRequires: libchromaprint-devel} | |
127 | BuildRequires: libdc1394-devel >= 2 | |
128 | %{?with_libdrm:BuildRequires: libdrm-devel} | |
129 | BuildRequires: libgsm-devel | |
130 | BuildRequires: libiec61883-devel | |
131 | BuildRequires: libmodplug-devel | |
132 | %{?with_openmpt:BuildRequires: libopenmpt-devel >= 0.2.6557} | |
133 | BuildRequires: libraw1394-devel >= 2 | |
134 | %{?with_librsvg:BuildRequires: librsvg-devel >= 2} | |
135 | BuildRequires: librtmp-devel | |
136 | %{?with_ssh:BuildRequires: libssh-devel} | |
137 | %{?with_smb:BuildRequires: libsmbclient-devel} | |
138 | BuildRequires: libtheora-devel >= 1.0-0.beta3 | |
139 | BuildRequires: libtool >= 2:1.4d-3 | |
140 | BuildRequires: libv4l-devel | |
141 | %if %{with va} | |
142 | BuildRequires: libva-devel >= 1.0.3 | |
143 | BuildRequires: libva-drm-devel >= 1.0.3 | |
144 | BuildRequires: libva-x11-devel >= 1.0.3 | |
145 | %endif | |
146 | BuildRequires: libvdpau-devel >= 0.2 | |
147 | BuildRequires: libvorbis-devel | |
148 | %{?with_vpx:BuildRequires: libvpx-devel >= 1.4.0} | |
149 | %{?with_webp:BuildRequires: libwebp-devel >= 0.4.0} | |
150 | # X264_BUILD >= 118 | |
151 | %{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245} | |
152 | # X265_BUILD >= 68 | |
153 | %{?with_x265:BuildRequires: libx265-devel >= 1.8} | |
154 | # libxcb xcb-shm xcb-xfixes xcb-shape | |
155 | BuildRequires: libxcb-devel >= 1.4 | |
156 | %{?with_libxml2:BuildRequires: libxml2-devel >= 2} | |
157 | %{?with_mfx:BuildRequires: mfx_dispatch-devel} | |
158 | %ifarch %{ix86} | |
159 | %ifnarch i386 i486 | |
160 | BuildRequires: nasm | |
161 | %endif | |
162 | %endif | |
163 | # which package? | |
164 | #%{?with_nvenc:BuildRequires: NVIDIA-NVENC-API} compat/nvenc/nvEncodeAPI.h | |
165 | BuildRequires: opencore-amr-devel | |
166 | %{?with_opencv:BuildRequires: opencv-devel} | |
167 | %{?with_openh264:BuildRequires: openh264-devel >= 1.3} | |
168 | BuildRequires: openjpeg2-devel >= 2.1 | |
169 | BuildRequires: opus-devel | |
170 | BuildRequires: perl-Encode | |
171 | BuildRequires: perl-tools-pod | |
172 | BuildRequires: pkgconfig | |
173 | %{?with_pulseaudio:BuildRequires: pulseaudio-devel} | |
174 | BuildRequires: rpmbuild(macros) >= 1.470 | |
175 | %{?with_rubberband:BuildRequires: rubberband-devel >= 1.8.1} | |
176 | %{?with_shine:BuildRequires: shine-devel >= 3.0.0} | |
177 | %{?with_snappy:BuildRequires: snappy-devel} | |
178 | %{?with_soxr:BuildRequires: soxr-devel} | |
179 | BuildRequires: speex-devel >= 1:1.2-rc1 | |
180 | %{?with_tesseract:BuildRequires: tesseract-devel} | |
181 | %{?with_doc:BuildRequires: tetex} | |
182 | %{?with_doc:BuildRequires: texi2html} | |
183 | %{?with_doc:BuildRequires: texinfo} | |
184 | BuildRequires: twolame-devel >= 0.3.10 | |
185 | %{?with_vidstab:BuildRequires: vid.stab-devel >= 0.98} | |
186 | BuildRequires: vo-amrwbenc-devel | |
187 | %{?with_wavpack:BuildRequires: wavpack-devel} | |
188 | %{?with_ilbc:BuildRequires: webrtc-libilbc-devel} | |
189 | BuildRequires: xavs-devel | |
190 | BuildRequires: xorg-lib-libX11-devel | |
191 | BuildRequires: xorg-lib-libXext-devel | |
192 | BuildRequires: xorg-lib-libXfixes-devel | |
193 | BuildRequires: xvid-devel >= 1:1.1.0 | |
194 | BuildRequires: xz-devel | |
195 | BuildRequires: yasm | |
196 | %{?with_zmq:BuildRequires: zeromq-devel} | |
197 | %{?with_zimg:BuildRequires: zimg-devel >= 2.7.0} | |
198 | BuildRequires: zlib-devel | |
199 | %{?with_zvbi:BuildRequires: zvbi-devel} | |
200 | %{?with_autoreqdep:BuildConflicts: libpostproc} | |
201 | # overflows maximum hash table size | |
202 | BuildConflicts: pdksh < 5.2.14-57 | |
203 | Requires: %{name}-libs = %{version}-%{release} | |
204 | %{?with_ilbc:Requires: webrtc-libilbc} | |
205 | Requires: xvid >= 1:1.1.0 | |
206 | Obsoletes: libpostproc | |
207 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
208 | ||
209 | %define specflags -fno-strict-aliasing | |
210 | ||
211 | # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one) | |
212 | %define specflags_ia32 -fomit-frame-pointer | |
213 | # -mmmx is needed to enable <mmintrin.h> code. | |
214 | %define specflags_i586 -mmmx | |
215 | %define specflags_i686 -mmmx | |
216 | %define specflags_ppc -fPIC | |
217 | ||
218 | %description | |
219 | FFmpeg is a complete solution to record, convert and stream audio and | |
220 | video. It is a command line tool to convert one video file format to | |
221 | another. It also supports grabbing and encoding in real time from a TV | |
222 | card. | |
223 | ||
224 | %description -l pl.UTF-8 | |
225 | FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji | |
226 | strumieni dźwięku i obrazu. Jest to działające z linii poleceń | |
227 | narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje | |
228 | także przechwytywanie i kodowanie w czasie rzeczywistym z karty | |
229 | telewizyjnej. | |
230 | ||
231 | %package libs | |
232 | Summary: ffmpeg libraries | |
233 | Summary(pl.UTF-8): Biblioteki ffmpeg | |
234 | Group: Libraries | |
235 | Requires: SDL2 >= 2.0.1 | |
236 | Requires: aom >= 1.0.0 | |
237 | %if "%(rpm -q --qf '%{V}' gnutls-devel)" >= "3.0.20" | |
238 | # uses gnutls_certificate_set_x509_system_trust if >= 3.0.20 | |
239 | Requires: gnutls-libs >= 3.0.20 | |
240 | %endif | |
241 | %{?with_openmpt:Requires: libopenmpt >= 0.2.6557} | |
242 | %{?with_vpx:Requires: libvpx >= 1.4.0} | |
243 | %{?with_rubberband:Requires: rubberband-libs >= 1.8.1} | |
244 | Requires: twolame-libs >= 0.3.10 | |
245 | %{?with_zimg:Requires: zimg >= 2.7.0} | |
246 | ||
247 | %description libs | |
248 | This package contains the ffmpeg shared libraries: | |
249 | - the codec library (libavcodec). It supports most existing encoding | |
250 | formats (MPEG, DivX, MPEG4, AC3, DV...), | |
251 | - demuxer library (libavformat). It supports most existing file | |
252 | formats (AVI, MPEG, OGG, Matroska, ASF...), | |
253 | - video postprocessing library (libpostproc). | |
254 | ||
255 | %description libs -l pl.UTF-8 | |
256 | Ten pakiet zawiera biblioteki współdzielone ffmpeg: | |
257 | - bibliotekę kodeków (libavcodec); obsługuje większość istniejących | |
258 | formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...), | |
259 | - bibliotekę demuksera (libavformat); obsługuje większość istniejących | |
260 | formatów plików (AVI, MPEG, OGG, Matroska, ASF...), | |
261 | - bibliotekę postprocessingu (libpostproc). | |
262 | ||
263 | %package devel | |
264 | Summary: ffmpeg header files | |
265 | Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg | |
266 | Group: Development/Libraries | |
267 | Requires: %{name}-libs = %{version}-%{release} | |
268 | # Libs.private from *.pc (unreasonably they are all the same) | |
269 | %{?with_opencl:Requires: OpenCL-devel >= 1.2} | |
270 | %{?with_opengl:Requires: OpenGL-devel} | |
271 | Requires: SDL2-devel >= 2.0.1 | |
272 | Requires: alsa-lib-devel | |
273 | Requires: bzip2-devel | |
274 | Requires: celt-devel >= 0.11.0 | |
275 | %{?with_fdk_aac:Requires: fdk-aac-devel} | |
276 | %{?with_flite:Requires: flite-devel >= 1.4} | |
277 | Requires: fontconfig-devel | |
278 | Requires: freetype-devel | |
279 | %{?with_fribidi:Requires: fribidi-devel} | |
280 | %{?with_gme:Requires: game-music-emu-devel} | |
281 | Requires: jack-audio-connection-kit-devel | |
282 | %{?with_kvazaar:Requires: kvazaar-devel >= 0.8.1} | |
283 | Requires: lame-libs-devel >= 3.98.3 | |
284 | Requires: libass-devel | |
285 | Requires: libavc1394-devel | |
286 | Requires: libbluray-devel | |
287 | %{?with_bs2b:Requires: libbs2b-devel} | |
288 | %{?with_caca:Requires: libcaca-devel} | |
289 | Requires: libcdio-paranoia-devel >= 0.90-2 | |
290 | %{?with_chromaprint:Requires: libchromaprint-devel} | |
291 | Requires: libdc1394-devel >= 2 | |
292 | %{?with_libdrm:Requires: libdrm-devel} | |
293 | Requires: libgsm-devel | |
294 | Requires: libiec61883-devel | |
295 | Requires: libmodplug-devel | |
296 | %{?with_openmpt:Requires: libopenmpt-devel >= 0.2.6557} | |
297 | Requires: libraw1394-devel >= 2 | |
298 | %{?with_librsvg:Requires: librsvg-devel >= 2} | |
299 | Requires: librtmp-devel | |
300 | %{?with_smb:Requires: libsmbclient-devel} | |
301 | Requires: libtheora-devel >= 1.0-0.beta3 | |
302 | %{?with_va:Requires: libva-devel >= 1.0.3} | |
303 | Requires: libvorbis-devel | |
304 | %{?with_vpx:Requires: libvpx-devel >= 1.4.0} | |
305 | %{?with_webp:Requires: libwebp-devel >= 0.4.0} | |
306 | %{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245} | |
307 | %{?with_x265:Requires: libx265-devel >= 1.8} | |
308 | %{?with_libxml2:Requires: libxml2-devel >= 2} | |
309 | %{?with_mfx:Requires: mfx_dispatch-devel} | |
310 | Requires: opencore-amr-devel | |
311 | %{?with_opencv:Requires: opencv-devel} | |
312 | %{?with_openh264:Requires: openh264-devel >= 1.3} | |
313 | Requires: openjpeg2-devel >= 2.1 | |
314 | %{?with_rubberband:Requires: rubberband-devel >= 1.8.1} | |
315 | %{?with_shine:Requires: shine-devel >= 3.0.0} | |
316 | %{?with_snappy:Requires: snappy-devel} | |
317 | %{?with_soxr:Requires: soxr-devel} | |
318 | Requires: speex-devel >= 1:1.2-rc1 | |
319 | %{?with_tesseract:Requires: tesseract-devel} | |
320 | Requires: twolame-devel >= 0.3.10 | |
321 | %{?with_vidstab:Requires: vid.stab-devel >= 0.98} | |
322 | Requires: vo-amrwbenc-devel | |
323 | %{?with_wavpack:Requires: wavpack-devel} | |
324 | %{?with_ilbc:Requires: webrtc-libilbc-devel} | |
325 | Requires: xavs-devel | |
326 | Requires: xorg-lib-libXext-devel | |
327 | Requires: xorg-lib-libXfixes-devel | |
328 | Requires: xvid-devel >= 1:1.1.0 | |
329 | %{?with_zmq:Requires: zeromq-devel} | |
330 | %{?with_zimg:Requires: zimg-devel >= 2.3.0} | |
331 | Requires: zlib-devel | |
332 | Obsoletes: libpostproc-devel | |
333 | ||
334 | %description devel | |
335 | ffmpeg header files. | |
336 | ||
337 | %description devel -l pl.UTF-8 | |
338 | Pliki nagłówkowe ffmpeg. | |
339 | ||
340 | %package static | |
341 | Summary: ffmpeg static libraries | |
342 | Summary(pl.UTF-8): Statyczne biblioteki ffmpeg | |
343 | Group: Development/Libraries | |
344 | Requires: %{name}-devel = %{version}-%{release} | |
345 | ||
346 | %description static | |
347 | ffmpeg static libraries (libavcodec and libavformat). | |
348 | ||
349 | %description static -l pl.UTF-8 | |
350 | Statyczne biblioteki ffmpeg (libavcodec i libavformat). | |
351 | ||
352 | %package ffplay | |
353 | Summary: FFplay - SDL-based media player | |
354 | Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL | |
355 | Group: Applications/Multimedia | |
356 | Requires: %{name}-libs = %{version}-%{release} | |
357 | ||
358 | %description ffplay | |
359 | FFplay is a very simple and portable media player using the FFmpeg | |
360 | libraries and the SDL library. It is mostly used as a test bench for | |
361 | the various APIs of FFmpeg. | |
362 | ||
363 | %description ffplay -l pl.UTF-8 | |
364 | FFplay to bardzo prosty i przenośny odtwarzacz mediów używający | |
365 | bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do | |
366 | testowania różnych API FFmpeg. | |
367 | ||
368 | %package doc | |
369 | Summary: FFmpeg documentation in HTML format | |
370 | Summary(pl.UTF-8): Dokumentacja pakietu FFmpeg w formacie HTML | |
371 | Group: Documentation | |
372 | %if "%{_rpmversion}" >= "5" | |
373 | BuildArch: noarch | |
374 | %endif | |
375 | ||
376 | %description doc | |
377 | FFmpeg documentation in HTML format. | |
378 | ||
379 | %description doc -l pl.UTF-8 | |
380 | Dokumentacja pakietu FFmpeg w formacie HTML. | |
381 | ||
382 | %prep | |
383 | %setup -q | |
384 | %patch0 -p1 | |
385 | ||
386 | # package the grep result for mplayer, the result formatted as ./mplayer/configure | |
387 | cat <<EOF > ffmpeg-avconfig | |
388 | #! /bin/sh | |
389 | libavdecoders_all="$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')" | |
390 | libavencoders_all="$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')" | |
391 | libavparsers_all="$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')" | |
392 | libavbsfs_all="$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')" | |
393 | libavdemuxers_all="$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')" | |
394 | libavmuxers_all="$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')" | |
395 | libavprotocols_all="$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')" | |
396 | libavhwaccels_all="$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')" | |
397 | libavfilters_all="$(sed -n 's/^[^#]*FILTER.*(.*, *\(.*\),.*).*/\1_filter/p' libavfilter/allfilters.c | tr '[a-z]' '[A-Z]')" | |
398 | EOF | |
399 | cat <<'EOF' >> ffmpeg-avconfig | |
400 | ||
401 | case "$1" in | |
402 | --decoders) | |
403 | echo $libavdecoders_all | |
404 | ;; | |
405 | --encoders) | |
406 | echo $libavencoders_all | |
407 | ;; | |
408 | --parsers) | |
409 | echo $libavparsers_all | |
410 | ;; | |
411 | --bsfs) | |
412 | echo $libavbsfs_all | |
413 | ;; | |
414 | --demuxers) | |
415 | echo $libavdemuxers_all | |
416 | ;; | |
417 | --muxers) | |
418 | echo $libavmuxers_all | |
419 | ;; | |
420 | --protocols) | |
421 | echo $libavprotocols_all | |
422 | ;; | |
423 | --hwaccels) | |
424 | echo $libavhwaccels_all | |
425 | ;; | |
426 | --filters) | |
427 | echo $libavfilters_all | |
428 | ;; | |
429 | *) | |
430 | cat <<USAGE | |
431 | Usage: $0 [OPTION] | |
432 | Options: | |
433 | --decoders | |
434 | --encoders | |
435 | --parsers | |
436 | --bsfs | |
437 | --demuxers | |
438 | --muxers | |
439 | --protocols | |
440 | --hwaccels | |
441 | --filters | |
442 | USAGE | |
443 | exit 1;; | |
444 | esac | |
445 | ||
446 | exit 0 | |
447 | EOF | |
448 | ||
449 | %build | |
450 | # notes: | |
451 | # - it's not autoconf configure | |
452 | # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags | |
453 | ./configure \ | |
454 | --arch=%{_target_base_arch} \ | |
455 | --prefix=%{_prefix} \ | |
456 | --libdir=%{_libdir} \ | |
457 | --shlibdir=%{_libdir} \ | |
458 | --mandir=%{_mandir} \ | |
459 | --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}%{?with_decklink: -I/usr/include/decklink}" \ | |
460 | --extra-ldflags="%{rpmcflags} %{rpmldflags}" \ | |
461 | --cc="%{__cc}" \ | |
462 | --disable-debug \ | |
463 | --disable-optimizations \ | |
464 | --disable-stripping \ | |
465 | %{!?with_doc:--disable-doc} \ | |
466 | --enable-avfilter \ | |
467 | --enable-avresample \ | |
468 | %{?with_chromaprint:--enable-chromaprint} \ | |
469 | %{!?with_cuda:--disable-cuda} \ | |
470 | %{?with_cudasdk:--enable-cuda-sdk} \ | |
471 | %{!?with_cuvid:--disable-cuvid} \ | |
472 | %{?with_decklink:--enable-decklink} \ | |
473 | --enable-gnutls \ | |
474 | --enable-gpl \ | |
475 | --enable-version3 \ | |
476 | %{?with_frei0r:--enable-frei0r} \ | |
477 | %{?with_ladspa:--enable-ladspa} \ | |
478 | --enable-libaom \ | |
479 | --enable-libass \ | |
480 | --enable-libbluray \ | |
481 | %{?with_bs2b:--enable-libbs2b} \ | |
482 | %{?with_caca:--enable-libcaca} \ | |
483 | --enable-libcelt \ | |
484 | --enable-libcdio \ | |
485 | --enable-libdc1394 \ | |
486 | %{?with_libdrm:--enable-libdrm} \ | |
487 | %{?with_flite:--enable-libflite} \ | |
488 | --enable-libfontconfig \ | |
489 | --enable-libfreetype \ | |
490 | %{?with_fribidi:--enable-libfribidi} \ | |
491 | %{?with_gme:--enable-libgme} \ | |
492 | --enable-libgsm \ | |
493 | --enable-libiec61883 \ | |
494 | %{?with_ilbc:--enable-libilbc} \ | |
495 | %{?with_kvazaar:--enable-libkvazaar} \ | |
496 | %{?with_mfx:--enable-libmfx} \ | |
497 | --enable-libmodplug \ | |
498 | --enable-libmp3lame \ | |
499 | --enable-libopencore-amrnb \ | |
500 | --enable-libopencore-amrwb \ | |
501 | %{?with_opencv:--enable-libopencv} \ | |
502 | %{?with_openh264:--enable-libopenh264} \ | |
503 | --enable-libopenjpeg \ | |
504 | %{?with_openmpt:--enable-libopenmpt} \ | |
505 | --enable-libopus \ | |
506 | %{?with_pulseaudio:--enable-libpulse} \ | |
507 | %{?with_librsvg:--enable-librsvg} \ | |
508 | --enable-librtmp \ | |
509 | %{?with_libxml2:--enable-libxml2} \ | |
510 | %{?with_rubberband:--enable-librubberband} \ | |
511 | %{?with_shine:--enable-libshine} \ | |
512 | %{?with_smb:--enable-libsmbclient} \ | |
513 | %{?with_snappy:--enable-libsnappy} \ | |
514 | %{?with_soxr:--enable-libsoxr} \ | |
515 | --enable-libspeex \ | |
516 | %{?with_ssh:--enable-libssh} \ | |
517 | %{?with_tesseract:--enable-libtesseract} \ | |
518 | --enable-libtheora \ | |
519 | --enable-libtwolame \ | |
520 | --enable-libv4l2 \ | |
521 | %{?with_vidstab:--enable-libvidstab} \ | |
522 | --enable-libvo-amrwbenc \ | |
523 | --enable-libvorbis \ | |
524 | %{?with_vpx:--enable-libvpx} \ | |
525 | %{?with_wavpack:--enable-libwavpack} \ | |
526 | %{?with_webp:--enable-libwebp} \ | |
527 | %{?with_x264:--enable-libx264} \ | |
528 | %{?with_x265:--enable-libx265} \ | |
529 | --enable-libxavs \ | |
530 | --enable-libxcb \ | |
531 | --enable-libxvid \ | |
532 | %{?with_zimg:--enable-libzimg} \ | |
533 | %{?with_zmq:--enable-libzmq} \ | |
534 | %{?with_zvbi:--enable-libzvbi} \ | |
535 | %{!?with_nvenc:--disable-nvenc} \ | |
536 | %{?with_omx:--enable-omx} \ | |
537 | %{?with_openal:--enable-openal} \ | |
538 | %{?with_opencl:--enable-opencl} \ | |
539 | %{?with_opengl:--enable-opengl} \ | |
540 | --enable-postproc \ | |
541 | --enable-pthreads \ | |
542 | --enable-shared \ | |
543 | --enable-swscale \ | |
544 | %{!?with_va:--disable-vaapi} \ | |
545 | %ifnarch %{ix86} %{x8664} | |
546 | --disable-mmx \ | |
547 | %endif | |
548 | %ifarch i386 i486 | |
549 | --disable-mmx \ | |
550 | %endif | |
551 | %ifarch x32 | |
552 | --disable-asm \ | |
553 | %endif | |
554 | %if %{with nonfree} | |
555 | --enable-nonfree \ | |
556 | %{?with_fdk_aac:--enable-libfdk-aac} \ | |
557 | %{?with_npp:--enable-libnpp} \ | |
558 | %endif | |
559 | --enable-runtime-cpudetect | |
560 | ||
561 | %{__make} \ | |
562 | V=1 | |
563 | ||
564 | # CC_O to add -c to commandline. makefile should be patched | |
565 | %{__make} tools/qt-faststart V=1 CC_O='-c -o $@' | |
566 | ||
567 | %{?with_tests:%{__make} check V=1} | |
568 | ||
569 | %install | |
570 | rm -rf $RPM_BUILD_ROOT | |
571 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \ | |
572 | $RPM_BUILD_ROOT%{_includedir}/ffmpeg | |
573 | ||
574 | %{__make} install install-headers \ | |
575 | DESTDIR=$RPM_BUILD_ROOT \ | |
576 | V=1 | |
577 | ||
578 | # install nonstandard, non-public headers manually | |
579 | cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg | |
580 | for a in libavutil/*/{asm,bswap}.h; do | |
581 | install -Dp $a $RPM_BUILD_ROOT%{_includedir}/$a | |
582 | done | |
583 | cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat | |
584 | ||
585 | install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir} | |
586 | ||
587 | # install as ffmpeg-avconfig to avoid with possible programs looking for | |
588 | # ffmpeg-config and expecting --libs output from it which is not implemented | |
589 | # simple to do (by querying pkgconfig), but why? | |
590 | install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig | |
591 | ||
592 | # packaged as %doc in -doc | |
593 | %if %{with doc} | |
594 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/ffmpeg/*.html | |
595 | %endif | |
596 | ||
597 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
598 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/ffmpeg/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
599 | ||
600 | %clean | |
601 | rm -rf $RPM_BUILD_ROOT | |
602 | ||
603 | %post libs -p /sbin/ldconfig | |
604 | %postun libs -p /sbin/ldconfig | |
605 | ||
606 | %files | |
607 | %defattr(644,root,root,755) | |
608 | %doc CREDITS LICENSE.md MAINTAINERS README.md RELEASE_NOTES doc/APIchanges | |
609 | %attr(755,root,root) %{_bindir}/ffmpeg | |
610 | %attr(755,root,root) %{_bindir}/ffprobe | |
611 | %attr(755,root,root) %{_bindir}/qt-faststart | |
612 | %dir %{_datadir}/ffmpeg | |
613 | %{_datadir}/ffmpeg/*.ffpreset | |
614 | %{_datadir}/ffmpeg/ffprobe.xsd | |
615 | %if %{with doc} | |
616 | %{_mandir}/man1/ffmpeg.1* | |
617 | %{_mandir}/man1/ffmpeg-all.1* | |
618 | %{_mandir}/man1/ffmpeg-bitstream-filters.1* | |
619 | %{_mandir}/man1/ffmpeg-codecs.1* | |
620 | %{_mandir}/man1/ffmpeg-devices.1* | |
621 | %{_mandir}/man1/ffmpeg-filters.1* | |
622 | %{_mandir}/man1/ffmpeg-formats.1* | |
623 | %{_mandir}/man1/ffmpeg-protocols.1* | |
624 | %{_mandir}/man1/ffmpeg-resampler.1* | |
625 | %{_mandir}/man1/ffmpeg-scaler.1* | |
626 | %{_mandir}/man1/ffmpeg-utils.1* | |
627 | %{_mandir}/man1/ffprobe.1* | |
628 | %{_mandir}/man1/ffprobe-all.1* | |
629 | %endif | |
630 | ||
631 | %files libs | |
632 | %defattr(644,root,root,755) | |
633 | %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.* | |
634 | %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.58 | |
635 | %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.* | |
636 | %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.58 | |
637 | %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.* | |
638 | %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.7 | |
639 | %attr(755,root,root) %{_libdir}/libavformat.so.*.*.* | |
640 | %attr(755,root,root) %ghost %{_libdir}/libavformat.so.58 | |
641 | %attr(755,root,root) %{_libdir}/libavresample.so.*.*.* | |
642 | %attr(755,root,root) %ghost %{_libdir}/libavresample.so.4 | |
643 | %attr(755,root,root) %{_libdir}/libavutil.so.*.*.* | |
644 | %attr(755,root,root) %ghost %{_libdir}/libavutil.so.56 | |
645 | %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.* | |
646 | %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.55 | |
647 | %attr(755,root,root) %{_libdir}/libswresample.so.*.*.* | |
648 | %attr(755,root,root) %ghost %{_libdir}/libswresample.so.3 | |
649 | %attr(755,root,root) %{_libdir}/libswscale.so.*.*.* | |
650 | %attr(755,root,root) %ghost %{_libdir}/libswscale.so.5 | |
651 | ||
652 | %files devel | |
653 | %defattr(644,root,root,755) | |
654 | %doc doc/optimization.txt | |
655 | %attr(755,root,root) %{_bindir}/ffmpeg-avconfig | |
656 | %attr(755,root,root) %{_libdir}/libavcodec.so | |
657 | %attr(755,root,root) %{_libdir}/libavdevice.so | |
658 | %attr(755,root,root) %{_libdir}/libavfilter.so | |
659 | %attr(755,root,root) %{_libdir}/libavformat.so | |
660 | %attr(755,root,root) %{_libdir}/libavresample.so | |
661 | %attr(755,root,root) %{_libdir}/libavutil.so | |
662 | %attr(755,root,root) %{_libdir}/libpostproc.so | |
663 | %attr(755,root,root) %{_libdir}/libswresample.so | |
664 | %attr(755,root,root) %{_libdir}/libswscale.so | |
665 | %{_includedir}/ffmpeg | |
666 | %{_includedir}/libavcodec | |
667 | %{_includedir}/libavdevice | |
668 | %{_includedir}/libavfilter | |
669 | %{_includedir}/libavformat | |
670 | %{_includedir}/libavresample | |
671 | %{_includedir}/libavutil | |
672 | %{_includedir}/libpostproc | |
673 | %{_includedir}/libswresample | |
674 | %{_includedir}/libswscale | |
675 | %{_pkgconfigdir}/libavcodec.pc | |
676 | %{_pkgconfigdir}/libavdevice.pc | |
677 | %{_pkgconfigdir}/libavfilter.pc | |
678 | %{_pkgconfigdir}/libavformat.pc | |
679 | %{_pkgconfigdir}/libavresample.pc | |
680 | %{_pkgconfigdir}/libavutil.pc | |
681 | %{_pkgconfigdir}/libpostproc.pc | |
682 | %{_pkgconfigdir}/libswresample.pc | |
683 | %{_pkgconfigdir}/libswscale.pc | |
684 | %if %{with doc} | |
685 | %{_mandir}/man3/libavcodec.3* | |
686 | %{_mandir}/man3/libavdevice.3* | |
687 | %{_mandir}/man3/libavfilter.3* | |
688 | %{_mandir}/man3/libavformat.3* | |
689 | %{_mandir}/man3/libavutil.3* | |
690 | %{_mandir}/man3/libswresample.3* | |
691 | %{_mandir}/man3/libswscale.3* | |
692 | %endif | |
693 | %{_examplesdir}/%{name}-%{version} | |
694 | ||
695 | %files static | |
696 | %defattr(644,root,root,755) | |
697 | %{_libdir}/libavcodec.a | |
698 | %{_libdir}/libavdevice.a | |
699 | %{_libdir}/libavfilter.a | |
700 | %{_libdir}/libavformat.a | |
701 | %{_libdir}/libavresample.a | |
702 | %{_libdir}/libavutil.a | |
703 | %{_libdir}/libpostproc.a | |
704 | %{_libdir}/libswresample.a | |
705 | %{_libdir}/libswscale.a | |
706 | ||
707 | %files ffplay | |
708 | %defattr(644,root,root,755) | |
709 | %attr(755,root,root) %{_bindir}/ffplay | |
710 | %if %{with doc} | |
711 | %{_mandir}/man1/ffplay.1* | |
712 | %{_mandir}/man1/ffplay-all.1* | |
713 | %endif | |
714 | ||
715 | %if %{with doc} | |
716 | %files doc | |
717 | %defattr(644,root,root,755) | |
718 | %doc doc/*.html | |
719 | %endif |