File ffmpeg-5.spec of Package ffmpeg-5

#
# spec file for package ffmpeg-5
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define BUILD_ORIG 1
%define flavor %{nil}
%if "%{flavor}" != "ffmpeg-5-mini"

# Create proper conflicts to make sure we require all from one version
# p:   Conflict string, eg if you need them all for requires instead
#      Default value Conflicts:
# c:   copmare string ie "<" or ">=", must be defined
# v:   version string ie. "< 42.3.4" or ">= 15.0.2.1", must be defined
%define devel_conflicts(p:c:v:) \
%define preamble_string %{-p:%{-p*}}%{!-p:Conflicts:} \
%define comparator %{-c:%{-c*}}%{!-c:%{error:Comparator not defined}} \
%define conflicts_version %{-v:%{-v*}}%{!-v:%{error:Version not defined}} \
\
%preamble_string libavcodec-devel %comparator %conflicts_version \
%preamble_string libavdevice-devel %comparator %conflicts_version \
%preamble_string libavfilter-devel %comparator %conflicts_version \
%preamble_string libavformat-devel %comparator %conflicts_version \
%preamble_string libavutil-devel %comparator %conflicts_version \
%preamble_string libpostproc-devel %comparator %conflicts_version \
%preamble_string libswresample-devel %comparator %conflicts_version \
%preamble_string libswscale-devel %comparator %conflicts_version \
%preamble_string ffmpeg-private-devel %comparator %conflicts_version \
%nil

%if 0%{?BUILD_ORIG}
%bcond_without amf_sdk
%bcond_without cuda_sdk
%else
# If software H264 is disabled, the hw driver must be as well:
# HW drivers can fail to initialize, namely when the hardware is absent.
# Browsers choose video formats on sites like youtube based on `ffmpeg
# -codecs` rather than the success/failure status of libav* initialization.
# This becomes a problem when a format only has a HW driver;
# the browser thinks it can do H264 but never succeeds.
%bcond_with    amf_sdk
%bcond_with    cuda_sdk
%endif
%bcond_with    amrwb
%bcond_with    fdk_aac_dlopen
%bcond_with    opencore
%bcond_with    smbclient
%bcond_with    x264
%bcond_with    x265
%bcond_with    xvid

%if 0%{?suse_version} > 1600
%bcond_without mysofa
%bcond_without vidstab
%bcond_without codec2
%bcond_without rubberband
%bcond_without vulkan
%bcond_without amrwb
%bcond_without opencore
%bcond_without xvid
%else
%if 0%{?suse_version} > 1500
%bcond_without mysofa
%bcond_without vidstab
%bcond_without codec2
%bcond_without rubberband
%bcond_without vulkan
%bcond_without amrwb
%bcond_without opencore
%else
%bcond_with mysofa
%bcond_with vidstab
%bcond_with codec2
%bcond_with rubberband
%bcond_with vulkan
%endif
%endif

%define _name ffmpeg
%define _major_version 5
%define _major_expected 6

Name:           ffmpeg-5
Version:        5.1.4
Release:        lp156.117.1
Summary:        Set of libraries for working with various multimedia formats
License:        GPL-3.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
#Git-Clone:     git://source.ffmpeg.org/ffmpeg
URL:            https://ffmpeg.org/
Source:         https://www.ffmpeg.org/releases/%_name-%version.tar.xz
Source2:        https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
Source3:        ffmpeg-5-rpmlintrc
Source4:        enable_decoders
Source5:        enable_encoders
Source6:        ffmpeg-dlopen-headers.tar.xz
Source92:       ffmpeg_get_dlopen_headers.sh
Source98:       http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-5.keyring
Source99:       baselibs.conf
Patch1:         ffmpeg-arm6l.diff
Patch2:         ffmpeg-new-coder-errors.diff
Patch3:         ffmpeg-codec-choice.diff
Patch4:         ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5:         work-around-abi-break.patch
Patch9:         ffmpeg-4.4-CVE-2020-22046.patch
Patch10:        0001-avfilter-af_dialoguenhance-fix-overreads.patch
Patch11:        0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch
Patch12:        0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
Patch13:        0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
Patch14:        0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
Patch15:        0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
Patch16:        0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
Patch17:        0001-avfilter-af_stereowiden-Check-length.patch
Patch18:        0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch
Patch19:        0001-avutil-hwcontext_vaapi-use-the-correct-type-for-VASu.patch
Patch90:        ffmpeg-chromium.patch
Patch91:        ffmpeg-dlopen-openh264.patch
Patch93:        soname.diff
Patch94:        ffmpeg-CVE-2023-50007.patch
Patch95:        ffmpeg-CVE-2023-50008.patch
Patch96:        ffmpeg-CVE-2023-49502.patch
Patch97:        ffmpeg-CVE-2023-51793.patch
Patch98:        ffmpeg-Templatify-ff_gaussian_blur-and-ff-function.patch
Patch99:        ffmpeg-CVE-2023-50009.patch
Patch100:       ffmpeg-CVE-2023-50010.patch
Patch102:       ffmpeg-5-CVE-2024-32230.patch
Patch103:       ffmpeg-5-CVE-2024-7272.patch
Patch104:       ffmpeg-5-CVE-2024-7055.patch
#
# preamble is present twice, watch out
#
%if %{with amf_sdk}
BuildRequires:  AMF-devel
%endif
BuildRequires:  ladspa-devel
BuildRequires:  libgsm-devel
BuildRequires:  libmp3lame-devel
%if %{with mysofa}
BuildRequires:  libmysofa-devel
%endif
BuildRequires:  nasm
BuildRequires:  pkg-config
%ifarch x86_64 %x86_64
%if 0%{?suse_version} >= 1550
BuildRequires:  pkgconfig(SvtAv1Enc) >= 0.8.4
%endif
%endif
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(aom)
BuildRequires:  pkgconfig(bzip2)
%if %{with codec2}
BuildRequires:  pkgconfig(codec2)
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
BuildRequires:  pkgconfig(dav1d)
%endif
BuildRequires:  pkgconfig(ffnvcodec)
BuildRequires:  pkgconfig(fontconfig) >= 2.4.2
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(fribidi) >= 0.19.0
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libass)
BuildRequires:  pkgconfig(libbluray)
BuildRequires:  pkgconfig(libbs2b)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libcdio_paranoia)
BuildRequires:  pkgconfig(libdc1394-2)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libgme)
BuildRequires:  pkgconfig(libopenjp2) >= 2.1.0
BuildRequires:  pkgconfig(libopenmpt)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libraw1394)
BuildRequires:  pkgconfig(libssh)
BuildRequires:  pkgconfig(libva) >= 0.35.0
BuildRequires:  pkgconfig(libva-drm)
BuildRequires:  pkgconfig(libva-x11)
BuildRequires:  pkgconfig(libvmaf) >= 1.3.9
BuildRequires:  pkgconfig(libwebp) >= 0.4
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libzmq)
BuildRequires:  pkgconfig(lilv-0)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(opus)
%if 0%{?suse_version} >= 1550
BuildRequires:  pkgconfig(librist)
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
BuildRequires:  pkgconfig(rav1e)
%endif
%if %{with rubberband}
BuildRequires:  pkgconfig(rubberband)
%endif
BuildRequires:  pkgconfig(sdl2)
%if %{with smbclient}
BuildRequires:  pkgconfig(smbclient)
%endif
BuildRequires:  pkgconfig(soxr)
BuildRequires:  pkgconfig(speex)
BuildRequires:  pkgconfig(srt)
BuildRequires:  pkgconfig(theora) >= 1.1
BuildRequires:  pkgconfig(twolame)
BuildRequires:  pkgconfig(vdpau)
%if %{with vidstab}
BuildRequires:  pkgconfig(vidstab) >= 0.98
%endif
%if %{with vulkan}
BuildRequires:  pkgconfig(shaderc)
BuildRequires:  pkgconfig(vulkan)
%endif
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vpx) >= 1.4.0
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcb)
BuildRequires:  pkgconfig(xcb-render)
BuildRequires:  pkgconfig(xcb-shape)
BuildRequires:  pkgconfig(xcb-shm)
BuildRequires:  pkgconfig(xcb-xfixes)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(zimg)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(zvbi-0.2) >= 0.2.28
%if %{with fdk_aac_dlopen}
BuildRequires:  pkgconfig(fdk-aac)
%endif
%if %{with xvid}
BuildRequires:  libxvidcore-devel
%endif
%if %{with opencore}
BuildRequires:  pkgconfig(opencore-amrnb)
%endif
%if %{with amrwb}
BuildRequires:  pkgconfig(vo-amrwbenc)
%endif
%if %{with x264}
BuildRequires:  pkgconfig(x264)
%endif
%if %{with x265}
BuildRequires:  pkgconfig(x265)
%endif
Provides:       ffmpeg-tools = %version
Conflicts:      ffmpeg-tools
Provides:       ffmpeg = %version
Obsoletes:      ffmpeg < %version
Requires:       libavcodec59 = %version-%release
Requires:       libavdevice59 = %version-%release
Requires:       libavfilter8 = %version-%release
Requires:       libavformat59 = %version-%release
Requires:       libavutil57 = %version-%release
Requires:       libpostproc56 = %version-%release
Requires:       libswresample4_ff5 = %version-%release
Requires:       libswscale6 = %version-%release

