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