File ffmpeg-7.spec of Package A_tw-ffmpeg-7

943
 
1
#
2
# spec file for package ffmpeg-7
3
#
4
# Copyright (c) 2025 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define flavor @BUILD_FLAVOR@%nil
20
#
21
# preamble is present twice, watch out
22
#
23
%if "%flavor" != "ffmpeg-7-mini"
24
25
# Create proper conflicts to make sure we require all from one version
26
# p:   Conflict string, eg if you need them all for requires instead
27
#      Default value Conflicts:
28
# c:   copmare string ie "<" or ">=", must be defined
29
# v:   version string ie. "< 42.3.4" or ">= 15.0.2.1", must be defined
30
%define devel_conflicts(p:c:v:) \
31
%define preamble_string %{-p:%{-p*}}%{!-p:Conflicts:} \
32
%define comparator %{-c:%{-c*}}%{!-c:%{error:Comparator not defined}} \
33
%define conflicts_version %{-v:%{-v*}}%{!-v:%{error:Version not defined}} \
34
\
35
%preamble_string libavcodec-devel %comparator %conflicts_version \
36
%preamble_string libavdevice-devel %comparator %conflicts_version \
37
%preamble_string libavfilter-devel %comparator %conflicts_version \
38
%preamble_string libavformat-devel %comparator %conflicts_version \
39
%preamble_string libavutil-devel %comparator %conflicts_version \
40
%preamble_string libpostproc-devel %comparator %conflicts_version \
41
%preamble_string libswresample-devel %comparator %conflicts_version \
42
%preamble_string libswscale-devel %comparator %conflicts_version \
43
%nil
44
45
%if 0%{?BUILD_ORIG}
46
%bcond_without amf_sdk
47
%bcond_without cuda_sdk
48
%else
49
# If software H264 is disabled, the hw driver must be as well:
50
# HW drivers can fail to initialize, namely when the hardware is absent.
51
# Browsers choose video formats on sites like youtube based on `ffmpeg
52
# -codecs` rather than the success/failure status of libav* initialization.
53
# This becomes a problem when a format only has a HW driver;
54
# the browser thinks it can do H264 but never succeeds.
55
%bcond_with    amf_sdk
56
%bcond_with    cuda_sdk
57
%endif
58
59
%bcond_with    amrwb
60
%bcond_with    fdk_aac_dlopen
61
%bcond_with    opencore
62
%bcond_with    smbclient
63
%bcond_with    x264
64
%bcond_with    x265
65
%bcond_with    xvid
66
67
%if 0%{?suse_version} > 1600
68
%bcond_without mysofa
69
%bcond_without vidstab
70
%bcond_without codec2
71
%bcond_without rubberband
72
%bcond_without vulkan
73
%bcond_without amrwb
74
%bcond_without opencore
75
%bcond_without xvid
76
%else
77
%if 0%{?suse_version} > 1500
78
%bcond_without mysofa
79
%bcond_without vidstab
80
%bcond_without codec2
81
%bcond_without rubberband
82
%bcond_without vulkan
83
%bcond_without amrwb
84
%bcond_without opencore
85
%else
86
%bcond_with mysofa
87
%bcond_with vidstab
88
%bcond_with codec2
89
%bcond_with rubberband
90
%bcond_with vulkan
91
%endif
92
%endif
93
94
%define _name ffmpeg
95
%define _major_version 7
96
%define _major_expected 8
97
98
Name:           ffmpeg-7
99
Version:        7.1
100
Release:        0
101
Summary:        Set of libraries for working with various multimedia formats
102
License:        GPL-3.0-or-later
103
Group:          Productivity/Multimedia/Video/Editors and Convertors
104
#Git-Clone:     git://source.ffmpeg.org/ffmpeg
105
URL:            https://ffmpeg.org/
106
Source:         https://www.ffmpeg.org/releases/%_name-%version.tar.xz
107
Source2:        https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
108
Source3:        ffmpeg-7-rpmlintrc
109
Source4:        enable_decoders
110
Source5:        enable_encoders
111
Source6:        ffmpeg-dlopen-headers.tar.xz
112
Source92:       ffmpeg_get_dlopen_headers.sh
113
Source98:       http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-7.keyring
114
Source99:       baselibs.conf
115
Patch1:         ffmpeg-arm6l.diff
116
Patch2:         ffmpeg-new-coder-errors.diff
117
Patch3:         ffmpeg-codec-choice.diff
118
Patch4:         ffmpeg-4.2-dlopen-fdk_aac.patch
119
Patch5:         work-around-abi-break.patch
120
Patch10:        ffmpeg-chromium.patch
121
Patch91:        ffmpeg-dlopen-openh264.patch
122
Patch15:        11013-avcodec-decode-clean-up-if-get_hw_frames_parameters-.patch
123
Patch16:        ffmpeg-7-CVE-2025-22919.patch
124
Patch17:        ffmpeg-7-CVE-2025-0518.patch
125
Patch18:        ffmpeg-7-CVE-2025-25473.patch
126
Patch19:        ffmpeg-7-CVE-2025-22921.patch
127
Patch20:        0001-avcodec-libsvtav1-unbreak-build-with-latest-svtav1.patch
128
BuildRequires:  ladspa-devel
129
BuildRequires:  libgsm-devel
130
BuildRequires:  libmp3lame-devel >= 3.98.3
131
BuildRequires:  nasm
132
BuildRequires:  pkgconfig
133
BuildRequires:  pkgconfig(alsa)
134
BuildRequires:  pkgconfig(aom) >= 1.0.0
135
BuildRequires:  pkgconfig(dav1d) >= 0.5.0
136
BuildRequires:  pkgconfig(ffnvcodec) >= 8.1.24.15
137
BuildRequires:  pkgconfig(fontconfig) >= 2.4.2
138
BuildRequires:  pkgconfig(freetype2)
139
BuildRequires:  pkgconfig(fribidi) >= 0.19.0
140
BuildRequires:  pkgconfig(gnutls)
141
BuildRequires:  pkgconfig(jack)
142
BuildRequires:  pkgconfig(libass) >= 0.11.0
143
BuildRequires:  pkgconfig(libbluray)
144
BuildRequires:  pkgconfig(libbs2b)
145
BuildRequires:  pkgconfig(libcdio)
146
BuildRequires:  pkgconfig(libcdio_paranoia)
147
BuildRequires:  pkgconfig(libdc1394-2)
148
BuildRequires:  pkgconfig(libdrm)
149
BuildRequires:  pkgconfig(libgme)
150
BuildRequires:  pkgconfig(libopenjp2) >= 2.1.0
151
BuildRequires:  pkgconfig(libopenmpt) >= 0.2.6557
152
BuildRequires:  pkgconfig(libpng)
153
BuildRequires:  pkgconfig(libpulse)
154
BuildRequires:  pkgconfig(libraw1394)
155
BuildRequires:  pkgconfig(libssh) >= 0.6.0
156
BuildRequires:  pkgconfig(libva) >= 0.35.0
157
BuildRequires:  pkgconfig(libva-drm)
158
BuildRequires:  pkgconfig(libva-x11)
159
BuildRequires:  pkgconfig(libvmaf) >= 2.0.0
160
BuildRequires:  pkgconfig(libwebp) >= 0.4
161
BuildRequires:  pkgconfig(libwebpmux) >= 0.4.0
162
BuildRequires:  pkgconfig(libxml-2.0)
163
BuildRequires:  pkgconfig(libzmq) >= 4.2.1
164
BuildRequires:  pkgconfig(lilv-0)
165
BuildRequires:  pkgconfig(ogg)
166
BuildRequires:  pkgconfig(opus)
167
BuildRequires:  pkgconfig(sdl2) >= 2.0.1
168
BuildRequires:  pkgconfig(soxr)
169
BuildRequires:  pkgconfig(speex)
170
BuildRequires:  pkgconfig(srt) >= 1.3.0
171
BuildRequires:  pkgconfig(theora) >= 1.1
172
BuildRequires:  pkgconfig(twolame) >= 0.3.10
173
BuildRequires:  pkgconfig(vdpau)
174
BuildRequires:  pkgconfig(vorbis)
175
BuildRequires:  pkgconfig(vpx) >= 1.4.0
176
BuildRequires:  pkgconfig(x11)
177
BuildRequires:  pkgconfig(xcb)
178
BuildRequires:  pkgconfig(xcb-shape)
179
BuildRequires:  pkgconfig(xcb-shm)
180
BuildRequires:  pkgconfig(xcb-xfixes)
181
BuildRequires:  pkgconfig(xext)
182
BuildRequires:  pkgconfig(zimg) >= 2.7.0
183
BuildRequires:  pkgconfig(zlib)
184
BuildRequires:  pkgconfig(zvbi-0.2) >= 0.2.28
185
186
%if %{with amf_sdk}
187
BuildRequires:  AMF-devel
188
%endif
189
%if %{with mysofa}
190
BuildRequires:  libmysofa-devel
191
%endif
192
%if %{with codec2}
193
BuildRequires:  pkgconfig(codec2)
194
%endif
195
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700
196
BuildRequires:  pkgconfig(libjxl) >= 0.7.0
197
BuildRequires:  pkgconfig(libjxl_threads) >= 0.7.0
198
BuildRequires:  pkgconfig(librist) >= 0.2.7
199
%endif
200
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
201
BuildRequires:  pkgconfig(rav1e) >= 0.5.0
202
%endif
203
%if %{with rubberband}
204
BuildRequires:  pkgconfig(rubberband) >= 1.8.1
205
%endif
206
%if %{with smbclient}
207
BuildRequires:  pkgconfig(smbclient)
208
%endif
209
%if %{with vidstab}
210
BuildRequires:  pkgconfig(vidstab) >= 0.98
211
%endif
212
%if %{with fdk_aac_dlopen}
213
BuildRequires:  pkgconfig(fdk-aac)
214
%endif
215
%if %{with xvid}
216
BuildRequires:  libxvidcore-devel
217
%endif
218
%if %{with opencore}
219
BuildRequires:  pkgconfig(opencore-amrnb)
220
%endif
221
%if %{with amrwb}
222
BuildRequires:  pkgconfig(vo-amrwbenc)
223
%endif
224
%if %{with x264}
225
BuildRequires:  pkgconfig(x264)
226
%endif
227
%if %{with x265}
228
BuildRequires:  pkgconfig(x265)
229
%endif
230
231
%ifarch x86_64 %x86_64 aarch64
232
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
233
BuildRequires:  pkgconfig(SvtAv1Enc) >= 0.9.0
234
%endif
235
%endif
236
237
%if %{with vulkan}
238
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600
239
BuildRequires:  pkgconfig(libplacebo) >= 6.292.0
240
%else
241
BuildRequires:  (pkgconfig(libplacebo) >= 4.192.0 with pkgconfig (libplacebo) < 6.292.0)
242
%endif
243
BuildRequires:  pkgconfig(shaderc) >= 2019.1
244
BuildRequires:  pkgconfig(vulkan) >= 1.3.255
245
%endif
246
247
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
248
%ifarch x86_64 %x86_64
249
BuildRequires:  pkgconfig(vpl) >= 2.6
250
%endif
251
%endif
252
253
Provides:       ffmpeg-tools = %version
254
Conflicts:      ffmpeg-tools
255
Provides:       ffmpeg = %version
256
Obsoletes:      ffmpeg < %version
257
Requires:       (libavcodec61 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
258
Requires:       (libavdevice61 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
259
Requires:       (libavfilter10 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
260
Requires:       (libavformat61 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
261
Requires:       (libavutil59 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
262
Requires:       (libpostproc58 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
263
Requires:       (libswresample5 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
264
Requires:       (libswscale8 = %version-%release or ffmpeg-7-mini-libs = %version-%release)
265
%if "%flavor" == "ffmpeg-7-mini"
266
# Patches may subtly change internal APIs, so we're sticking %%release in
267
# Requires lines. It also conveniently blocks openSUSE libav* being combined
268
# with Packman libav*, due to PM's unique %%release numbers.
269
# This use of %%release with %flavor however requires bcnt synchro:
270
#
271
#!BcntSyncTag:  ffmpeg-7
272
%endif
273
274
%description
275
FFmpeg is a multimedia framework, able to decode, encode,
276
transcode, mux, demux, stream, filter and play several formats
277
that humans and machines have created.
278
%if !0%{?BUILD_ORIG}
279
280
This build of ffmpeg is limited in the number of codecs supported.
281
%endif
282
283
%package -n libavcodec61
284
Summary:        FFmpeg codec library
285
Group:          System/Libraries
286
Requires:       libavutil59 = %version-%release
287
Requires:       libswresample5 = %version-%release
288
%if 0%{?BUILD_ORIG}
289
Provides:       libavcodec-full = %version-%release
290
# This can be (and is) required by packages like vlc-codecs -
291
# do follow the shlib name to not get random lib providers
292
Provides:       libavcodec61(unrestricted)
293
%endif
294
# For mozillas
295
Provides:       libavcodec = %version-%release
296
297
%description -n libavcodec61
298
The libavcodec library provides a generic encoding/decoding framework
299
and contains multiple decoders and encoders for audio, video and
300
subtitle streams, and several bitstream filters.
301
%if !0%{?BUILD_ORIG}
302
303
This build of ffmpeg is limited in the number of codecs supported.
304
%endif
305
306
%package libavcodec-devel
307
Summary:        Development files for FFmpeg's codec library
308
Group:          Development/Libraries/C and C++
309
Provides:       libavcodec-devel = %version-%release
310
Obsoletes:      libavcodec-devel < %version-%release
311
Requires:       %name-libavutil-devel = %version-%release
312
Requires:       libavcodec61 = %version-%release
313
%devel_conflicts -c < -v %_major_version
314
%devel_conflicts -c >= -v %_major_expected
315
316
%description libavcodec-devel
317
The libavcodec library provides a generic encoding/decoding framework
318
and contains multiple decoders and encoders for audio, video and
319
subtitle streams, and several bitstream filters.
320
321
This subpackage contains the headers for FFmpeg libavcodec.
322
323
%package -n libavdevice61
324
Summary:        FFmpeg device library
325
Group:          System/Libraries
326
Requires:       libavcodec61 = %version-%release
327
Requires:       libavfilter10 = %version-%release
328
Requires:       libavformat61 = %version-%release
329
Requires:       libavutil59 = %version-%release
330
331
%description -n libavdevice61
332
The libavdevice library provides a generic framework for grabbing from
333
and rendering to many common multimedia input/output devices, and
334
supports several input and output devices, including Video4Linux2, VfW,
335
DShow, and ALSA.
336
337
%package libavdevice-devel
338
Summary:        Development files for FFmpeg's device library
339
Group:          Development/Libraries/C and C++
340
Provides:       ffmpeg-devel = %version-%release
341
Conflicts:      ffmpeg-devel
342
Provides:       libavdevice-devel = %version-%release
343
Obsoletes:      libavdevice-devel < %version-%release
344
Requires:       %name-libavcodec-devel = %version-%release
345
Requires:       %name-libavfilter-devel = %version-%release
346
Requires:       %name-libavformat-devel = %version-%release
347
Requires:       %name-libavutil-devel = %version-%release
348
Requires:       %name-libpostproc-devel = %version-%release
349
Requires:       %name-libswresample-devel = %version-%release
350
Requires:       %name-libswscale-devel = %version-%release
351
Requires:       libavdevice61 = %version-%release
352
%devel_conflicts -c < -v %_major_version
353
%devel_conflicts -c >= -v %_major_expected
354
355
%description libavdevice-devel
356
The libavdevice library provides a generic framework for grabbing from
357
and rendering to many common multimedia input/output devices, and
358
supports several input and output devices, including Video4Linux2, VfW,
359
DShow, and ALSA.
360
361
This subpackage contains the headers for FFmpeg libavcodec.
362
363
%package -n libavfilter10
364
Summary:        FFmpeg audio and video filtering library
365
Group:          System/Libraries
366
Requires:       libavcodec61 = %version-%release
367
Requires:       libavformat61 = %version-%release
368
Requires:       libavutil59 = %version-%release
369
Requires:       libpostproc58 = %version-%release
370
Requires:       libswresample5 = %version-%release
371
Requires:       libswscale8 = %version-%release
372
373
%description -n libavfilter10
374
The libavfilter library provides a generic audio/video filtering
375
framework containing several filters, sources and sinks.
376
377
%package libavfilter-devel
378
Summary:        Development files for FFmpeg's audio/video filter library
379
Group:          Development/Libraries/C and C++
380
Provides:       libavfilter-devel = %version-%release
381
Obsoletes:      libavfilter-devel < %version-%release
382
Requires:       %name-libavcodec-devel = %version-%release
383
Requires:       %name-libavformat-devel = %version-%release
384
Requires:       %name-libavutil-devel = %version-%release
385
Requires:       %name-libpostproc-devel = %version-%release
386
Requires:       %name-libswresample-devel = %version-%release
387
Requires:       %name-libswscale-devel = %version-%release
388
Requires:       libavfilter10 = %version-%release
389
%devel_conflicts -c < -v %_major_version
390
%devel_conflicts -c >= -v %_major_expected
391
392
%description libavfilter-devel
393
The libavfilter library provides a generic audio/video filtering
394
framework containing several filters, sources and sinks.
395
396
This subpackage contains the headers for FFmpeg libavfilter.
397
398
%package -n libavformat61
399
Summary:        FFmpeg's stream format library
400
Group:          System/Libraries
401
Requires:       libavcodec61 = %version-%release
402
Requires:       libavutil59 = %version-%release
403
404
%description -n libavformat61
405
The libavformat library provides a generic framework for multiplexing
406
and demultiplexing (muxing and demuxing) audio, video and subtitle
407
streams. It encompasses multiple muxers and demuxers for multimedia
408
container formats.
409
%if !0%{?BUILD_ORIG}
410
411
This build of ffmpeg is limited in the number of codecs supported.
412
%endif
413
414
%package libavformat-devel
415
Summary:        Development files for FFmpeg's stream format library
416
Group:          Development/Libraries/C and C++
417
Provides:       libavformat-devel = %version-%release
418
Obsoletes:      libavformat-devel < %version-%release
419
Requires:       %name-libavcodec-devel = %version-%release
420
Requires:       %name-libavutil-devel = %version-%release
421
Requires:       %name-libswresample-devel = %version-%release
422
Requires:       libavformat61 = %version-%release
423
%devel_conflicts -c < -v %_major_version
424
%devel_conflicts -c >= -v %_major_expected
425
426
%description libavformat-devel
427
The libavformat library provides a generic framework for multiplexing
428
and demultiplexing (muxing and demuxing) audio, video and subtitle
429
streams. It encompasses multiple muxers and demuxers for multimedia
430
container formats.
431
432
This subpackage contains the headers for FFmpeg libavformat.
433
434
%package -n libavutil59
435
Summary:        FFmpeg's utility library
436
Group:          System/Libraries
437
438
%description -n libavutil59
439
The libavutil library is a utility library to aid portable multimedia
440
programming. It contains safe portable string functions, random
441
number generators, data structures, additional mathematics functions,
442
cryptography and multimedia related functionality (like enumerations
443
for pixel and sample formats).
444
445
%package libavutil-devel
446
Summary:        Development files for FFmpeg's utility library
447
Group:          Development/Libraries/C and C++
448
Provides:       libavutil-devel = %version-%release
449
Obsoletes:      libavutil-devel < %version-%release
450
Requires:       libavutil59 = %version-%release
451
%devel_conflicts -c < -v %_major_version
452
%devel_conflicts -c >= -v %_major_expected
453
454
%description libavutil-devel
455
The libavutil library is a utility library to aid portable multimedia
456
programming. It contains safe portable string functions, random
457
number generators, data structures, additional mathematics functions,
458
cryptography and multimedia related functionality (like enumerations
459
for pixel and sample formats).
460
461
This subpackage contains the headers for FFmpeg libavutil.
462
463
%package -n libpostproc58
464
Summary:        FFmpeg post-processing library
465
Group:          System/Libraries
466
Requires:       libavutil59 = %version-%release
467
468
%description -n libpostproc58
469
A library with video postprocessing filters, such as deblocking and
470
deringing filters, noise reduction, automatic contrast and brightness
471
correction, linear/cubic interpolating deinterlacing.
472
473
%package libpostproc-devel
474
Summary:        Development files for the FFmpeg post-processing library
475
Group:          Development/Libraries/C and C++
476
Provides:       libpostproc-devel = %version-%release
477
Obsoletes:      libpostproc-devel < %version-%release
478
Requires:       %name-libavutil-devel = %version-%release
479
Requires:       libpostproc58 = %version-%release
480
%devel_conflicts -c < -v %_major_version
481
%devel_conflicts -c >= -v %_major_expected
482
483
%description libpostproc-devel
484
A library with video postprocessing filters, such as deblocking and
485
deringing filters, noise reduction, automatic contrast and brightness
486
correction, linear/cubic interpolating deinterlacing.
487
488
This subpackage contains the headers for FFmpeg libpostproc.
489
490
%package -n libswresample5
491
Summary:        FFmpeg software resampling library
492
Group:          System/Libraries
493
Requires:       libavutil59 = %version-%release
494
495
%description -n libswresample5
496
The libswresample library performs audio conversion between different
497
sample rates, channel layout and channel formats.
498
499
%package libswresample-devel
500
Summary:        Development files for the FFmpeg software resampling library
501
Group:          Development/Libraries/C and C++
502
Provides:       libswresample-devel = %version-%release
503
Obsoletes:      libswresample-devel < %version-%release
504
Requires:       %name-libavutil-devel = %version-%release
505
Requires:       libswresample5 = %version-%release
506
%devel_conflicts -c < -v %_major_version
507
%devel_conflicts -c >= -v %_major_expected
508
509
%description libswresample-devel
510
The libswresample library performs audio conversion between different
511
sample rates, channel layout and channel formats.
512
513
This subpackage contains the headers for FFmpeg libswresample.
514
515
%package -n libswscale8
516
Summary:        FFmpeg image scaling and colorspace/pixel conversion library
517
Group:          System/Libraries
518
Requires:       libavutil59 = %version-%release
519
520
%description -n libswscale8
521
The libswscale library performs image scaling and colorspace and
522
pixel format conversion operations.
523
524
%package libswscale-devel
525
Summary:        Development files for FFmpeg's image scaling and colorspace library
526
Group:          Development/Libraries/C and C++
527
Conflicts:      libswscale-devel
528
Provides:       libswscale-devel = %version-%release
529
Requires:       %name-libavutil-devel = %version-%release
530
Requires:       libswscale8 = %version-%release
531
%devel_conflicts -c < -v %_major_version
532
%devel_conflicts -c >= -v %_major_expected
533
534
%description libswscale-devel
535
The libswscale library performs image scaling and colorspace and
536
pixel format conversion operations.
537
538
This subpackage contains the headers for FFmpeg libswscale.
539
540
%prep
541
%autosetup -p1 -a6 -n %_name-%version
542
543
%build
544
%ifarch %ix86 %arm
545
%define _lto_cflags %nil
546
%endif
547
%if "%_lto_cflags" != ""
548
%global _lto_cflags %_lto_cflags -ffat-lto-objects
549
%endif
550
CFLAGS="%optflags" \
551
%if 0%{?suse_version} > 1500
552
%ifarch %ix86
553
%else
554
LDFLAGS="%_lto_cflags" \
555
%endif
556
%endif
557
./configure \
558
    --prefix="%_prefix" \
559
    --libdir="%_libdir" \
560
    --shlibdir="%_libdir" \
561
    --incdir="%_includedir/ffmpeg" \
562
    --extra-cflags="%optflags" \
563
    --optflags="%optflags" \
564
    --disable-htmlpages \
565
    --enable-pic \
566
    --disable-stripping \
567
    --enable-shared \
568
    --disable-static \
569
    --enable-gpl \
570
    --enable-version3 \
571
%if %{with smbclient}
572
    --enable-libsmbclient \
573
%endif
574
    --disable-openssl \
575
    --enable-gnutls \
576
    --enable-ladspa \
577
%if %{with vulkan}
578
    --enable-libshaderc \
579
    --enable-vulkan \
580
    --enable-libplacebo \
581
%endif
582
%if %{with amf}
583
        --enable-amf \
584
%endif
585
%if !%{with cuda_sdk}
586
    --disable-cuda-sdk \
587
%endif
588
    --enable-libaom \
589
    --enable-libass \
590
    --enable-libbluray \
591
    --enable-libbs2b \
592
    --enable-libcdio \
593
%if %{with codec2}
594
    --enable-libcodec2 \
595
%endif
596
    --enable-libdav1d \
597
    --enable-libdc1394 \
598
    --enable-libdrm \
599
    --enable-libfontconfig \
600
    --enable-libfreetype \
601
    --enable-libfribidi \
602
    --enable-libgsm \
603
    --enable-libjack \
604
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700
605
    --enable-libjxl \
606
    --enable-librist \
607
%endif
608
    --enable-libmp3lame \
609
%if %{with mysofa}
610
    --enable-libmysofa \
611
%endif
612
    --enable-libopenjpeg \
613
    --enable-libopenmpt \
614
    --enable-libopenh264-dlopen \
615
    --enable-libopus \
616
    --enable-libpulse \
617
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
618
    --enable-librav1e \
619
%endif
620
%if %{with rubberband}
621
    --enable-librubberband \
622
%endif
623
%ifarch x86_64 %x86_64 aarch64
624
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
625
    --enable-libsvtav1 \
626
%endif
627
%endif
628
    --enable-libsoxr \
629
    --enable-libspeex \
630
    --enable-libssh \
631
    --enable-libsrt \
632
    --enable-libtheora \
633
    --enable-libtwolame \
634
%if %{with vidstab}
635
    --enable-libvidstab \
636
%endif
637
    --enable-libvmaf \
638
    --enable-libvorbis \
639
    --enable-libvpx \
640
    --enable-libwebp \
641
    --enable-libxml2 \
642
    --enable-libzimg \
643
    --enable-libzmq \
644
    --enable-libzvbi \
645
%if 0%{?suse_version} > 1500
646
%ifarch %ix86
647
%else
648
    --enable-lto \
649
%endif
650
%endif
651
    --enable-lv2 \
652
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
653
%ifarch x86_64 %x86_64
654
    --enable-libvpl \
655
%endif
656
%endif
657
    --enable-vaapi \
658
    --enable-vdpau \
659
    --enable-version3 \
660
%if %{with fdk_aac_dlopen}
661
    --enable-libfdk-aac-dlopen \
662
    --enable-nonfree \
663
%endif
664
%if %{with opencore}
665
    --enable-libopencore-amrnb \
666
    --enable-libopencore-amrwb \
667
%endif
668
%if %{with amrwb}
669
    --enable-libvo-amrwbenc \
670
%endif
671
%if %{with x264}
672
    --enable-libx264 \
673
%endif
674
%if %{with x265}
675
    --enable-libx265 \
676
%endif
677
%if %{with xvid}
678
    --enable-libxvid \
679
%endif
680
%if !0%{?BUILD_ORIG}
681
    --enable-muxers \
682
    --enable-demuxers \
683
    --disable-encoders \
684
    --disable-decoders \
685
    --disable-decoder=h264,hevc,vc1 \
686
    --enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_encoders)" \
687
    --enable-decoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_decoders)" \
688
689
for i in H264 HEVC VC1; do
690
    grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
691
done
692
%endif
693
694
cat config.h
695
%make_build
696
697
%global extratools aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper probetest qt-faststart seek_print sidxindex trasher
698
699
for i in %extratools; do
700
    %make_build "tools/$i"
701
done
702
703
%install
704
b="%buildroot"
705
%make_install install-man
706
rm -Rf "$b/%_datadir/ffmpeg/examples"
707
for i in %extratools; do
708
    cp -a "tools/$i" "$b/%_bindir/"
709
done
710
711
%post   -n libavcodec61 -p /sbin/ldconfig
712
%postun -n libavcodec61 -p /sbin/ldconfig
713
%post   -n libavdevice61 -p /sbin/ldconfig
714
%postun -n libavdevice61 -p /sbin/ldconfig
715
%post   -n libavfilter10 -p /sbin/ldconfig
716
%postun -n libavfilter10 -p /sbin/ldconfig
717
%post   -n libavformat61 -p /sbin/ldconfig
718
%postun -n libavformat61 -p /sbin/ldconfig
719
%post   -n libavutil59 -p /sbin/ldconfig
720
%postun -n libavutil59 -p /sbin/ldconfig
721
%post   -n libpostproc58 -p /sbin/ldconfig
722
%postun -n libpostproc58 -p /sbin/ldconfig
723
%post   -n libswresample5 -p /sbin/ldconfig
724
%postun -n libswresample5 -p /sbin/ldconfig
725
%post   -n libswscale8 -p /sbin/ldconfig
726
%postun -n libswscale8 -p /sbin/ldconfig
727
728
%files
729
%doc Changelog CREDITS README.md
730
%_bindir/*
731
%_mandir/man1/ff*.1*
732
%_datadir/ffmpeg/
733
734
%files -n libavcodec61
735
%license COPYING.GPLv2 LICENSE.md
736
%_libdir/libavcodec.so.*
737
738
%files -n libavdevice61
739
%license COPYING.GPLv2 LICENSE.md
740
%_libdir/libavdevice.so.*
741
742
%files -n libavfilter10
743
%license COPYING.GPLv2 LICENSE.md
744
%_libdir/libavfilter.so.*
745
746
%files -n libavformat61
747
%license COPYING.GPLv2 LICENSE.md
748
%_libdir/libavformat.so.*
749
750
%files -n libavutil59
751
%license COPYING.GPLv2 LICENSE.md
752
%_libdir/libavutil.so.*
753
754
%files -n libpostproc58
755
%license COPYING.GPLv2 LICENSE.md
756
%_libdir/libpostproc.so.*
757
758
%files -n libswresample5
759
%license COPYING.GPLv2 LICENSE.md
760
%_libdir/libswresample.so.*
761
762
%files -n libswscale8
763
%license COPYING.GPLv2 LICENSE.md
764
%_libdir/libswscale.so.*
765
766
%files libavcodec-devel
767
%dir %_includedir/ffmpeg/
768
%_includedir/ffmpeg/libavcodec/
769
%_libdir/libavcodec.so
770
%_libdir/pkgconfig/libavcodec.pc
771
%_mandir/man3/libavcodec.3*
772
773
%files libavdevice-devel
774
%dir %_includedir/ffmpeg/
775
%_includedir/ffmpeg/libavdevice/
776
%_libdir/libavdevice.so
777
%_libdir/pkgconfig/libavdevice.pc
778
%_mandir/man3/libavdevice.3*
779
780
%files libavfilter-devel
781
%dir %_includedir/ffmpeg/
782
%_includedir/ffmpeg/libavfilter/
783
%_libdir/libavfilter.so
784
%_libdir/pkgconfig/libavfilter.pc
785
%_mandir/man3/libavfilter.3*
786
787
%files libavformat-devel
788
%dir %_includedir/ffmpeg/
789
%_includedir/ffmpeg/libavformat/
790
%_libdir/libavformat.so
791
%_libdir/pkgconfig/libavformat.pc
792
%_mandir/man3/libavformat.3*
793
794
%files libavutil-devel
795
%dir %_includedir/ffmpeg/
796
%_includedir/ffmpeg/libavutil/
797
%_libdir/libavutil.so
798
%_libdir/pkgconfig/libavutil.pc
799
%_mandir/man3/libavutil.3*
800
801
%files libpostproc-devel
802
%dir %_includedir/ffmpeg/
803
%_includedir/ffmpeg/libpostproc/
804
%_libdir/libpostproc.so
805
%_libdir/pkgconfig/libpostproc.pc
806
807
%files libswresample-devel
808
%dir %_includedir/ffmpeg/
809
%_includedir/ffmpeg/libswresample/
810
%_libdir/libswresample.so
811
%_libdir/pkgconfig/libswresample.pc
812
%_mandir/man3/libswresample.3*
813
814
%files libswscale-devel
815
%dir %_includedir/ffmpeg/
816
%_includedir/ffmpeg/libswscale/
817
%_libdir/libswscale.so
818
%_libdir/pkgconfig/libswscale.pc
819
%_mandir/man3/libswscale.3*
820
821
%else
822
%define _name ffmpeg
823
Name:           ffmpeg-7-mini
824
Version:        7.1
825
Release:        0
826
Summary:        Set of libraries for working with various multimedia formats
827
License:        GPL-3.0-or-later
828
URL:            https://ffmpeg.org/
829
#Git-Clone:     git://source.ffmpeg.org/ffmpeg
830
Source:         https://www.ffmpeg.org/releases/%_name-%version.tar.xz
831
Source2:        https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
832
Source3:        ffmpeg-7-rpmlintrc
833
Source98:       http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-7.keyring
834
Patch1:         ffmpeg-arm6l.diff
835
Patch3:         ffmpeg-codec-choice.diff
836
Patch4:         ffmpeg-4.2-dlopen-fdk_aac.patch
837
Patch5:         work-around-abi-break.patch
838
Patch10:        ffmpeg-chromium.patch
839
Patch91:        ffmpeg-dlopen-openh264.patch
840
Patch15:        11013-avcodec-decode-clean-up-if-get_hw_frames_parameters-.patch
841
BuildRequires:  c_compiler
842
Requires:       this-is-only-for-build-envs
843
844
%description
845
FFmpeg is a multimedia framework.
846
This package merely builds the API for the sake of other packages.
847
848
%package libs
849
# Even with mini, we want ff5 libs to be coinstallable to ff4-devel(!),
850
# hence mini-libs and mini-devel are still separated.
851
Summary:        Feature-reduced build of FFmpeg, a multimedia framework
852
Conflicts:      libavcodec61
853
Conflicts:      libavdevice61
854
Conflicts:      libavfilter10
855
Conflicts:      libavformat61
856
Conflicts:      libavutil59
857
Conflicts:      libpostproc58
858
Conflicts:      libswresample5
859
Conflicts:      libswscale8
860
Requires:       this-is-only-for-build-envs
861
862
%description libs
863
FFmpeg is a multimedia framework.
864
This package contains a cut-down version for building other packages.
865
866
%package devel
867
Summary:        Header files for feature-reduced FFmpeg build
868
Provides:       libavcodec-devel = %version-%release
869
Conflicts:      libavcodec-devel
870
Provides:       libavdevice-devel = %version-%release
871
Conflicts:      libavdevice-devel
872
Provides:       libavfilter-devel = %version-%release
873
Conflicts:      libavfilter-devel
874
Provides:       libavformat-devel = %version-%release
875
Conflicts:      libavformat-devel
876
Provides:       libavutil-devel = %version-%release
877
Conflicts:      libavutil-devel
878
Provides:       libpostproc-devel = %version-%release
879
Conflicts:      libpostproc-devel
880
Provides:       libswresample-devel = %version-%release
881
Conflicts:      libswresample-devel
882
Provides:       libswscale-devel = %version-%release
883
Conflicts:      libswscale-devel
884
Requires:       %name-libs = %version-%release
885
Requires:       this-is-only-for-build-envs
886
887
%description devel
888
FFmpeg is a multimedia framework.
889
This package contains the headers accompanying %name.
890
891
%prep
892
%autosetup -p1 -n %_name-%version
893
894
%build
895
%define _lto_cflags %nil
896
CFLAGS="%optflags" \
897
./configure \
898
    --prefix="%_prefix" \
899
    --libdir="%_libdir" \
900
    --shlibdir="%_libdir" \
901
    --incdir="%_includedir/ffmpeg" \
902
    --extra-cflags="%optflags" \
903
    --optflags="%optflags" \
904
    --disable-htmlpages --disable-stripping --disable-x86asm \
905
    --disable-static --enable-shared --enable-pic \
906
    --enable-gpl --enable-version3 \
907
    --disable-muxers --disable-demuxers \
908
    --disable-encoders --disable-decoders \
909
    --disable-programs --disable-doc
910
for i in H264 HEVC VC1; do
911
    grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
912
done
913
cat config.h
914
%make_build
915
916
%install
917
b="%buildroot"
918
%make_install
919
rm -Rf "$b/%_datadir/ffmpeg/examples"
920
921
%post   libs -p /sbin/ldconfig
922
%postun libs -p /sbin/ldconfig
923
924
%files libs
925
%_libdir/libavcodec.so.*
926
%_libdir/libavdevice.so.*
927
%_libdir/libavfilter.so.*
928
%_libdir/libavformat.so.*
929
%_libdir/libavutil.so.*
930
%_libdir/libpostproc.so.*
931
%_libdir/libswresample.so.*
932
%_libdir/libswscale.so.*
933
934
%files devel
935
%license COPYING.GPLv2 LICENSE.md
936
%_libdir/*.so
937
%_libdir/pkgconfig/*.pc
938
%_includedir/ffmpeg/
939
940
%endif
941
942
%changelog
943