%description
FFmpeg is a multimedia framework, able to decode, encode,
transcode, mux, demux, stream, filter and play several formats
that humans and machines have created.
%if !0%{?BUILD_ORIG}

This build of ffmpeg is limited in the number of codecs supported.
%endif

%package -n libavcodec59
Summary:        FFmpeg codec library
Group:          System/Libraries
Requires:       libavutil57 = %version-%release
Requires:       libswresample4_ff5 = %version-%release
%if 0%{?BUILD_ORIG}
Provides:       libavcodec-full = %version-%release
# This can be (and is) required by packages like vlc-codecs -
# do follow the shlib name to not get random lib providers
Provides:       libavcodec59(unrestricted)
%endif
# For mozillas
Provides:       libavcodec = %version-%release

%description -n libavcodec59
The libavcodec library provides a generic encoding/decoding framework
and contains multiple decoders and encoders for audio, video and
subtitle streams, and several bitstream filters.
%if !0%{?BUILD_ORIG}

This build of ffmpeg is limited in the number of codecs supported.
%endif

%package libavcodec-devel
Summary:        Development files for FFmpeg's codec library
Group:          Development/Libraries/C and C++
Provides:       libavcodec-devel = %version-%release
Obsoletes:      libavcodec-devel < %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       libavcodec59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libavcodec-devel
The libavcodec library provides a generic encoding/decoding framework
and contains multiple decoders and encoders for audio, video and
subtitle streams, and several bitstream filters.

This subpackage contains the headers for FFmpeg libavcodec.

%package -n libavdevice59
Summary:        FFmpeg device library
Group:          System/Libraries
Requires:       libavcodec59 = %version-%release
Requires:       libavfilter8 = %version-%release
Requires:       libavformat59 = %version-%release
Requires:       libavutil57 = %version-%release

%description -n libavdevice59
The libavdevice library provides a generic framework for grabbing from
and rendering to many common multimedia input/output devices, and
supports several input and output devices, including Video4Linux2, VfW,
DShow, and ALSA.

%package libavdevice-devel
Summary:        Development files for FFmpeg's device library
Group:          Development/Libraries/C and C++
Provides:       ffmpeg-devel = %version-%release
Conflicts:      ffmpeg-devel
Provides:       libavdevice-devel = %version-%release
Obsoletes:      libavdevice-devel < %version-%release
Requires:       %name-libavcodec-devel = %version-%release
Requires:       %name-libavfilter-devel = %version-%release
Requires:       %name-libavformat-devel = %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       %name-libpostproc-devel = %version-%release
Requires:       %name-libswresample-devel = %version-%release
Requires:       %name-libswscale-devel = %version-%release
Requires:       libavdevice59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libavdevice-devel
The libavdevice library provides a generic framework for grabbing from
and rendering to many common multimedia input/output devices, and
supports several input and output devices, including Video4Linux2, VfW,
DShow, and ALSA.

This subpackage contains the headers for FFmpeg libavcodec.

%package -n libavfilter8
Summary:        FFmpeg audio and video filtering library
Group:          System/Libraries
Requires:       libavcodec59 = %version-%release
Requires:       libavformat59 = %version-%release
Requires:       libavutil57 = %version-%release
Requires:       libpostproc56 = %version-%release
Requires:       libswresample4_ff5 = %version-%release
Requires:       libswscale6 = %version-%release

%description -n libavfilter8
The libavfilter library provides a generic audio/video filtering
framework containing several filters, sources and sinks.

