# 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} %bcond_with lto %else %bcond_without lto %endif %ifarch x86_64 %bcond_without vmaf %else %bcond_with vmaf %endif %ifarch s390 s390x %bcond_with dc1394 %else %bcond_without dc1394 %endif %if 0%{?rhel} # Disable dependencies not offered in RHEL/EPEL %bcond_with crystalhd %bcond_with omxil %else # Disable some features because RHEL 9 packages are too old %if 0%{?rhel} && 0%{?rhel} <= 9 %bcond_with flite %else %bcond_without flite %endif # crystalhd isn't available on IBM Z %ifarch s390 s390x %bcond_with crystalhd %else %bcond_without crystalhd %endif %bcond_without omxil %endif %if %{with all_codecs} %bcond_without rtmp %bcond_without x264 %bcond_without x265 %else %bcond_with rtmp %bcond_with x264 %bcond_with x265 %endif %if %{without lto} %global _lto_cflags %{nil} %endif %if "%{__isa_bits}" == "64" %global lib64_suffix ()(64bit) %endif %global openh264_soversion 7 %global av_codec_soversion 58 %global av_device_soversion 58 %global av_filter_soversion 7 %global av_format_soversion 58 %global av_util_soversion 56 %global postproc_soversion 55 %global swresample_soversion 3 %global swscale_soversion 5 Name: ffmpeg4 %global pkg_name %{name}%{?pkg_suffix} Version: 4.4.4 Release: 3%{?dist} Summary: A complete solution to record, convert and stream audio and video License: GPL-3.0-or-later AND GPL-2.0-or-later AND LGPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND Zlib URL: https://ffmpeg.org/ Source0: ffmpeg%{?pkg_suffix}-%{version}.tar.xz Source1: ffmpeg-dlopen-headers.tar.xz Source2: 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 Source3: ffmpeg.keyring Source4: ffmpeg_free_sources Source20: enable_decoders Source21: enable_encoders # Scripts for generating tarballs Source90: ffmpeg_update_free_sources.sh Source91: ffmpeg_gen_free_tarball.sh Source92: ffmpeg_get_dlopen_headers.sh Source93: ffmpeg_find_free_source_headers.sh # Fixes for reduced codec selection on free build Patch1: ffmpeg-codec-choice.patch # Allow to build with fdk-aac-free # See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 Patch3: ffmpeg-allow-fdk-aac-free.patch # Fix assembly with binutils 2.41 https://fftrac-bg.ffmpeg.org/ticket/10405 Patch6: 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch # Set up dlopen for openh264 Patch1001: ffmpeg-dlopen-openh264.patch BuildRequires: AMF-devel BuildRequires: fdk-aac-free-devel %if %{with flite} BuildRequires: flite-devel >= 2.2 %endif BuildRequires: game-music-emu-devel BuildRequires: gcc BuildRequires: gnupg2 BuildRequires: gsm-devel BuildRequires: ladspa-devel BuildRequires: lame-devel %if %{with crystalhd} BuildRequires: libcrystalhd-devel %endif BuildRequires: libgcrypt-devel BuildRequires: libmysofa-devel BuildRequires: libX11-devel BuildRequires: libXext-devel BuildRequires: libXv-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(ffnvcodec) BuildRequires: pkgconfig(flac) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(frei0r) BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(libilbc) BuildRequires: pkgconfig(jack) BuildRequires: pkgconfig(libass) BuildRequires: pkgconfig(libbluray) BuildRequires: pkgconfig(libbs2b) BuildRequires: pkgconfig(libcdio) BuildRequires: pkgconfig(libcdio_paranoia) #BuildRequires: pkgconfig(libchromaprint) # uses latest ffmpeg BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libmodplug) %if %{with omxil} BuildRequires: pkgconfig(libomxil-bellagio) %endif BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libopenmpt) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(librabbitmq) BuildRequires: pkgconfig(librist) 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(lv2) BuildRequires: pkgconfig(netcdf) BuildRequires: pkgconfig(ogg) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(opencore-amrnb) BuildRequires: pkgconfig(OpenCL) 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(SvtAv1Enc) BuildRequires: pkgconfig(tesseract) BuildRequires: pkgconfig(theora) BuildRequires: pkgconfig(twolame) BuildRequires: pkgconfig(vapoursynth) BuildRequires: pkgconfig(vdpau) BuildRequires: pkgconfig(vidstab) BuildRequires: pkgconfig(vorbis) BuildRequires: pkgconfig(vo-amrwbenc) BuildRequires: pkgconfig(vpx) BuildRequires: pkgconfig(vulkan) 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 BuildRequires: xvidcore-devel %if %{with dc1394} BuildRequires: pkgconfig(libavc1394) BuildRequires: pkgconfig(libdc1394-2) BuildRequires: pkgconfig(libiec61883) %endif %if %{with rtmp} BuildRequires: librtmp-devel %endif %if %{with x264} BuildRequires: pkgconfig(x264) %endif %if %{with x265} BuildRequires: pkgconfig(x265) %endif %if %{with vmaf} BuildRequires: pkgconfig(libvmaf) %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. This version is intended only for dependent packages which have yet to be ported to the latest API provided by the ffmpeg package. %if %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %package -n %{pkg_name}-libs Summary: FFmpeg 4 runtime libraries # We dlopen() openh264, so weak-depend on it... ## Note, we can do this because openh264 is provided in a default-enabled ## third party repository provided by Cisco. Recommends: libopenh264.so.%{openh264_soversion}%{?lib64_suffix} Obsoletes: compat-ffmpeg4 <= %{version}-%{release} Provides: compat-ffmpeg4 = %{version}-%{release} %description -n %{pkg_name}-libs 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 version is intended only for dependent packages which have yet to be ported to the latest API provided by the ffmpeg package. %if %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %package -n %{pkg_name}-devel Summary: Development package for %{name} Requires: %{pkg_name}-libs%{?_isa} = %{version}-%{release} Requires: pkgconfig Conflicts: libavcodec-free-devel >= 5 Conflicts: libavdevice-free-devel >= 5 Conflicts: libavfilter-free-devel >= 5 Conflicts: libavformat-free-devel >= 5 Conflicts: libavutil-free-devel >= 5 Conflicts: libpostproc-free-devel >= 5 Conflicts: libswresample-free-devel >= 5 Conflicts: libswscale-free-devel >= 5 Obsoletes: compat-ffmpeg4-devel <= %{version}-%{release} Provides: compat-ffmpeg4-devel = %{version}-%{release} %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 version is intended only for dependent packages which have yet to be ported to the latest API provided by the ffmpeg package. %if %{without all_codecs} This build of ffmpeg is limited in the number of codecs supported. %endif %prep %if %{with upstream_tarball} gpgv2 --quiet --keyring %{SOURCE3} %{SOURCE2} %{SOURCE0} %endif %autosetup -a1 -p1 -n ffmpeg-%{version} 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 %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="%{build_cflags}" \ --extra-ldflags="%{build_ldflags}" \ --disable-doc \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-htmlpages \ --enable-pic \ --disable-stripping \ --enable-shared \ --disable-static \ --enable-gpl \ --enable-version3 \ --enable-libsmbclient \ --disable-openssl \ --enable-bzlib \ --enable-frei0r \ --disable-chromaprint \ --enable-gcrypt \ --enable-gnutls \ --enable-ladspa \ --enable-vulkan \ --disable-cuda-sdk \ --enable-libaom \ --enable-libass \ --enable-libbluray \ --enable-libbs2b \ --enable-libcaca \ --enable-libcdio \ --enable-libcodec2 \ --enable-libdav1d \ %if %{with dc1394} --enable-libdc1394 \ %endif --enable-libdrm \ --enable-libfdk-aac \ %if %{with flite} --enable-libflite \ %endif --enable-libfontconfig \ --enable-libfreetype \ --enable-libfribidi \ --enable-libgme \ --enable-libgsm \ %if %{with dc1394} --enable-libiec61883 \ %endif --enable-libilbc \ --enable-libjack \ --enable-libmodplug \ --enable-libmp3lame \ --enable-libmysofa \ --enable-libopenh264-dlopen \ --enable-libopenjpeg \ --enable-libopenmpt \ --enable-libopus \ --enable-libpulse \ --enable-librabbitmq \ --enable-librav1e \ --enable-librist \ --enable-librsvg \ --enable-librubberband \ --enable-libsnappy \ --enable-libsvtav1 \ --enable-libsoxr \ --enable-libspeex \ --enable-libssh \ --enable-libsrt \ --enable-libtesseract \ --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-libzmq \ --enable-libzvbi \ %if %{with lto} --enable-lto \ %endif --enable-lv2 \ --enable-vaapi \ --enable-vdpau \ --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-libvo-amrwbenc \ %if %{with x264} --enable-libx264 \ %endif %if %{with x265} --enable-libx265 \ %endif %if %{with librtmp} --enable-librtmp \ %endif --enable-libxvid \ --enable-openal \ --enable-opencl \ --enable-opengl \ --enable-pthreads \ --enable-vapoursynth \ %if %{without all_codecs} --enable-muxers \ --enable-demuxers \ --enable-hwaccels \ --disable-encoders \ --disable-decoders \ --disable-decoder="h264,hevc,vc1" \ --enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' - 4.4.4-3 - Initial build for Fedora