# For a complete build enable these two %bcond_with upstream_tarball %bcond_with all_codecs # If you want to do a build with the upstream source tarball, then set the # pkg_suffix to %%nil. We can't handle this with a conditional, as srpm # generation would not take it into account. %global pkg_suffix -free # Fails due to asm issue %ifarch %{ix86} %{arm} %bcond_with lto %else %bcond_without lto %endif %ifarch %{ix86} %bcond_with vulkan %else %bcond_without vulkan %endif %ifarch x86_64 %bcond_without svtav1 %bcond_without mfx %bcond_without vmaf %else %bcond_with svtav1 %bcond_with mfx %bcond_with vmaf %endif %ifarch s390 s390x %bcond_with dc1394 %else %bcond_without dc1394 %endif %if %{with all_codecs} %bcond_without rtmp %bcond_without x264 %bcond_without x265 %bcond_without xvid %else %bcond_with rtmp %bcond_with x264 %bcond_with x265 %bcond_with xvid %endif %if %{without lto} %global _lto_cflags %{nil} %endif %global av_codec_soversion 59 %global av_device_soversion 59 %global av_filter_soversion 8 %global av_format_soversion 59 %global av_util_soversion 57 %global postproc_soversion 56 %global swresample_soversion 4 %global swscale_soversion 6 Name: ffmpeg %global pkg_name %{name}%{?pkg_suffix} Version: 5.0 Release: 2%{?dist} Summary: A complete solution to record, convert and stream audio and video License: GPLv3+ URL: https://ffmpeg.org/ Source0: ffmpeg%{?pkg_suffix}-%{version}.tar.xz Source1: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc # https://ffmpeg.org/ffmpeg-devel.asc # gpg2 --import --import-options import-export,import-minimal ffmpeg-devel.asc > ./ffmpeg.keyring Source2: ffmpeg.keyring Source3: ffmpeg_free_sources Source20: enable_decoders Source21: enable_encoders # Change path from /usr/local to /usr Patch1: fix-vmaf-model-path.patch # Some header cleanup # http://ffmpeg.org/pipermail/ffmpeg-devel/2022-February/292877.html Patch2: ffmpeg-fix-exif-include.patch # Fixes for reduced codec selection on free build Patch3: ffmpeg-codec-choice.patch # Better error messages for free build Patch4: ffmpeg-new-coder-errors.patch # Allow to build with fdk-aac-free # See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 Patch5: ffmpeg-allow-fdk-aac-free.patch # http://ffmpeg.org/pipermail/ffmpeg-devel/2022-February/292853.html Patch6: ffmpeg-fix-gnutls-priority.patch # https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html Patch7: ffmpeg-support-chromium.patch Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} BuildRequires: AMF-devel BuildRequires: fdk-aac-free-devel BuildRequires: flite-devel BuildRequires: game-music-emu-devel BuildRequires: gcc BuildRequires: gnupg2 BuildRequires: gsm-devel BuildRequires: ladspa-devel BuildRequires: lame-devel %ifnarch s390 s390x BuildRequires: libcrystalhd-devel %endif BuildRequires: libmysofa-devel BuildRequires: make BuildRequires: nasm BuildRequires: perl(Pod::Man) BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(aom) BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(caca) BuildRequires: pkgconfig(codec2) BuildRequires: pkgconfig(dav1d) BuildRequires: pkgconfig(enca) BuildRequires: pkgconfig(ffnvcodec) BuildRequires: pkgconfig(flac) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(frei0r) BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(ilbc) BuildRequires: pkgconfig(jack) BuildRequires: pkgconfig(libass) BuildRequires: pkgconfig(libbluray) BuildRequires: pkgconfig(libbs2b) BuildRequires: pkgconfig(libcdio) BuildRequires: pkgconfig(libcdio_paranoia) BuildRequires: pkgconfig(libchromaprint) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libmodplug) BuildRequires: pkgconfig(libomxil-bellagio) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libopenmpt) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(librsvg-2.0) BuildRequires: pkgconfig(libssh) BuildRequires: pkgconfig(libv4l2) BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(libva-drm) BuildRequires: pkgconfig(libva-x11) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libzmq) BuildRequires: pkgconfig(lilv-0) BuildRequires: pkgconfig(netcdf) BuildRequires: pkgconfig(ogg) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(opencv4) BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(rav1e) BuildRequires: pkgconfig(rubberband) BuildRequires: pkgconfig(schroedinger-1.0) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(smbclient) BuildRequires: pkgconfig(snappy) BuildRequires: pkgconfig(soxr) BuildRequires: pkgconfig(speex) BuildRequires: pkgconfig(srt) BuildRequires: pkgconfig(tesseract) BuildRequires: pkgconfig(theora) BuildRequires: pkgconfig(twolame) BuildRequires: pkgconfig(vapoursynth) BuildRequires: pkgconfig(vdpau) BuildRequires: pkgconfig(vidstab) BuildRequires: pkgconfig(vorbis) BuildRequires: pkgconfig(vpx) BuildRequires: pkgconfig(wavpack) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-render) BuildRequires: pkgconfig(xcb-shape) BuildRequires: pkgconfig(xcb-shm) BuildRequires: pkgconfig(xcb-xfixes) BuildRequires: pkgconfig(zimg) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zvbi-0.2) BuildRequires: texinfo %if %{with amr} BuildRequires: pkgconfig(opencore-amrnb) BuildRequires: pkgconfig(vo-amrwbenc) %endif %if %{with dc1394} BuildRequires: pkgconfig(libavc1394) BuildRequires: pkgconfig(libdc1394-2) BuildRequires: pkgconfig(libiec61883) %endif %if %{with rtmp} BuildRequires: librtmp-devel %endif %if %{with mfx} BuildRequires: pkgconfig(libmfx) < 2.0 %endif %if %{with svtav1} BuildRequires: pkgconfig(SvtAv1Enc) >= 0.8.4 %endif %if %{with vulkan} BuildRequires: vulkan-loader-devel BuildRequires: glslang-devel %endif %if %{with x264} BuildRequires: pkgconfig(x264) %endif %if %{with x265} BuildRequires: pkgconfig(x265) %endif %if %{with vmaf} BuildRequires: pkgconfig(libvmaf) %endif %if %{with xvid} BuildRequires: xvidcore-devel %endif %description FFmpeg is a leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. %if %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %if "x%{?pkg_suffix}" != "x" %package -n %{pkg_name} Summary: A complete solution to record, convert and stream audio and video Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n %{pkg_name} FFmpeg is a leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. %if %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif #/ "x%%{?pkg_suffix}" != "x" %endif %package -n %{pkg_name}-devel Summary: Development package for %{name} Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: pkgconfig %description -n %{pkg_name}-devel FFmpeg is a leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. This package contains also 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. %package -n libavcodec%{?pkg_suffix} Summary: FFmpeg codec library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libavcodec%{?pkg_suffix} 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 %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %package -n libavcodec%{?pkg_suffix}-devel Summary: Development files for FFmpeg's codec library Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig %description -n libavcodec%{?pkg_suffix}-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 libavdevice%{?pkg_suffix} Summary: FFmpeg device library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libavdevice%{?pkg_suffix} 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 -n libavdevice%{?pkg_suffix}-devel Summary: Development files for FFmpeg's device library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig %description -n libavdevice%{?pkg_suffix}-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 libavdevice. %package -n libavfilter%{?pkg_suffix} Summary: FFmpeg audio and video filtering library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libavfilter%{?pkg_suffix} The libavfilter library provides a generic audio/video filtering framework containing several filters, sources and sinks. %package -n libavfilter%{?pkg_suffix}-devel Summary: Development files for FFmpeg's audio/video filter library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix} = %{version}-%{release} Requires: pkgconfig %description -n libavfilter%{?pkg_suffix}-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 libavformat%{?pkg_suffix} Summary: FFmpeg's stream format library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libavformat%{?pkg_suffix} 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 %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %package -n libavformat%{?pkg_suffix}-devel Summary: Development files for FFmpeg's stream format library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig %description -n libavformat%{?pkg_suffix}-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 libavutil%{?pkg_suffix} Summary: FFmpeg's utility library Group: System/Libraries %description -n libavutil%{?pkg_suffix} 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 -n libavutil%{?pkg_suffix}-devel Summary: Development files for FFmpeg's utility library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig %description -n libavutil%{?pkg_suffix}-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 libpostproc%{?pkg_suffix} Summary: FFmpeg post-processing library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libpostproc%{?pkg_suffix} A library with video postprocessing filters, such as deblocking and deringing filters, noise reduction, automatic contrast and brightness correction, linear/cubic interpolating deinterlacing. %package -n libpostproc%{?pkg_suffix}-devel Summary: Development files for the FFmpeg post-processing library Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig %description -n libpostproc%{?pkg_suffix}-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 libswresample%{?pkg_suffix} Summary: FFmpeg software resampling library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libswresample%{?pkg_suffix} The libswresample library performs audio conversion between different sample rates, channel layout and channel formats. %package -n libswresample%{?pkg_suffix}-devel Summary: Development files for the FFmpeg software resampling library Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libswresample%{?pkg_suffix}-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 libswscale%{?pkg_suffix} Summary: FFmpeg image scaling and colorspace/pixel conversion library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libswscale%{?pkg_suffix} The libswscale library performs image scaling and colorspace and pixel format conversion operations. %package -n libswscale%{?pkg_suffix}-devel Summary: Development files for FFmpeg's image scaling and colorspace library Provides: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Conflicts: libswscale%{?pkg_suffix}-devel < %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} %description -n libswscale%{?pkg_suffix}-devel The libswscale library performs image scaling and colorspace and pixel format conversion operations. This subpackage contains the headers for FFmpeg libswscale. %prep %if %{with upstream_tarball} gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0} %endif %autosetup -p1 install -m 0644 %{SOURCE20} enable_decoders install -m 0644 %{SOURCE21} enable_encoders # fix -O3 -g in host_cflags sed -i "s|check_host_cflags -O3|check_host_cflags %{optflags}|" configure install -m0755 -d _doc/examples cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ %build %set_build_flags # This is not a normal configure script, don't use %%configure ./configure \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --datadir=%{_datadir}/%{name} \ --docdir=%{_docdir}/%{name} \ --incdir=%{_includedir}/%{name} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --arch=%{_target_cpu} \ --optflags="%{optflags}" \ --extra-cflags="%{build_cflags}" \ --disable-htmlpages \ --enable-pic \ --disable-stripping \ --enable-shared \ --disable-static \ --enable-gpl \ --enable-version3 \ --enable-libsmbclient \ --disable-openssl \ --enable-gnutls \ --enable-ladspa \ %if %{with vulkan} --enable-vulkan \ %endif --disable-cuda-sdk \ --enable-libaom \ --enable-libass \ --enable-libbluray \ --enable-libbs2b \ --enable-libcdio \ --enable-libdav1d \ %if %{with dc1394} --enable-libdc1394 \ %endif --enable-libdrm \ --enable-libfdk-aac \ --enable-libfontconfig \ --enable-libfreetype \ --enable-libfribidi \ --enable-libgsm \ --enable-libjack \ --enable-libmp3lame \ --enable-libmysofa \ --enable-libopenjpeg \ --enable-libopenmpt \ --enable-libopus \ --enable-libpulse \ --enable-librav1e \ --enable-librubberband \ %if %{with svtav1} --enable-libsvtav1 \ %endif --enable-libsoxr \ --enable-libspeex \ --enable-libssh \ --enable-libsrt \ --enable-libtheora \ --enable-libtwolame \ --enable-libvidstab \ %if %{with vmaf} --enable-libvmaf \ %endif --enable-libvorbis \ --enable-libv4l2 \ --enable-libvpx \ --enable-libwebp \ --enable-libxml2 \ --enable-libzimg \ --enable-libzvbi \ %if %{with lto} --enable-lto \ %endif %if %{with mfx} --enable-libmfx \ %endif --enable-vaapi \ --enable-vdpau \ %if %{with amr} --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-libvo-amrwbenc \ %endif %if %{with x264} --enable-libx264 \ %endif %if %{with x265} --enable-libx265 \ %endif %if %{with librtmp} --enable-librtmp \ %endif %if %{with xvid} --enable-libxvid \ %endif %if %{without all_codecs} --enable-muxers \ --enable-demuxers \ --disable-encoders \ --disable-decoders \ --disable-decoder="mpeg4,h263,h264,hevc,vc1" \ --enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' - 5.0-2 - Enable support for more hardware codecs * Fri Feb 11 2022 Andreas Schneider - 5.0-1 - Initial import (fedora#2051008)