%package libavfilter-devel
Summary:        Development files for FFmpeg's audio/video filter library
Group:          Development/Libraries/C and C++
Provides:       libavfilter-devel = %version-%release
Obsoletes:      libavfilter-devel < %version-%release
Requires:       %name-libavcodec-devel = %version-%release
Requires:       %name-libavformat-devel = %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       %name-libpostproc-devel = %version-%release
Requires:       %name-libswresample-devel = %version-%release
Requires:       %name-libswscale-devel = %version-%release
Requires:       libavfilter8 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libavfilter-devel
The libavfilter library provides a generic audio/video filtering
framework containing several filters, sources and sinks.

This subpackage contains the headers for FFmpeg libavfilter.

%package -n libavformat59
Summary:        FFmpeg's stream format library
Group:          System/Libraries
Requires:       libavcodec59 = %version-%release
Requires:       libavutil57 = %version-%release

%description -n libavformat59
The libavformat library provides a generic framework for multiplexing
and demultiplexing (muxing and demuxing) audio, video and subtitle
streams. It encompasses multiple muxers and demuxers for multimedia
container formats.
%if !0%{?BUILD_ORIG}

This build of ffmpeg is limited in the number of codecs supported.
%endif

%package libavformat-devel
Summary:        Development files for FFmpeg's stream format library
Group:          Development/Libraries/C and C++
Provides:       libavformat-devel = %version-%release
Obsoletes:      libavformat-devel < %version-%release
Requires:       %name-libavcodec-devel = %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       %name-libswresample-devel = %version-%release
Requires:       libavformat59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libavformat-devel
The libavformat library provides a generic framework for multiplexing
and demultiplexing (muxing and demuxing) audio, video and subtitle
streams. It encompasses multiple muxers and demuxers for multimedia
container formats.

This subpackage contains the headers for FFmpeg libavformat.

%package -n libavutil57
Summary:        FFmpeg's utility library
Group:          System/Libraries

%description -n libavutil57
The libavutil library is a utility library to aid portable multimedia
programming. It contains safe portable string functions, random
number generators, data structures, additional mathematics functions,
cryptography and multimedia related functionality (like enumerations
for pixel and sample formats).

%package libavutil-devel
Summary:        Development files for FFmpeg's utility library
Group:          Development/Libraries/C and C++
Provides:       libavutil-devel = %version-%release
Obsoletes:      libavutil-devel < %version-%release
Requires:       libavutil57 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libavutil-devel
The libavutil library is a utility library to aid portable multimedia
programming. It contains safe portable string functions, random
number generators, data structures, additional mathematics functions,
cryptography and multimedia related functionality (like enumerations
for pixel and sample formats).

This subpackage contains the headers for FFmpeg libavutil.

%package -n libpostproc56
Summary:        FFmpeg post-processing library
Group:          System/Libraries
Requires:       libavutil57 = %version-%release

%description -n libpostproc56
A library with video postprocessing filters, such as deblocking and
deringing filters, noise reduction, automatic contrast and brightness
correction, linear/cubic interpolating deinterlacing.

%package libpostproc-devel
Summary:        Development files for the FFmpeg post-processing library
Group:          Development/Libraries/C and C++
Provides:       libpostproc-devel = %version-%release
Obsoletes:      libpostproc-devel < %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       libpostproc56 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libpostproc-devel
A library with video postprocessing filters, such as deblocking and
deringing filters, noise reduction, automatic contrast and brightness
correction, linear/cubic interpolating deinterlacing.

This subpackage contains the headers for FFmpeg libpostproc.

%package -n libswresample4_ff5
Summary:        FFmpeg software resampling library
Group:          System/Libraries
Requires:       libavutil57 = %version-%release
Obsoletes:      libswresample4 < %version-%release

%description -n libswresample4_ff5
The libswresample library performs audio conversion between different
sample rates, channel layout and channel formats.

%package libswresample-devel
Summary:        Development files for the FFmpeg software resampling library
Group:          Development/Libraries/C and C++
Provides:       libswresample-devel = %version-%release
Obsoletes:      libswresample-devel < %version-%release
Requires:       %name-libavutil-devel = %version-%release
Requires:       libswresample4_ff5 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libswresample-devel
The libswresample library performs audio conversion between different
sample rates, channel layout and channel formats.

This subpackage contains the headers for FFmpeg libswresample.

%package -n libswscale6
Summary:        FFmpeg image scaling and colorspace/pixel conversion library
Group:          System/Libraries
Requires:       libavutil57 = %version-%release

%description -n libswscale6
The libswscale library performs image scaling and colorspace and
pixel format conversion operations.

%package libswscale-devel
Summary:        Development files for FFmpeg's image scaling and colorspace library
Group:          Development/Libraries/C and C++
Provides:       libswscale-devel = %version-%release
Conflicts:      libswscale-devel
Requires:       %name-libavutil-devel = %version-%release
Requires:       libswscale6 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description libswscale-devel
The libswscale library performs image scaling and colorspace and
pixel format conversion operations.

This subpackage contains the headers for FFmpeg libswscale.

%package private-devel
Summary:        Some FFmpeg private headers
Group:          Development/Libraries/C and C++
Requires:       %name-libavcodec-devel = %version-%release
Requires:       %name-libavformat-devel = %version-%release
Requires:       %name-libavutil-devel = %version-%release
Provides:       ffmpeg-private-devel = %version
Obsoletes:      ffmpeg-private-devel < %version
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected

%description private-devel
FFmpeg is a multimedia framework, able to decode, encode,
transcode, mux, demux, stream, filter and play several formats
that humans and machines have created.

This package contains some private headers for libavformat, libavcodec and
libavutil which are needed by libav-tools to build. No other package apart
from libav should depend on these private headers which are expected to
break compatibility without any notice.

%prep
%autosetup -a6 -p1 -n %_name-%version

%build
%ifarch %ix86 %arm
%define _lto_cflags %nil
%endif
%if "%_lto_cflags" != ""
%global _lto_cflags %_lto_cflags -ffat-lto-objects
%endif
CFLAGS="%optflags" \
%if %suse_version > 1500
%ifarch %ix86
%else
LDFLAGS="%_lto_cflags" \
%endif
%endif
./configure \
	--prefix="%_prefix" \
	--libdir="%_libdir" \
	--shlibdir="%_libdir" \
	--incdir="%_includedir/ffmpeg" \
	--extra-cflags="%optflags" \
	--optflags="%optflags" \
	--disable-htmlpages \
	--enable-pic \
	--disable-stripping \
	--enable-shared \
	--disable-static \
	--enable-gpl \
	--enable-version3 \
%if %{with smbclient}
	--enable-libsmbclient \
%endif
	--disable-openssl \
	--enable-gnutls \
	--enable-ladspa \
%if %{with vulkan}
	--enable-libshaderc --enable-vulkan \
%endif
%if %{with amf}
        --enable-amf \
%endif
%if !%{with cuda_sdk}
	--disable-cuda-sdk \
%endif
	--enable-libaom \
	--enable-libass \
	--enable-libbluray \
	--enable-libbs2b \
	--enable-libcdio \
%if %{with codec2}
	--enable-libcodec2 \
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
	--enable-libdav1d \
%endif
	--enable-libdc1394 \
	--enable-libdrm \
	--enable-libfontconfig \
	--enable-libfreetype \
	--enable-libfribidi \
	--enable-libgsm \
	--enable-libjack \
%if 0%{?suse_version} >= 1550
	--enable-librist \
%endif
	--enable-libmp3lame \
%if %{with mysofa}
	--enable-libmysofa \
%endif
	--enable-libopenjpeg \
	--enable-libopenmpt \
	--enable-libopenh264-dlopen \
	--enable-libopus \
	--enable-libpulse \
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
	--enable-librav1e \
%endif
%if %{with rubberband}
	--enable-librubberband \
%endif
%ifarch x86_64 %x86_64
%if 0%{?suse_version} >= 1550
	--enable-libsvtav1 \
%endif
%endif
	--enable-libsoxr \
	--enable-libspeex \
	--enable-libssh \
	--enable-libsrt \
	--enable-libtheora \
	--enable-libtwolame \
%if %{with vidstab}
	--enable-libvidstab \
%endif
	--enable-libvmaf \
	--enable-libvorbis \
	--enable-libvpx \
	--enable-libwebp \
	--enable-libxml2 \
	--enable-libzimg \
	--enable-libzmq \
	--enable-libzvbi \
%if 0%{?suse_version} > 1500
%ifarch %ix86
%else
	--enable-lto \
%endif
%endif
	--enable-lv2 \
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150200
%endif
	--enable-vaapi \
	--enable-vdpau \
	--enable-version3 \
%if %{with fdk_aac_dlopen}
	--enable-libfdk-aac-dlopen \
	--enable-nonfree \
%endif
%if %{with opencore}
	--enable-libopencore-amrnb \
	--enable-libopencore-amrwb \
%endif
%if %{with amrwb}
	--enable-libvo-amrwbenc \
%endif
%if %{with x264}
	--enable-libx264 \
%endif
%if %{with x265}
	--enable-libx265 \
%endif
%if %{with xvid}
	--enable-libxvid \
%endif
%if !0%{?BUILD_ORIG}
	--enable-muxers \
	--enable-demuxers \
	--disable-encoders \
	--disable-decoders \
	--disable-decoder=h264,hevc,vc1 \
	--enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_encoders)" \
	--enable-decoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_decoders)" \

for i in H264 HEVC VC1; do
	grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
done
%endif

cat config.h
%make_build

%global extratools aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper probetest qt-faststart seek_print sidxindex trasher

for i in %extratools; do
	%make_build "tools/$i"
done

%install
b="%buildroot"
%make_install install-man
rm -Rf "$b/%_datadir/ffmpeg/examples"
for i in %extratools; do
	cp -a "tools/$i" "$b/%_bindir/"
done

# Install private headers required by libav-tools
for i in libavformat/options_table.h libavformat/os_support.h \
  libavformat/internal.h libavcodec/options_table.h libavutil/libm.h \
  libavutil/internal.h libavutil/colorspace.h libavutil/timer.h \
  libavutil/x86/emms.h libavutil/aarch64/timer.h libavutil/arm/timer.h \
  libavutil/bfin/timer.h libavutil/ppc/timer.h libavutil/x86/timer.h; do
	mkdir -p "$b/%_includedir/ffmpeg/private/"`dirname $i`
	cp -a $i "$b/%_includedir/ffmpeg/private/$i"
done

%ldconfig_scriptlets -n libavcodec59
%ldconfig_scriptlets -n libavdevice59
%ldconfig_scriptlets -n libavfilter8
%ldconfig_scriptlets -n libavformat59
%ldconfig_scriptlets -n libavutil57
%ldconfig_scriptlets -n libpostproc56
%ldconfig_scriptlets -n libswresample4_ff5
%ldconfig_scriptlets -n libswscale6

%files
%doc Changelog CREDITS README.md
%_bindir/*
%_mandir/man1/ff*.1*
%_datadir/ffmpeg/

%files -n libavcodec59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavcodec.so.*

%files -n libavdevice59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavdevice.so.*

%files -n libavfilter8
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavfilter.so.*

%files -n libavformat59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavformat.so.*

%files -n libavutil57
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavutil.so.*

%files -n libpostproc56
%license COPYING.GPLv2 LICENSE.md
%_libdir/libpostproc.so.*

%files -n libswresample4_ff5
%license COPYING.GPLv2 LICENSE.md
%_libdir/libswresample.so.*

%files -n libswscale6
%license COPYING.GPLv2 LICENSE.md
%_libdir/libswscale.so.*

%files libavcodec-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavcodec/
%_libdir/libavcodec.so
%_libdir/pkgconfig/libavcodec.pc
%_mandir/man3/libavcodec.3*

%files libavdevice-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavdevice/
%_libdir/libavdevice.so
%_libdir/pkgconfig/libavdevice.pc
%_mandir/man3/libavdevice.3*

%files libavfilter-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavfilter/
%_libdir/libavfilter.so
%_libdir/pkgconfig/libavfilter.pc
%_mandir/man3/libavfilter.3*

%files libavformat-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavformat/
%_libdir/libavformat.so
%_libdir/pkgconfig/libavformat.pc
%_mandir/man3/libavformat.3*

%files libavutil-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavutil/
%_libdir/libavutil.so
%_libdir/pkgconfig/libavutil.pc
%_mandir/man3/libavutil.3*

%files libpostproc-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libpostproc/
%_libdir/libpostproc.so
%_libdir/pkgconfig/libpostproc.pc

%files libswresample-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libswresample/
%_libdir/libswresample.so
%_libdir/pkgconfig/libswresample.pc
%_mandir/man3/libswresample.3*

%files libswscale-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libswscale/
%_libdir/libswscale.so
%_libdir/pkgconfig/libswscale.pc
%_mandir/man3/libswscale.3*

%files private-devel
%_includedir/ffmpeg/private/

%else

%define _name ffmpeg

Name:           ffmpeg-5-mini
Version:        5.1.4
Release:        lp156.117.1
Summary:        Set of libraries for working with various multimedia formats
License:        GPL-3.0-or-later
URL:            https://ffmpeg.org/
#Git-Clone:     git://source.ffmpeg.org/ffmpeg
Source:         https://www.ffmpeg.org/releases/%_name-%version.tar.xz
Source2:        https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
Source3:        ffmpeg-5-rpmlintrc
Source98:       http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-5.keyring
Patch1:         ffmpeg-arm6l.diff
Patch2:         ffmpeg-new-coder-errors.diff
Patch3:         ffmpeg-codec-choice.diff
Patch4:         ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5:         work-around-abi-break.patch
Patch9:         ffmpeg-4.4-CVE-2020-22046.patch
Patch10:        0001-avfilter-af_dialoguenhance-fix-overreads.patch
Patch11:        0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch
Patch12:        0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
Patch13:        0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
Patch14:        0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
Patch15:        0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
Patch16:        0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
Patch17:        0001-avfilter-af_stereowiden-Check-length.patch
Patch18:        0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch
Patch19:        0001-avutil-hwcontext_vaapi-use-the-correct-type-for-VASu.patch
Patch90:        ffmpeg-chromium.patch
Patch91:        ffmpeg-dlopen-openh264.patch
Patch93:        soname.diff
Patch94:        ffmpeg-CVE-2023-50007.patch
Patch95:        ffmpeg-CVE-2023-50008.patch
Patch96:        ffmpeg-CVE-2023-49502.patch
Patch97:        ffmpeg-CVE-2023-51793.patch
Patch98:        ffmpeg-Templatify-ff_gaussian_blur-and-ff-function.patch
Patch99:        ffmpeg-CVE-2023-50009.patch
Patch100:       ffmpeg-CVE-2023-50010.patch
Patch102:       ffmpeg-5-CVE-2024-32230.patch
Patch103:       ffmpeg-5-CVE-2024-7272.patch
BuildRequires:  c_compiler
Requires:       this-is-only-for-build-envs

%description
FFmpeg is a multimedia framework.
This package merely builds the API for the sake of other packages.

%package libs
# Even with mini, we want ff5 libs to be coinstallable to ff4-devel(!),
# hence mini-libs and mini-devel are still separated.
Summary:        Feature-reduced build of FFmpeg, a multimedia framework
Conflicts:      libavcodec59
Conflicts:      libavdevice59
Conflicts:      libavfilter8
Conflicts:      libavformat59
Conflicts:      libavutil57
Conflicts:      libpostproc56
Conflicts:      libswresample4_ff5
Conflicts:      libswscale6
Requires:       this-is-only-for-build-envs

%description libs
FFmpeg is a multimedia framework.
This package contains a cut-down version for building other packages.

%package devel
Summary:        Header files for feature-reduced FFmpeg build
Provides:       libavcodec-devel = %version-%release
Conflicts:      libavcodec-devel
Provides:       libavdevice-devel = %version-%release
Conflicts:      libavdevice-devel
Provides:       libavfilter-devel = %version-%release
Conflicts:      libavfilter-devel
Provides:       libavformat-devel = %version-%release
Conflicts:      libavformat-devel
Provides:       libavutil-devel = %version-%release
Conflicts:      libavutil-devel
Provides:       libpostproc-devel = %version-%release
Conflicts:      libpostproc-devel
Provides:       libswresample-devel = %version-%release
Conflicts:      libswresample-devel
Provides:       libswscale-devel = %version-%release
Conflicts:      libswscale-devel
Requires:       %name-libs = %version-%release
Requires:       this-is-only-for-build-envs

%description devel
FFmpeg is a multimedia framework.
This package contains the headers accompanying %name.

%prep
%autosetup -p1 -n %_name-%version

%build
%define _lto_cflags %nil
CFLAGS="%optflags" \
./configure \
	--prefix="%_prefix" \
	--libdir="%_libdir" \
	--shlibdir="%_libdir" \
	--incdir="%_includedir/ffmpeg" \
	--extra-cflags="%optflags" \
	--optflags="%optflags" \
	--disable-htmlpages --disable-stripping --disable-x86asm \
	--disable-static --enable-shared --enable-pic \
	--enable-gpl --enable-version3 \
	--disable-muxers --disable-demuxers \
	--disable-encoders --disable-decoders \
	--disable-programs --disable-doc
for i in H264 HEVC VC1; do
	grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
done
cat config.h
%make_build

%install
b="%buildroot"
%make_install
rm -Rf "$b/%_datadir/ffmpeg/examples"

%ldconfig_scriptlets libs

%files libs
%_libdir/libavcodec.so.*
%_libdir/libavdevice.so.*
%_libdir/libavfilter.so.*
%_libdir/libavformat.so.*
%_libdir/libavutil.so.*
%_libdir/libpostproc.so.*
%_libdir/libswresample.so.*
%_libdir/libswscale.so.*

%files devel
%license COPYING.GPLv2 LICENSE.md
%_libdir/*.so
%_libdir/pkgconfig/*.pc
%_includedir/ffmpeg/

%endif

%changelog
* Tue Oct 15 2024 Antonio Larrosa <alarrosa@suse.com>
- Adjust bconds to build the package in SLFO without xvidcore.
* Fri Sep  6 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-5-CVE-2024-7055.patch:
  Backporting 3faadbe2 from upstream, Use 64bit for input size check,
  Fixes: out of array read, Fixes: poc3.
  (CVE-2024-7055, bsc#1229026)
* Sun Sep  1 2024 Jan Engelhardt <jengelh@inai.de>
- Add 0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch
  [boo#1229338]
- Add 0001-avutil-hwcontext_vaapi-use-the-correct-type-for-VASu.patch
  (resolve FTBFS on i586)
* Sun Aug 18 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-5-CVE-2024-7272.patch:
  Backporting 9903ba28 from upstream, error out on invalid layouts,
  * If it's unsupported or invalid, then there's no point trying to
  rebuild it using a value that may have been derived from the same
  layout to begin with.
  * Move the checks before the attempts at copying the layout while
  at it.
  (CVE-2024-7272, bsc#1229261)
* Thu Aug 15 2024 Manfred Hollstein <manfred.h@gmx.net>
- Remove ffmpeg-5-CVE-2024-32228.patch as it adds/modifies code
  which fails to build with BUILD_ORIG=1. (`HEVCSEI` has no
  member named `common`; implicit declaration of function
  `ff_h274_film_grain_params_supported`,
  `av_film_grain_params_select`; `HEVCContext` has no member
  named `film_grain_warning_shown`)
* Tue Jul  2 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-5-CVE-2024-32230.patch:
  Backporting 96449cfe from upstream, Fix 1 line and one column images.
  (CVE-2024-32230, bsc#1227296)
* Tue Jul  2 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-5-CVE-2024-32228.patch:
  Backporting 45964876 from upstream, Fix segfault on invalid film
  grain metadata.
  (CVE-2024-32228, bsc#1227277)
* Sat Apr 27 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50010.patch:
  Backporting e4d2666b from upstream, fixes the out of array access.
  (CVE-2023-50010, bsc#1223256)
* Fri Apr 26 2024 Jan Engelhardt <jengelh@inai.de>
- Add 0001-avfilter-af_stereowiden-Check-length.patch
  [boo#1223437, CVE-2023-51794]
* Fri Apr 26 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50009.patch:
  Backporting c443658d from upstream, Fix small inputs with
  gaussian_blur().
  (CVE-2023-50009, bsc#1223255)
* Wed Apr 24 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-Templatify-ff_gaussian_blur-and-ff-function.patch:
  Backporting cf1f5744 from upstream, Templatify function
  ff_gaussian_blur and ff_sobel to prepare fix support for CVE-2023-50009.
  (CVE-2023-50009, bsc#1223255)
* Tue Apr 23 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-51793.patch:
  Backporting 0ecc1f0e from upstream, Fix odd height handling.
  (CVE-2023-51793, bsc#1223272)
* Tue Apr 23 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-49502.patch:
  Backporting 737ede40 from upstream, account for chroma sub-sampling
  in min size calculation.
  (CVE-2023-49502, bsc#1223235)
* Tue Apr 23 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50008.patch:
  Backporting 5f87a68c from upstream, Fix memory leaks.
  (CVE-2023-50008, bsc#1223254)
* Tue Apr 23 2024 Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50007.patch:
  Backporting b1942734 from upstream, Fix crash with EOF handling.
  (CVE-2023-50007, bsc#1223253)
* Mon Apr 22 2024 Jan Engelhardt <jengelh@inai.de>
- Address boo#1223274/CVE-2023-51796: add patch
  0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
* Mon Apr 22 2024 Jan Engelhardt <jengelh@inai.de>
- Address boo#1222730/CVE-2023-49528: add patches
  0001-avfilter-af_dialoguenhance-fix-overreads.patch,
  0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch,
  0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
- Address boo#1223070/CVE-2024-31578: add patch
  0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
- Address boo#1223085/CVE-2024-31582: add patch
  0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
- Address boo#1223087/CVE-2024-31585, boo#1223273/CVE-2023-51795:
  add patch
  0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
* Fri Feb  2 2024 Stefan Dirsch <sndirsch@suse.com>
- drop support for libmfx, which is no longer supported upstream
  at all (boo#1219494)
* Fri Jan 19 2024 Jan Engelhardt <jengelh@inai.de>
- Disable libjxl integration as ffmpeg-5 cannot handle libjxl>=0.9.
* Wed Dec  6 2023 Jan Engelhardt <jengelh@inai.de>
- Copy codec list from ffmpeg-6
* Fri Nov 10 2023 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 5.1.4:
  * Updates and bugfixes to avcodecs, avformat and avfilters
    mainly.
- Drop patches fixed upstream:
  * 0001-avcodec-libsvtav1-replace-vbv_bufsize-with-maximum_b.patch
  * 0002-avcodec-libsvtav1-remove-compressed_ten_bit_format-a.patch
  * 0003-avcodec-libsvtav1-only-set-max_buf_sz-if-both-bitrat.patch
  * 0004-avcodec-libsvtav1-use-larger-of-bit-rate-and-max-rat.patch
  * 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch
* Wed Oct  4 2023 Manfred Hollstein <manfred.h@gmx.net>
- Add 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch
  to resolve a build failure on 15.4/15.5.
* Thu Jun 29 2023 Jan Engelhardt <jengelh@inai.de>
- Add 0001-avcodec-libsvtav1-replace-vbv_bufsize-with-maximum_b.patch,
  0002-avcodec-libsvtav1-remove-compressed_ten_bit_format-a.patch,
  0003-avcodec-libsvtav1-only-set-max_buf_sz-if-both-bitrat.patch,
  0004-avcodec-libsvtav1-use-larger-of-bit-rate-and-max-rat.patch
* Wed Apr 19 2023 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 5.1.3:
  * avcodec/012v: Order operations for odd size handling
  * avcodec/alsdec:
  - Check bits left before block decoding in non multi channel
    coding loop
  - The minimal block is at least 7 bits
  * avcodec/atrac3plus: reorder channels to match the output layout
  * avcodec/audiotoolboxenc: return AVERROR_EXTERNAL immediately
    when encode error
  * avcodec/bink:
  - Avoid undefined out of array end pointers in
    binkb_decode_plane()
  - Fix off by 1 error in ref end
  * avcodec/eac3dec: avoid float noise in fixed mode addition to
    overflow
  * avcodec/eatgq: : Check index increments in tgq_decode_block()
  * avcodec/escape124:
  - Fix signdness of end of input check
  - Fix some return codes
  * avcodec/ffv1dec:
  - Check that num h/v slices is supported
  - Fail earlier if prior context is corrupted
  * avcodec/ffv1dec: restructure slice coordinate reading a bit
  * avcodec/h274: fix include
  * avcodec/libjxldec:
  - Fix gamma22 and gamma28 recognition
  - Avoid hard failure with unspecified primaries
  * avcodec/mjpegenc: take into account component count when
    writing the SOF header size
  * avcodec/mlpdec: Check max matrix instead of max channel in
    noise check
  * avcodec/motionpixels: Mask pixels to valid values
  * avcodec/mpeg12dec:
  - Check input size
  - Use init_get_bits8 and check the return value
  * avcodec/nvenc: fix vbv buffer size in cq mode
  * avcodec/pictordec: Remove mid exit branch
  * avcodec/pngdec:
  - Check deloco index more exactly
  - Dont skip/read chunk twice
  * avcodec/rpzaenc: stop accessing out of bounds frame
  * avcodec/scpr3: Check bx
  * avcodec/scpr: Test bx before use
  * avcodec/smcenc: stop accessing out of bounds frame
  * avcodec/snowenc: Fix visual weight calculation
  * avcodec/speedhq: Check buf_size to be big enough for DC
  * avcodec/speexdec: Check channels > 2
  * avcodec/sunrast: Fix maplength check
  * avcodec/tests/snowenc:
  - Fix 2nd test
  - Return a failure if DWT/IDWT mismatches
  - Unbreak DWT tests
  * avcodec/tiff: Ignore tile_count
  * avcodec/utils:
  - Allocate a line more for VC1 and WMV3
  - Ensure linesize for SVQ3
  - Use 32pixel alignment for bink
  * avcodec/videodsp_template: Adjust pointers to avoid undefined
    pointer things
  * avcodec/wavpack:
  - Avoid undefined shift in get_tail()
  - Check for end of input in wv_unpack_dsd_high()
  * avcodec/xpmdec: Check size before allocation to avoid
    truncation
  * avcodec/aacdec: fix parsing streams with channel configuration
    11
  * avformat/id3v2: Check taglen in read_uslt()
  * avformat/mov: Check samplesize and offset to avoid integer
    overflow
  * avformat/mxfdec: Use 64bit in remainder
  * avformat/replaygain: avoid undefined / negative abs
  * avformat/vividas: Check packet size
  * avutil/tx: Use unsigned in ff_tx_fft_sr_combine() to avoid
    undefined behavior
  * hwcontext_vulkan: remove optional encode/decode extensions from
    the list
  * lavf/async: Fix ring_write return value
  * lavu/vulkan: fix handle type for 32-bit targets
  * libswscale: force a minimum size of the slide for bayer sources
  * swscale/input: Use more unsigned intermediates
  * swscale/output:
  - Bias 16bps output calculations to improve non overflowing
    range
  - Bias 16bps output calculations to improve non overflowing
    range for GBRP16/GBRPF32
  * swscale: aarch64: Fix yuv2rgb with negative strides
  * Use https for repository links
  * vulkan: Fix win/i386 calling convention
- Rebase patches with quilt.
- Drop ffmpeg-CVE-2022-3964.patch: Fixed upstream.
- Drop no-vk-video-decoding.patch: Upstream removed this optional
  code.
- Use ldconfig_scriptlets macro.
* Thu Mar 16 2023 Callum Farmer <gmbr3@opensuse.org>
- Obsolete old FFmpeg 5 libswresample4, otherwise they'll conflict
* Thu Mar 16 2023 Jan Engelhardt <jengelh@inai.de>
- Conflict with otherproviders(ffmpeg-tools).
* Mon Mar 13 2023 Jan Engelhardt <jengelh@inai.de>
- Add soname.diff to get libswresample4 nonconflicting with ffmpeg-6.
* Thu Mar  9 2023 Jan Engelhardt <jengelh@inai.de>
- Actually enable libjxl backend
* Mon Feb 27 2023 Jan Engelhardt <jengelh@inai.de>
- Add ``Requires: this-is-only-for-build-envs`` [boo#1208652]
* Tue Jan 31 2023 Jan Engelhardt <jengelh@inai.de>
- Add no-vk-video-decoding.patch to resolve build failure
  with Vulkan 1.3.239
* Tue Jan 17 2023 Manfred Hollstein <manfred.h@gmx.net>
- Merge ffmpeg-5-mini.spec with the main .spec file in order to
  make building the _multibuild packages easier for the case the
  package is named to be built for a specific distribution; an
  example would be "A_tw-ffmpeg-5" in Packman.
* Thu Jan  5 2023 Jan Engelhardt <jengelh@inai.de>
- Provide a ffmpeg-5-mini-devel build recipe to help split
  anticipated build cycles.
- Reenable SDL2 for ffmpeg-5.spec. ffplay and -vf sdl should be
  back. [boo#1206505]
* Mon Dec 12 2022 Dirk Müller <dmueller@suse.com>
- build for x86_64 subarchs the same way like for baseline
* Thu Dec  8 2022 Callum Farmer <gmbr3@opensuse.org>
- Enable librist support on TW: enables usage of RIST encoded MPEG-TS
  streams and is used by OBS Studio
* Tue Dec  6 2022 Jan Engelhardt <jengelh@inai.de>
- Drop BuildRequire on SDL2 to break a dependency loop; with this,
  /usr/bin/ffplay is no longer built.
* Wed Nov 16 2022 Alynx Zhou <alynx.zhou@suse.com>
- Add ffmpeg-CVE-2022-3964.patch: Backport from upstream to fix
  out of bounds read in update_block_in_prev_frame() (bsc#1205388).
* Sat Oct 15 2022 Neal Gompa <ngompa@opensuse.org>
- Refresh Fedora OpenH264 dlopen patch and sources for OpenH264 2.3.1
  * Patch: ffmpeg-dlopen-openh264.patch
  * Source: ffmpeg-dlopen-headers.tar.xz
  * Source: ffmpeg_get_dlopen_headers.sh
* Wed Oct  5 2022 Luigi Baldoni <aloisio@gmx.com>
- Enable AMF conditionally
* Mon Sep 26 2022 C J <c.j@tuta.io>
- Update to release 5.1.2
  * Add more field checks, add checks against overflows,
    or outright use larger integer types.
  * avformat/dashdec: Fix crash on invalid input/ENOMEM, fix leak
  * lavc/videotoolbox: do not pass AVCodecContext to decoder
    output callback
  * lavc/pthread_frame: always transfer stashed hwaccel state
  * avcodec/arm/sbcenc: avoid callee preserved vfp registers
  * avformat/riffdec: don't unconditionally overwrite
    WAVEFORMATEXTENSIBLE layout
  * avfilter/vf_scale: overwrite the width and height expressions
    with the original values
  * lavc/pthread_frame: avoid leaving stale hwaccel state in
    worker threads
* Sun Sep  4 2022 Jan Engelhardt <jengelh@inai.de>
- Update to release 5.1.1
  * avformat/asfdec_o: limit recursion depth in asf_read_unknown()
  * libavformat/iff: Check for overflow in body_end calculation
  * avformat/avidec: Prevent entity expansion attacks
  * avcodec/h263dec: Sanity check against minimal I/P frame size
  * avcodec/libvpx: fix assembling vp9 packets with alpha channel
  * avcodec/libspeexdec: Fix use of uninitialized value
  * avcodec/alac: don't fail if channels aren't set during init()
    when extradata is valid
  * avformat/mov: Check count sums in build_open_gop_key_points()
    [CVE-2022-2566] [boo#1203441]
* Tue Jul 26 2022 Jan Engelhardt <jengelh@inai.de>
- Enable libjxl
* Sat Jul 23 2022 Callum Farmer <gmbr3@opensuse.org>
- Update ffmpeg-chromium.patch from upstream
* Sat Jul 23 2022 Jan Engelhardt <jengelh@inai.de>
- Update to release 5.1
  * AVIF image muxer support for the AV1-based image format
  * JPEG-XL image support
  * Removed the X-Video Motion Compensation (XvMC) hardware
    acceleration
  * IPFS/IPNS protocol support
  * PCM-Bluray encoder support
- Drop vmaf-trim-usr-local.patch (obsolete),
  ffmpeg-openh264-averr-on-bad-version.patch (merged)
- Add work-around-abi-break.patch
* Sat Apr  9 2022 Dirk Müller <dmueller@suse.com>
- update to 5.0.1:
  * avcodec/exr: Avoid signed overflow in displayWindow
  * avcodec/diracdec: avoid signed integer overflow in global mv
  * avcodec/takdsp: Fix integer overflow in decorrelate_sf()
  * avcodec/apedec: fix a integer overflow in long_filter_high_3800()
  * avdevice/dshow: fix regression
  * avfilter/vf_subtitles: pass storage size to libass
  * avcodec/vp9_superframe_split_bsf: Don't read inexistent data
  * avcodec/vp9_superframe_split_bsf: Discard invalid zero-sized frames
  * avcodec/vp9_superframe_bsf: Check for existence of data before reading it
  * avcodec/vp9_raw_reorder_bsf: Check for existence of data before reading it
  * avformat/imf: fix packet pts, dts and muxing
  * avformat/imf: open resources only when first needed
  * avformat/imf: cosmetics
  * avformat/imf_cpl: do not use filesize when reading XML file
  * avformat/imfdec: Use proper logcontext
  * avformat/imfdec: do not use filesize when reading XML file
  * doc/utils: add missing 22.2 layout entry
  * avcodec/av1: only set the private context pix_fmt field if get_pixel_format() succeeds
  * avformat/aqtitledec: Skip unrepresentable durations
  * avformat/cafdec: Do not store empty keys in read_info_chunk()
  * avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before writing
  * avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array()
  * avformat/mxfdec: Check count in mxf_read_strong_ref_array()
  * avformat/hls: Check target_duration
  * avcodec/pixlet: Avoid signed integer overflow in scaling in filterfn()
  * avformat/matroskadec: Check pre_ns
  * avcodec/sonic: Use unsigned for predictor_k to avoid undefined behavior
  * avcodec/libuavs3d: Check ff_set_dimensions() for failure
  * avcodec/speexdec: Align some comments
  * avcodec/speexdec: Use correct doxygen comments
  * avcodec/mjpegbdec: Set buf_size
  * avformat/matroskadec: Use rounded down duration in get_cue_desc() check
  * avcodec/argo: Check packet size
  * avcodec/g729_parser: Check channels
  * avformat/avidec: Check height
  * avformat/rmdec: Better duplicate tags check
  * avformat/mov: Disallow empty sidx
  * avformat/argo_cvg:: Fix order of operations in error check in argo_cvg_write_trailer()
  * avformat/argo_asf: Fix order of operations in error check in argo_asf_write_trailer()
  * avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior
  * avformat/matroskadec: Check duration
  * avformat/mov: Corner case encryption error cleanup in mov_read_senc()
  * avcodec/jpeglsdec: Fix if( code style
  * avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error
  * avcodec/motion_est: fix indention of ff_get_best_fcode()
  * avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
  * avformat/hls: Use unsigned for iv computation
  * avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using unsigned
  * avformat/matroskadec: Check desc_bytes
  * avformat/utils: Fix invalid NULL pointer operation in ff_parse_key_value()
  * avformat/matroskadec: Fix infinite loop with bz decompression
  * avformat/utils: keep chapter monotonicity on chapter updates
  * avformat/mov: Check size before subtraction
  * avcodec/cfhd: Avoid signed integer overflow in coeff
  * avcodec/libdav1d: free the Dav1dData packet on dav1d_send_data() failure
  * avcodec/h264_parser: don't alter decoder private data
  * configure: link to libatomic when it's present
  * fate/ffmpeg: add missing samples dependency to fate-shortest
* Thu Mar 10 2022 Bjørn Lie <bjorn.lie@gmail.com>
- Drop pkgconfig(celt) BuildRequires and stop passing
  - -enable-libcelt to configure and drop celt from enable_decoders,
  abandoned upstream for opus.
- Drop pkgconfig(libv4l2) BuildRequires and stop passing
  - -enable-libv4l2 to configure, only needed very old devices and
  may cause problems for others for those needing it, use
  LD_PRELOAD pointing on libv4l2.
- Drop pkgconfig(librtmp) BuildRequires and stop passing
  conditional --enable-librtmp to configure, built-in RTMP support
  is better, and has listen mode.
- Drop bcond conditionals for libaom, srt, lv2, soxr,
  zmq, zimg and openmpt, build unconditionally for all supported
  versions of openSUSE.
- Drop pkgconfig(enca) BuildRequires: Seems unused.
* Sat Feb 19 2022 Enrico Belleri <idesmi@protonmail.com>
- Use Shaderc instead of separate glslang/SPIRV-Tools for Vulkan support
* Fri Feb 18 2022 Neal Gompa <ngompa@opensuse.org>
- Add patch to fix error returned with bad versions of OpenH264
  * Patch: ffmpeg-openh264-averr-on-bad-version.patch
- Enable OpenH264 as an H.264 codec via dlopen using patch from Fedora
  * Patch: ffmpeg-dlopen-openh264.patch
- Add source and script for headers for dlopening OpenH264
  * Source: ffmpeg-dlopen-headers.tar.xz
  * Source: ffmpeg_get_dlopen_headers.sh
* Wed Feb 16 2022 Dominique Leuenberger <dimstar@opensuse.org>
- Disamble libsmbclient usage (can always be built with
  - -with-smbclient): the usecase of ffmpeg directly accessing
  smb:// shares is quite constructed (most users will have their
  smb shares mounted).
* Sun Jan 30 2022 Jan Engelhardt <jengelh@inai.de>
- Enable building with glslang. (Should enable video blending
  with GLSL.)
- Unconditionalize ffnvcodec (like vmaf already is).
* Sun Jan 16 2022 Callum Farmer <gmbr3@opensuse.org>
- Add ffmpeg-chromium.patch: allows Chromium to use the now
  internalised field first_dts
* Fri Jan 14 2022 Jan Engelhardt <jengelh@inai.de>
- Based on ffmpeg-4.0.spec, update to 5.0
  * New Vulkan-powered filters for video horizontal/vertical
    flipping.
  * Speex decoder.
  * Various new muxers/demuxers.
  * An AV1 low-overhead bitstream format muxer is added.
  * Swscale slice threading support.
  * New audio and video filters.
- Drop soversion.diff (for now; it may very well be reintroduced,
  depending on how 5.1 is released).
openSUSE Build Service is sponsored by