diff --git a/anda/multimedia/ffmpeg/.gitignore b/anda/multimedia/ffmpeg/.gitignore new file mode 100644 index 0000000000..5505c91bc5 --- /dev/null +++ b/anda/multimedia/ffmpeg/.gitignore @@ -0,0 +1,3 @@ +# FFmpeg keys +ffmpeg-devel.asc +ffmpeg.keyring diff --git a/anda/multimedia/ffmpeg/anda.hcl b/anda/multimedia/ffmpeg/anda.hcl index 002c167e92..a6ef9db24e 100644 --- a/anda/multimedia/ffmpeg/anda.hcl +++ b/anda/multimedia/ffmpeg/anda.hcl @@ -2,7 +2,7 @@ project pkg { arches = ["x86_64", "aarch64", "i386"] rpm { spec = "ffmpeg.spec" - extra_repos = ["https://repos.fyralabs.com/terrarawhide-nvidia", "https://repos.fyralabs.com/terrarawhide-multimedia"] + extra_repos = ["https://repos.fyralabs.com/terrarawhide-multimedia"] } labels { updbranch = 1 diff --git a/anda/multimedia/ffmpeg/enable_decoders b/anda/multimedia/ffmpeg/enable_decoders new file mode 100644 index 0000000000..b03967c46d --- /dev/null +++ b/anda/multimedia/ffmpeg/enable_decoders @@ -0,0 +1,479 @@ +## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review) +aac +aasc +libfdk_aac # fdk-aac-free +ac3 +acelp_kelvin +adpcm_4xm +adpcm_adx +adpcm_afc +adpcm_agm +adpcm_aica +adpcm_argo +adpcm_ct +adpcm_dtk +adpcm_ea +adpcm_ea_maxis_xa +adpcm_ea_r1 +adpcm_ea_r2 +adpcm_ea_r3 +adpcm_ea_xas +adpcm_g722 +adpcm_g726 +adpcm_g726le +adpcm_ima_acorn +adpcm_ima_alp +adpcm_ima_amv +adpcm_ima_apc +adpcm_ima_apm +adpcm_ima_cunning +adpcm_ima_dat4 +adpcm_ima_dk3 +adpcm_ima_dk4 +adpcm_ima_ea_eacs +adpcm_ima_ea_sead +adpcm_ima_iss +adpcm_ima_moflex +adpcm_ima_mtf +adpcm_ima_oki +adpcm_ima_qt +adpcm_ima_rad +adpcm_ima_smjpeg +adpcm_ima_ssi +adpcm_ima_wav +adpcm_ima_ws +adpcm_ms +adpcm_mtaf +adpcm_psx +adpcm_sbpro_2 +adpcm_sbpro_3 +adpcm_sbpro_4 +adpcm_swf +adpcm_thp +adpcm_thp_le +adpcm_vima +adpcm_xa +adpcm_xmd +adpcm_yamaha +adpcm_zork +aic +alac +alias_pix +amrnb +amrwb +amv +anm +ansi # trivial +anull +apac +ape +apng # animated png +apv +arbc +argo +ass # trivial +asv1 +asv2 +atrac1 +atrac3 +atrac3al +atrac3p +atrac3pal +aura +aura2 +av1 # libaom +av1_qsv # libaom +bethsoftvid # trivial +bfi # trivial +bink +binkaudio_dct +binkaudio_rdft +bintext +bitpacked # trivial +bmp # trivial +bmv_audio +bmv_video +bonk +brender_pix +c93 +cbd2_dpcm +ccaption +cdgraphics +cdtoons +cdxl +cinepak +clearvideo +cljr +cook +cpia +cscd +cyuv +dca +dds +derf_dpcm +dfa +dfpwm +dirac # dirac +dnxhd +dnxhr +dolby_e +dpx +dsd_lsbf +dsd_msbf +dsicinaudio +dsicinvideo +dss_sp +dvaudio +dvbsub +dvdsub +dvvideo +dxa +dxtory +eacmv +eamad +eatgq +eatgv +eatqi +eightbps +eightsvx_exp +eightsvx_fib +escape124 +escape130 +evrc +exr # openEXR +ffv1 # ffmpeg +ffvhuff # ffmpeg +ffwavesynth # pseudo +fits +flac # libFLAC +flashsv +flashsv2 +flic +flv +fmvc +fourxm +ftr # fdk-aac +g723_1 +g729 +gdv +gem +gif # libpng +gremlin_dpcm +gsm # libgsm +gsm_ms +h261 +h263 +h263_v4l2m2m # hardware +h263i +h263p +hap +hca +hcom +hdr +hnm4_video +hq_hqa +hqx +huffyuv # trivial+zlib +hymt # huffyuv-mt +iac +idcin +idf +iff_ilbm +ilbc # ilbc +imc +indeo2 +indeo3 +indeo4 +indeo5 +interplay_acm +interplay_dpcm +interplay_video +ipu +jacosub +jpeg2000 # openjpeg2 +jpegls +jv +kgv1 +kmvc +lagarith +libaribb24 # aribb24 +libaribcaption # libaribcaption +libaom # libaom +libaom_av1 # libaom +libcodec2 # codec2 +libdav1d # av1 +libgsm # libgsm +libgsm_ms # libgsm +libilbc # ilbc +libjxl # libjxl +liblc3 # liblc3 +libopencore_amrnb # opencore-amr +libopencore_amrwb # opencore-amr +libopenh264 # openh264 +libopenjpeg # openjpeg +libopus # opus +librsvg # librsvg +libschroedinger # schroedinger +libspeex # speex +libvorbis # libvorbis +libvpx_vp8 # libvpx +libvpx_vp9 # libvpx +libxevd +libzvbi_teletext # zvbi +loco +lscr +m101 +mace3 +mace6 +mdec +media100 +metasound +microdvd +mimic +misc4 +mjpeg # mjpegtools +mjpeg_qsv # mjpegtools +mjpegb +mlp +mmvideo +motionpixels +movtext +mp1 # twolame/lame +mp1float # twolame/lame +mp2 # twolame +mp2float # twolame +mp3 # lame +mp3adu +mp3adufloat +mp3float # lame +mp3on4 +mp3on4float +mpc7 +mpc8 +mpeg1_v4l2m2m +mpeg1video +mpeg2_qsv +mpeg2_v4l2m2m +mpeg2video +mpeg4 +mpeg4_v4l2m2m # hardware +mpegvideo +mpl2 +msa1 +mscc +msmpeg4v1 +msmpeg4v2 +msmpeg4v3 +msnsiren +msp2 +msrle +mss1 +msvideo1 +mszh +mts2 +mv30 +mvc1 +mvc2 +mvdv +mvha +mwsc +mxpeg +nellymoser +nuv +on2avc +opus # libopus +paf_audio +paf_video +pam # trivial +pbm # trivial +pcm_alaw # trivial +pcm_bluray +pcm_dvd +pcm_f16le # trivial +pcm_f24le # trivial +pcm_f32be # trivial +pcm_f32le # trivial +pcm_f64be # trivial +pcm_f64le # trivial +pcm_lxf # trivial +pcm_mulaw # trivial +pcm_s16be # trivial +pcm_s16be_planar # trivial +pcm_s16le # trivial +pcm_s16le_planar # trivial +pcm_s24be # trivial +pcm_s24daud # trivial +pcm_s24le # trivial +pcm_s24le_planar # trivial +pcm_s32be # trivial +pcm_s32le # trivial +pcm_s32le_planar # trivial +pcm_s64be # trivial +pcm_s64le # trivial +pcm_s8 # trivial +pcm_s8_planar # trivial +pcm_sga # trivial +pcm_u16be # trivial +pcm_u16le # trivial +pcm_u24be # trivial +pcm_u24le # trivial +pcm_u32be # trivial +pcm_u32le # trivial +pcm_u8 # trivial +pcm_vidc # trivial +pcx +pfm # trivial +pgm # trivial +pgmyuv # trivial +pgssub # mkvtoolnix +pgx +phm # trivial +photocd +pictor +pjs +png # libpng +ppm # trivial +prores +prores_raw +prosumer +psd +ptx +qcelp +qdm2 +qdmc +qdraw +qoa +qoi +qpeg +qtrle +r10k +r210 +ra_144 +ra_288 +rasc +rawvideo # trivial +realtext +rka +rl2 +roq +roq_dpcm +rpza +rscc +rv10 +rv20 +s302m +sami +sanm +sbc +screenpresso +sdx2_dpcm +sgi # trivial +sgirle # trivial +shorten +simbiosis_imx +sipr +siren +smackaud +smacker +smc +smvjpeg +snow +sol_dpcm +sonic +sp5x +speedhq +speex +srgc +srt # trivial +ssa # trivial +stl +subrip +subviewer +subviewer1 +sunrast # trivial +svq1 +svq3 +tak +targa # trivial +targa_y216 +tdsc +text # trivial +theora # libtheora +thp +tiertexseqvideo +tiff # libtiff +tmv +truehd +truemotion1 +truemotion2 +truemotion2rt +truespeech +tscc +tscc2 +tta +twinvq +txd +ulti +utvideo +v210 # trivial +v210x # trivial +v308 # trivial +v408 # trivial +v410 # trivial +vb +vble +vcr1 +vmdaudio +vmdvideo +vmnc +vnull +vorbis # libvorbis +vp3 # libav +vp4 # libav +vp5 # libav +vp6 # libav +vp6a # libav +vp6f # libav +vp7 # libav +vp8 # libvpx +vp8_qsv # libvpx +vp8_v4l2m2m # libvpx +vp9 # libvpx +vp9_qsv # libvpx +vp9_v4l2m2m # libvpx +vplayer +vqa +vqc +wady_dpcm +wavarc +wavpack +wbmp +wcmv +webp # libwebp +webvtt # trivial +wmav1 +wmav2 +wmavoice +wmv1 +wmv2 +wnv1 +wrapped_avframe # passthrough +ws_snd1 +xan_dpcm +xan_wc3 +xan_wc4 +xbin +xbm # trivial +xface +xl +xpm +xsub +xwd # xwd +y41p # trivial +ylc +yop +yuv4 # trivial +zero12v +zerocodec +zlib # zlib +zmbv # dosbox diff --git a/anda/multimedia/ffmpeg/enable_encoders b/anda/multimedia/ffmpeg/enable_encoders new file mode 100644 index 0000000000..d49e1a9514 --- /dev/null +++ b/anda/multimedia/ffmpeg/enable_encoders @@ -0,0 +1,216 @@ +## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review) +a64multi +a64multi5 +aac +libfdk_aac # fdk-aac-free +ac3 +adpcm_adx +adpcm_argo +adpcm_g722 +adpcm_g726 +adpcm_g726le +adpcm_ima_alp +adpcm_ima_amv +adpcm_ima_apm +adpcm_ima_qt +adpcm_ima_ssi +adpcm_ima_wav +adpcm_ima_ws +adpcm_ms +adpcm_swf +adpcm_yamaha +alac +alias_pix +amv +anull +apng # libpng +ass # trivial +asv1 +asv2 +av1_amf +av1_nvenc +av1_qsv +av1_vaapi +bitpacked # trivial +bmp # trivial +cinepak +cljr +dca +dfpwm +dnxhd +dnxhr +dpx +dvbsub +dvdsub +dvvideo +exr +ffv1 +ffvhuff # trivial+zlib +flac # libFLAC +flashsv +flashsv2 +flv +g723_1 +gif # libpng +h261 +h263 +h263_v4l2m2m # hardware +h263p +h264_amf # hardware +h264_nvenc # hardware +h264_qsv # hardware +h264_v4l2m2m # hardware +h264_vaapi # hardware +hap +hdr +hevc_amf # hardware +hevc_nvenc # hardware +hevc_qsv # hardware +hevc_v4l2m2m # hardware +hevc_vaapi # hardware +huffyuv # trivial+zlib +ilbc # ilbc +jpeg2000 +jpegls +libaom +libaom_av1 # libaom +libcodec2 # codec2 +libgsm # libgsm +libgsm_ms # libgsm +libilbc # ilbc +libjxl # libjxl +liblc3 # liblc3 +libmp3lame # lame +liboapv +libopencore_amrnb +libopenh264 # openh264 +libopenjpeg # openjpeg +libopus # opus +librav1e # rav1e +libspeex # speex +libsvtav1 +libtheora # libtheora +libtwolame # twolame +libvo_amrwbenc +libvorbis # libvorbis +libvpx_vp8 # libvpx +libvpx_vp9 # libvpx +libwebp # libwebp +libwebp_anim # libwebp +libxeve +libxvid # xvidcore +mjpeg # mjpegtools +mjpeg_qsv # mjpegtools +mjpeg_vaapi # mjpegtools +mlp +movtext +mp2 # twolame +mp2fixed # twolame +mpeg1video +mpeg2_qsv +mpeg2_vaapi +mpeg2video +mpeg4 +mpeg4_v4l2m2m # hardware +msmpeg4v2 +msmpeg4v3 +msvideo1 +nellymoser +opus # opus +pam +pbm # trivial +pcm_alaw # trivial +pcm_f32be # trivial +pcm_f32le # trivial +pcm_f64be # trivial +pcm_f64le # trivial +pcm_mulaw # trivial +pcm_s16be # trivial +pcm_s16be_planar # trivial +pcm_s16le # trivial +pcm_s16le_planar # trivial +pcm_s24be # trivial +pcm_s24le # trivial +pcm_s24le_planar # trivial +pcm_s32be # trivial +pcm_s32le # trivial +pcm_s32le_planar # trivial +pcm_s8 # trivial +pcm_s8_planar # trivial +pcm_u16be # trivial +pcm_u16le # trivial +pcm_u24be # trivial +pcm_u24le # trivial +pcm_u32be # trivial +pcm_u32le # trivial +pcm_u8 # trivial +pcx +pgm # trivial +pgmyuv # trivial +phm # trivial +png # libpng +ppm # trivial +prores +prores_aw +prores_ks +qoi +qtrle +r10k # trivial +r210 # trivial +ra_144 +rawvideo # trivial +roq +roq_dpcm +rpza +rv10 +rv20 +s302m +sbc +sgi # trivial +smc +snow +sonic +sonic_ls +speedhq +srt # trivial +ssa # trivial +subrip # trivial +sunrast # trivial +svq1 +targa # trivial +text # trivial +tiff # libtiff +truehd +tta +ttml +utvideo +v210 # trivial +v308 # trivial +v408 # trivial +v410 # trivial +vc1_qsv # hardware +vc1_v4l2m2m # hardware +vc2 # dirac +vnull +vorbis # libvorbis +vp8_qsv # libvpx +vp8_v4l2m2m # libvpx +vp8_vaapi # libvpx +vp9_qsv # libvpx +vp9_vaapi # libvpx +wavpack +wbmp +webvtt # trivial +wmav1 +wmav2 +wmv1 +wmv2 +wrapped_avframe # passthrough +xbm # (X11) +xface +xsub +xwd # xwd +y41p # trivial +yuv4 # trivial +zlib # zlib +zmbv # dosbox diff --git a/anda/multimedia/ffmpeg/ffmpeg-HandBrake.patch b/anda/multimedia/ffmpeg/ffmpeg-HandBrake.patch index e34c256b10..318ee0f12b 100644 --- a/anda/multimedia/ffmpeg/ffmpeg-HandBrake.patch +++ b/anda/multimedia/ffmpeg/ffmpeg-HandBrake.patch @@ -1,878 +1,31 @@ -diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure ---- ffmpeg-7.1.2.old/configure 2025-10-27 10:07:02.407490033 +0100 -+++ ffmpeg-7.1.2/configure 2025-10-27 10:07:02.458434476 +0100 -@@ -2466,6 +2466,7 @@ - kCMVideoCodecType_HEVC - kCMVideoCodecType_HEVCWithAlpha - kCMVideoCodecType_VP9 -+ kCMVideoCodecType_AV1 - kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange - kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange - kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange -@@ -3172,6 +3173,8 @@ - av1_vaapi_hwaccel_select="av1_decoder" - av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1" - av1_vdpau_hwaccel_select="av1_decoder" -+av1_videotoolbox_hwaccel_deps="videotoolbox" -+av1_videotoolbox_hwaccel_select="av1_decoder" - av1_vulkan_hwaccel_deps="vulkan" - av1_vulkan_hwaccel_select="av1_decoder" - h263_vaapi_hwaccel_deps="vaapi" -@@ -3342,6 +3345,7 @@ - av1_mediacodec_decoder_deps="mediacodec" - av1_mediacodec_encoder_deps="mediacodec" - av1_mediacodec_encoder_select="extract_extradata_bsf" -+av1_mf_encoder_deps="mediafoundation" - av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1" - av1_nvenc_encoder_select="atsc_a53" - av1_qsv_decoder_select="qsvdec" -@@ -6724,6 +6728,7 @@ - check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia" - check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia" - check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia" -+ check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_AV1 "-framework CoreMedia" - check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo" - check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo" - check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo" -diff -Naur ffmpeg-7.1.2.old/libavcodec/ac3dec.c ffmpeg-7.1.2/libavcodec/ac3dec.c ---- ffmpeg-7.1.2.old/libavcodec/ac3dec.c 2025-10-27 10:07:00.254471036 +0100 -+++ ffmpeg-7.1.2/libavcodec/ac3dec.c 2025-10-27 10:07:02.463169316 +0100 -@@ -253,72 +253,6 @@ - } - - /** -- * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream. -- * GetBitContext within AC3DecodeContext must point to -- * the start of the synchronized AC-3 bitstream. -- */ --static int ac3_parse_header(AC3DecodeContext *s) --{ -- GetBitContext *gbc = &s->gbc; -- int i; -- -- /* read the rest of the bsi. read twice for dual mono mode. */ -- i = !s->channel_mode; -- do { -- s->dialog_normalization[(!s->channel_mode)-i] = -get_bits(gbc, 5); -- if (s->dialog_normalization[(!s->channel_mode)-i] == 0) { -- s->dialog_normalization[(!s->channel_mode)-i] = -31; -- } -- if (s->target_level != 0) { -- s->level_gain[(!s->channel_mode)-i] = powf(2.0f, -- (float)(s->target_level - -- s->dialog_normalization[(!s->channel_mode)-i])/6.0f); -- } -- if (s->compression_exists[(!s->channel_mode)-i] = get_bits1(gbc)) { -- s->heavy_dynamic_range[(!s->channel_mode)-i] = -- AC3_HEAVY_RANGE(get_bits(gbc, 8)); -- } -- if (get_bits1(gbc)) -- skip_bits(gbc, 8); //skip language code -- if (get_bits1(gbc)) -- skip_bits(gbc, 7); //skip audio production information -- } while (i--); -- -- skip_bits(gbc, 2); //skip copyright bit and original bitstream bit -- -- /* skip the timecodes or parse the Alternate Bit Stream Syntax */ -- if (s->bitstream_id != 6) { -- if (get_bits1(gbc)) -- skip_bits(gbc, 14); //skip timecode1 -- if (get_bits1(gbc)) -- skip_bits(gbc, 14); //skip timecode2 -- } else { -- if (get_bits1(gbc)) { -- s->preferred_downmix = get_bits(gbc, 2); -- s->center_mix_level_ltrt = get_bits(gbc, 3); -- s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7); -- s->center_mix_level = get_bits(gbc, 3); -- s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7); -- } -- if (get_bits1(gbc)) { -- s->dolby_surround_ex_mode = get_bits(gbc, 2); -- s->dolby_headphone_mode = get_bits(gbc, 2); -- skip_bits(gbc, 10); // skip adconvtyp (1), xbsi2 (8), encinfo (1) -- } -- } -- -- /* skip additional bitstream info */ -- if (get_bits1(gbc)) { -- i = get_bits(gbc, 6); -- do { -- skip_bits(gbc, 8); -- } while (i--); -- } -- -- return 0; --} -- --/** - * Common function to parse AC-3 or E-AC-3 frame header - */ - static int parse_frame_header(AC3DecodeContext *s) -@@ -375,10 +309,25 @@ - s->dba_syntax = 1; - s->skip_syntax = 1; - memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht)); -- return ac3_parse_header(s); -+ /* volume control params */ -+ for (int i = 0; i < (s->channel_mode ? 1 : 2); i++) { -+ s->dialog_normalization[i] = hdr.dialog_normalization[i]; -+ if (s->dialog_normalization[i] == 0) { -+ s->dialog_normalization[i] = -31; -+ } -+ if (s->target_level != 0) { -+ s->level_gain[i] = powf(2.0f, -+ (float)(s->target_level - s->dialog_normalization[i])/6.0f); -+ } -+ s->compression_exists[i] = hdr.compression_exists[i]; -+ if (s->compression_exists[i]) { -+ s->heavy_dynamic_range[i] = AC3_HEAVY_RANGE(hdr.heavy_dynamic_range[i]); -+ } -+ } -+ return 0; - } else if (CONFIG_EAC3_DECODER) { - s->eac3 = 1; -- return ff_eac3_parse_header(s); -+ return ff_eac3_parse_header(s, &hdr); - } else { - av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n"); - return AVERROR(ENOSYS); -@@ -1562,6 +1511,9 @@ - av_log(avctx, AV_LOG_ERROR, "invalid frame type\n"); - } - break; -+ case AC3_PARSE_ERROR_CHANNEL_MAP: -+ av_log(avctx, AV_LOG_ERROR, "invalid channel map\n"); -+ return AVERROR_INVALIDDATA; - case AC3_PARSE_ERROR_CRC: - break; - default: // Normal AVERROR do not try to recover. -diff -Naur ffmpeg-7.1.2.old/libavcodec/ac3dec.h ffmpeg-7.1.2/libavcodec/ac3dec.h ---- ffmpeg-7.1.2.old/libavcodec/ac3dec.h 2025-10-27 10:07:00.587473974 +0100 -+++ ffmpeg-7.1.2/libavcodec/ac3dec.h 2025-10-27 10:07:02.463287298 +0100 -@@ -255,11 +255,12 @@ - AVChannelLayout downmix_layout; - } AC3DecodeContext; - -+struct AC3HeaderInfo; - /** - * Parse the E-AC-3 frame header. - * This parses both the bit stream info and audio frame header. - */ --static int ff_eac3_parse_header(AC3DecodeContext *s); -+static int ff_eac3_parse_header(AC3DecodeContext *s, const struct AC3HeaderInfo *hdr); - - /** - * Decode mantissas in a single channel for the entire frame. -diff -Naur ffmpeg-7.1.2.old/libavcodec/ac3defs.h ffmpeg-7.1.2/libavcodec/ac3defs.h ---- ffmpeg-7.1.2.old/libavcodec/ac3defs.h 2025-10-27 10:07:00.586473965 +0100 -+++ ffmpeg-7.1.2/libavcodec/ac3defs.h 2025-10-27 10:07:02.463340118 +0100 -@@ -34,6 +34,8 @@ - #define AC3_CRITICAL_BANDS 50 - #define AC3_MAX_CPL_BANDS 18 - -+#define EAC3_SR_CODE_REDUCED 3 -+ - /* exponent encoding strategy */ - #define EXP_REUSE 0 - #define EXP_NEW 1 -diff -Naur ffmpeg-7.1.2.old/libavcodec/ac3_parser.c ffmpeg-7.1.2/libavcodec/ac3_parser.c ---- ffmpeg-7.1.2.old/libavcodec/ac3_parser.c 2025-10-27 10:07:00.290471354 +0100 -+++ ffmpeg-7.1.2/libavcodec/ac3_parser.c 2025-10-27 10:07:02.462962336 +0100 -@@ -73,6 +73,217 @@ - return i; - } - -+/** -+ * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream. -+ * GetBitContext within AC3DecodeContext must point to -+ * the start of the synchronized AC-3 bitstream. -+ */ -+static int ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) -+{ -+ /* read the rest of the bsi. read twice for dual mono mode. */ -+ for (int i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -+ hdr->dialog_normalization[i] = -get_bits(gbc, 5); -+ hdr->compression_exists[i] = get_bits1(gbc); -+ if (hdr->compression_exists[i]) -+ hdr->heavy_dynamic_range[i] = get_bits(gbc, 8); -+ if (get_bits1(gbc)) -+ skip_bits(gbc, 8); //skip language code -+ if (get_bits1(gbc)) -+ skip_bits(gbc, 7); //skip audio production information -+ } -+ -+ skip_bits(gbc, 2); //skip copyright bit and original bitstream bit -+ -+ /* skip the timecodes or parse the Alternate Bit Stream Syntax */ -+ if (hdr->bitstream_id != 6) { -+ if (get_bits1(gbc)) -+ skip_bits(gbc, 14); //skip timecode1 -+ if (get_bits1(gbc)) -+ skip_bits(gbc, 14); //skip timecode2 -+ } else { -+ if (get_bits1(gbc)) { -+ hdr->preferred_downmix = get_bits(gbc, 2); -+ hdr->center_mix_level_ltrt = get_bits(gbc, 3); -+ hdr->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7); -+ hdr->center_mix_level = get_bits(gbc, 3); -+ hdr->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7); -+ } -+ if (get_bits1(gbc)) { -+ hdr->dolby_surround_ex_mode = get_bits(gbc, 2); -+ hdr->dolby_headphone_mode = get_bits(gbc, 2); -+ skip_bits(gbc, 10); // skip adconvtyp (1), xbsi2 (8), encinfo (1) -+ } -+ } -+ -+ /* skip additional bitstream info */ -+ if (get_bits1(gbc)) { -+ int i = get_bits(gbc, 6); -+ do { -+ skip_bits(gbc, 8); -+ } while (i--); -+ } -+ -+ return 0; -+} -+ -+static int eac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) -+{ -+ if (hdr->frame_type == EAC3_FRAME_TYPE_RESERVED) -+ return AC3_PARSE_ERROR_FRAME_TYPE; -+ if (hdr->substreamid) -+ return AC3_PARSE_ERROR_FRAME_TYPE; -+ -+ skip_bits(gbc, 5); // skip bitstream id -+ -+ /* volume control params */ -+ for (int i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -+ hdr->dialog_normalization[i] = -get_bits(gbc, 5); -+ hdr->compression_exists[i] = get_bits1(gbc); -+ if (hdr->compression_exists[i]) -+ hdr->heavy_dynamic_range[i] = get_bits(gbc, 8); -+ } -+ -+ /* dependent stream channel map */ -+ if (hdr->frame_type == EAC3_FRAME_TYPE_DEPENDENT) { -+ hdr->channel_map_present = get_bits1(gbc); -+ if (hdr->channel_map_present) { -+ int64_t channel_layout = 0; -+ int channel_map = get_bits(gbc, 16); -+ -+ for (int i = 0; i < 16; i++) -+ if (channel_map & (1 << (EAC3_MAX_CHANNELS - i - 1))) -+ channel_layout |= ff_eac3_custom_channel_map_locations[i][1]; -+ -+ if (av_popcount64(channel_layout) > EAC3_MAX_CHANNELS) { -+ return AC3_PARSE_ERROR_CHANNEL_MAP; -+ } -+ hdr->channel_map = channel_map; -+ } -+ } -+ -+ /* mixing metadata */ -+ if (get_bits1(gbc)) { -+ /* center and surround mix levels */ -+ if (hdr->channel_mode > AC3_CHMODE_STEREO) { -+ hdr->preferred_downmix = get_bits(gbc, 2); -+ if (hdr->channel_mode & 1) { -+ /* if three front channels exist */ -+ hdr->center_mix_level_ltrt = get_bits(gbc, 3); -+ hdr->center_mix_level = get_bits(gbc, 3); -+ } -+ if (hdr->channel_mode & 4) { -+ /* if a surround channel exists */ -+ hdr->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7); -+ hdr->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7); -+ } -+ } -+ -+ /* lfe mix level */ -+ if (hdr->lfe_on && (hdr->lfe_mix_level_exists = get_bits1(gbc))) { -+ hdr->lfe_mix_level = get_bits(gbc, 5); -+ } -+ -+ /* info for mixing with other streams and substreams */ -+ if (hdr->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) { -+ for (int i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -+ // TODO: apply program scale factor -+ if (get_bits1(gbc)) { -+ skip_bits(gbc, 6); // skip program scale factor -+ } -+ } -+ if (get_bits1(gbc)) { -+ skip_bits(gbc, 6); // skip external program scale factor -+ } -+ /* skip mixing parameter data */ -+ switch(get_bits(gbc, 2)) { -+ case 1: skip_bits(gbc, 5); break; -+ case 2: skip_bits(gbc, 12); break; -+ case 3: { -+ int mix_data_size = (get_bits(gbc, 5) + 2) << 3; -+ skip_bits_long(gbc, mix_data_size); -+ break; -+ } -+ } -+ /* skip pan information for mono or dual mono source */ -+ if (hdr->channel_mode < AC3_CHMODE_STEREO) { -+ for (int i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -+ if (get_bits1(gbc)) { -+ /* note: this is not in the ATSC A/52B specification -+ reference: ETSI TS 102 366 V1.1.1 -+ section: E.1.3.1.25 */ -+ skip_bits(gbc, 8); // skip pan mean direction index -+ skip_bits(gbc, 6); // skip reserved paninfo bits -+ } -+ } -+ } -+ /* skip mixing configuration information */ -+ if (get_bits1(gbc)) { -+ for (int i = 0; i < hdr->num_blocks; i++) { -+ if (hdr->num_blocks == 1 || get_bits1(gbc)) { -+ skip_bits(gbc, 5); -+ } -+ } -+ } -+ } -+ } -+ -+ /* informational metadata */ -+ if (get_bits1(gbc)) { -+ hdr->bitstream_mode = get_bits(gbc, 3); -+ skip_bits(gbc, 2); // skip copyright bit and original bitstream bit -+ if (hdr->channel_mode == AC3_CHMODE_STEREO) { -+ hdr->dolby_surround_mode = get_bits(gbc, 2); -+ hdr->dolby_headphone_mode = get_bits(gbc, 2); -+ } -+ if (hdr->channel_mode >= AC3_CHMODE_2F2R) { -+ hdr->dolby_surround_ex_mode = get_bits(gbc, 2); -+ } -+ for (int i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -+ if (get_bits1(gbc)) { -+ skip_bits(gbc, 8); // skip mix level, room type, and A/D converter type -+ } -+ } -+ if (hdr->sr_code != EAC3_SR_CODE_REDUCED) { -+ skip_bits1(gbc); // skip source sample rate code -+ } -+ } -+ -+ /* converter synchronization flag -+ If frames are less than six blocks, this bit should be turned on -+ once every 6 blocks to indicate the start of a frame set. -+ reference: RFC 4598, Section 2.1.3 Frame Sets */ -+ if (hdr->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && hdr->num_blocks != 6) { -+ skip_bits1(gbc); // skip converter synchronization flag -+ } -+ -+ /* original frame size code if this stream was converted from AC-3 */ -+ if (hdr->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT && -+ (hdr->num_blocks == 6 || get_bits1(gbc))) { -+ skip_bits(gbc, 6); // skip frame size code -+ } -+ -+ /* additional bitstream info */ -+ if (get_bits1(gbc)) { -+ int addbsil = get_bits(gbc, 6); -+ for (int i = 0; i < addbsil + 1; i++) { -+ if (i == 0) { -+ /* In this 8 bit chunk, the LSB is equal to flag_ec3_extension_type_a -+ which can be used to detect Atmos presence */ -+ skip_bits(gbc, 7); -+ hdr->eac3_extension_type_a = get_bits1(gbc); -+ if (hdr->eac3_extension_type_a) { -+ hdr->complexity_index_type_a = get_bits(gbc, 8); -+ i++; -+ } -+ } else { -+ skip_bits(gbc, 8); // skip additional bit stream info -+ } -+ } -+ } -+ -+ return 0; -+} -+ - int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) - { - int frame_size_code; -@@ -133,6 +344,10 @@ - hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; - hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT; - hdr->substreamid = 0; -+ -+ int ret = ac3_parse_header(gbc, hdr); -+ if (ret < 0) -+ return ret; - } else { - /* Enhanced AC-3 */ - hdr->crc1 = 0; -@@ -165,6 +380,10 @@ - hdr->bit_rate = 8LL * hdr->frame_size * hdr->sample_rate / - (hdr->num_blocks * 256); - hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; -+ -+ int ret = eac3_parse_header(gbc, hdr); -+ if (ret < 0) -+ return ret; - } - hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode]; - if (hdr->lfe_on) -@@ -202,9 +421,13 @@ - { - GetBitContext gb; - AC3HeaderInfo hdr; -+ uint8_t tmp[32 + AV_INPUT_BUFFER_PADDING_SIZE]; - int err; - -- err = init_get_bits8(&gb, buf, size); -+ size = FFMIN(32, size); -+ memcpy(tmp, buf, size); -+ memset(tmp + size, 0, AV_INPUT_BUFFER_PADDING_SIZE); -+ err = init_get_bits8(&gb, tmp, size); - if (err < 0) - return AVERROR_INVALIDDATA; - err = ff_ac3_parse_header(&gb, &hdr); -diff -Naur ffmpeg-7.1.2.old/libavcodec/ac3_parser_internal.h ffmpeg-7.1.2/libavcodec/ac3_parser_internal.h ---- ffmpeg-7.1.2.old/libavcodec/ac3_parser_internal.h 2025-10-27 10:07:00.519473374 +0100 -+++ ffmpeg-7.1.2/libavcodec/ac3_parser_internal.h 2025-10-27 10:07:02.463059088 +0100 -@@ -46,6 +46,7 @@ - int substreamid; ///< substream identification - int center_mix_level; ///< Center mix level index - int surround_mix_level; ///< Surround mix level index -+ uint8_t channel_map_present; - uint16_t channel_map; - int num_blocks; ///< number of audio blocks - int dolby_surround_mode; -@@ -62,6 +63,23 @@ - uint64_t channel_layout; - int8_t ac3_bit_rate_code; - /** @} */ -+ -+ /** @name enhanced eac3 extension coded elements -+ * @{ -+ */ -+ int8_t dialog_normalization[2]; -+ uint8_t compression_exists[2]; -+ uint8_t heavy_dynamic_range[2]; -+ uint8_t center_mix_level_ltrt; ///< Center mix level index -+ uint8_t surround_mix_level_ltrt; ///< Surround mix level index -+ uint8_t dolby_headphone_mode; -+ uint8_t dolby_surround_ex_mode; -+ uint8_t lfe_mix_level_exists; -+ uint8_t lfe_mix_level; -+ uint8_t preferred_downmix; -+ uint8_t eac3_extension_type_a; -+ uint8_t complexity_index_type_a; -+ /** @} */ - } AC3HeaderInfo; - - typedef enum { -@@ -71,6 +89,7 @@ - AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a, - AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a, - AC3_PARSE_ERROR_CRC = -0x6030c0a, -+ AC3_PARSE_ERROR_CHANNEL_MAP = -0x7030c0a, - } AC3ParseError; - - /** -diff -Naur ffmpeg-7.1.2.old/libavcodec/allcodecs.c ffmpeg-7.1.2/libavcodec/allcodecs.c ---- ffmpeg-7.1.2.old/libavcodec/allcodecs.c 2025-10-27 10:07:01.864539025 +0100 -+++ ffmpeg-7.1.2/libavcodec/allcodecs.c 2025-10-27 10:07:02.458796899 +0100 -@@ -839,6 +839,7 @@ - extern const FFCodec ff_av1_qsv_decoder; - extern const FFCodec ff_av1_qsv_encoder; - extern const FFCodec ff_av1_amf_encoder; -+extern const FFCodec ff_av1_mf_encoder; - extern const FFCodec ff_av1_vaapi_encoder; - extern const FFCodec ff_libopenh264_encoder; - extern const FFCodec ff_libopenh264_decoder; -diff -Naur ffmpeg-7.1.2.old/libavcodec/amfenc_av1.c ffmpeg-7.1.2/libavcodec/amfenc_av1.c ---- ffmpeg-7.1.2.old/libavcodec/amfenc_av1.c 2025-10-27 10:07:00.536473524 +0100 -+++ ffmpeg-7.1.2/libavcodec/amfenc_av1.c 2025-10-27 10:07:02.440481173 +0100 -@@ -116,6 +116,7 @@ - { "none", "no adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_NONE }, 0, 0, VE, .unit = "adaptive_quantisation_mode" }, - { "caq", "context adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ }, 0, 0, VE, .unit = "adaptive_quantisation_mode" }, - -+ { "forced_idr", "Force I frames to be IDR frames", OFFSET(forced_idr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, - - { "align", "alignment mode", OFFSET(align), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS }, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS, VE, .unit = "align" }, - { "64x16", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY }, 0, 0, VE, .unit = "align" }, -@@ -186,6 +187,8 @@ - AMFRate framerate; - AMFSize framesize = AMFConstructSize(avctx->width, avctx->height); - amf_int64 color_depth; -+ amf_int64 color_primaries; -+ amf_int64 transfer_characteristic; - amf_int64 color_profile; - enum AVPixelFormat pix_fmt; - -@@ -238,7 +241,11 @@ - } - - /// Color profile -+ color_primaries = ff_amf_get_color_primaries(avctx); -+ transfer_characteristic = ff_amf_get_transfer_characteristic(avctx); - color_profile = ff_amf_get_color_profile(avctx); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, color_primaries); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, transfer_characteristic); - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE, color_profile); - - /// Color Depth -@@ -250,16 +257,6 @@ - } - - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_COLOR_BIT_DEPTH, color_depth); -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE, color_profile); -- if (color_depth == AMF_COLOR_BIT_DEPTH_8) { -- /// Color Transfer Characteristics (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709); -- /// Color Primaries (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT709); -- } else { -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084); -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT2020); -- } - - profile_level = avctx->level; - if (profile_level == AV_LEVEL_UNKNOWN) { -diff -Naur ffmpeg-7.1.2.old/libavcodec/amfenc.c ffmpeg-7.1.2/libavcodec/amfenc.c ---- ffmpeg-7.1.2.old/libavcodec/amfenc.c 2025-10-27 10:07:00.387472209 +0100 -+++ ffmpeg-7.1.2/libavcodec/amfenc.c 2025-10-27 10:07:02.445244447 +0100 -@@ -415,10 +415,6 @@ +diff -Naur ffmpeg-8.1.1.old/libavcodec/amfenc.c ffmpeg-8.1.1/libavcodec/amfenc.c +--- ffmpeg-8.1.1.old/libavcodec/amfenc.c 2026-05-22 09:46:43.295257485 +0200 ++++ ffmpeg-8.1.1/libavcodec/amfenc.c 2026-05-22 09:46:44.835915513 +0200 +@@ -173,10 +173,6 @@ else pix_fmt = avctx->pix_fmt; - if (pix_fmt == AV_PIX_FMT_P010) { -- AMF_RETURN_IF_FALSE(ctx, ctx->version >= AMF_MAKE_FULL_VERSION(1, 4, 32, 0), AVERROR_UNKNOWN, "10-bit encoder is not supported by AMD GPU drivers versions lower than 23.30.\n"); +- AMF_RETURN_IF_FALSE(ctx, amf_device_ctx->version >= AMF_MAKE_FULL_VERSION(1, 4, 32, 0), AVERROR_UNKNOWN, "10-bit encoder is not supported by AMD GPU drivers versions lower than 23.30.\n"); - } - - ctx->format = amf_av_to_amf_format(pix_fmt); + ctx->format = av_av_to_amf_format(pix_fmt); AMF_RETURN_IF_FALSE(ctx, ctx->format != AMF_SURFACE_UNKNOWN, AVERROR(EINVAL), "Format %s is not supported\n", av_get_pix_fmt_name(pix_fmt)); -@@ -766,11 +762,50 @@ - switch (avctx->codec->id) { - case AV_CODEC_ID_H264: - AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_AUD, !!ctx->aud); -+ switch (frame->pict_type) { -+ case AV_PICTURE_TYPE_I: -+ if (ctx->forced_idr) { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_SPS, 1); -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_PPS, 1); -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_IDR); -+ } else { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_I); -+ } -+ break; -+ case AV_PICTURE_TYPE_P: -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_P); -+ break; -+ case AV_PICTURE_TYPE_B: -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_B); -+ break; -+ } - break; - case AV_CODEC_ID_HEVC: - AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_AUD, !!ctx->aud); -+ switch (frame->pict_type) { -+ case AV_PICTURE_TYPE_I: -+ if (ctx->forced_idr) { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_HEADER, 1); -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_IDR); -+ } else { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_I); -+ } -+ break; -+ case AV_PICTURE_TYPE_P: -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_P); -+ break; -+ } -+ break; -+ case AV_CODEC_ID_AV1: -+ if (frame->pict_type == AV_PICTURE_TYPE_I) { -+ if (ctx->forced_idr) { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_INSERT_SEQUENCE_HEADER, 1); -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_KEY); -+ } else { -+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_INTRA_ONLY); -+ } -+ } - break; -- //case AV_CODEC_ID_AV1 not supported - default: - break; - } -@@ -878,6 +913,115 @@ - return ret; - } - -+int ff_amf_get_color_primaries(AVCodecContext *avctx) -+{ -+ amf_int64 color_primaries = AMF_COLOR_PRIMARIES_UNDEFINED; -+ switch (avctx->color_primaries) { -+ case AVCOL_PRI_BT709: -+ color_primaries = AMF_COLOR_PRIMARIES_BT709; -+ break; -+ case AVCOL_PRI_UNSPECIFIED: -+ color_primaries = AMF_COLOR_PRIMARIES_UNSPECIFIED; -+ break; -+ case AVCOL_PRI_RESERVED: -+ color_primaries = AMF_COLOR_PRIMARIES_RESERVED; -+ break; -+ case AVCOL_PRI_BT470M: -+ color_primaries = AMF_COLOR_PRIMARIES_BT470M; -+ break; -+ case AVCOL_PRI_BT470BG: -+ color_primaries = AMF_COLOR_PRIMARIES_BT470BG; -+ break; -+ case AVCOL_PRI_SMPTE170M: -+ color_primaries = AMF_COLOR_PRIMARIES_SMPTE170M; -+ break; -+ case AVCOL_PRI_SMPTE240M: -+ color_primaries = AMF_COLOR_PRIMARIES_SMPTE240M; -+ break; -+ case AVCOL_PRI_FILM: -+ color_primaries = AMF_COLOR_PRIMARIES_FILM; -+ break; -+ case AVCOL_PRI_BT2020: -+ color_primaries = AMF_COLOR_PRIMARIES_BT2020; -+ break; -+ case AVCOL_PRI_SMPTE428: -+ color_primaries = AMF_COLOR_PRIMARIES_SMPTE428; -+ break; -+ case AVCOL_PRI_SMPTE431: -+ color_primaries = AMF_COLOR_PRIMARIES_SMPTE431; -+ break; -+ case AVCOL_PRI_SMPTE432: -+ color_primaries = AMF_COLOR_PRIMARIES_SMPTE432; -+ break; -+ case AVCOL_PRI_EBU3213: -+ color_primaries = AMF_COLOR_PRIMARIES_JEDEC_P22; -+ break; -+ } -+ return color_primaries; -+} -+ -+int ff_amf_get_transfer_characteristic(AVCodecContext *avctx) -+{ -+ amf_int64 transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED; -+ switch (avctx->color_trc) { -+ case AVCOL_TRC_BT709: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709; -+ break; -+ case AVCOL_TRC_UNSPECIFIED: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNSPECIFIED; -+ break; -+ case AVCOL_TRC_RESERVED: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_RESERVED; -+ break; -+ case AVCOL_TRC_GAMMA22: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_GAMMA22; -+ break; -+ case AVCOL_TRC_GAMMA28: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_GAMMA28; -+ break; -+ case AVCOL_TRC_SMPTE170M: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M; -+ break; -+ case AVCOL_TRC_SMPTE240M: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE240M; -+ break; -+ case AVCOL_TRC_LINEAR: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_LINEAR; -+ break; -+ case AVCOL_TRC_LOG: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_LOG; -+ break; -+ case AVCOL_TRC_LOG_SQRT: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_LOG_SQRT; -+ break; -+ case AVCOL_TRC_IEC61966_2_4: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_IEC61966_2_4; -+ break; -+ case AVCOL_TRC_BT1361_ECG: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_BT1361_ECG; -+ break; -+ case AVCOL_TRC_IEC61966_2_1: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_IEC61966_2_1; -+ break; -+ case AVCOL_TRC_BT2020_10: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_BT2020_10; -+ break; -+ case AVCOL_TRC_BT2020_12: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_BT2020_12; -+ break; -+ case AVCOL_TRC_SMPTE2084: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084; -+ break; -+ case AVCOL_TRC_SMPTE428: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE428; -+ break; -+ case AVCOL_TRC_ARIB_STD_B67: -+ transfer_characteristic = AMF_COLOR_TRANSFER_CHARACTERISTIC_ARIB_STD_B67; -+ break; -+ } -+ return transfer_characteristic; -+} -+ - int ff_amf_get_color_profile(AVCodecContext *avctx) - { - amf_int64 color_profile = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN; -diff -Naur ffmpeg-7.1.2.old/libavcodec/amfenc.h ffmpeg-7.1.2/libavcodec/amfenc.h ---- ffmpeg-7.1.2.old/libavcodec/amfenc.h 2025-10-27 10:07:00.322471636 +0100 -+++ ffmpeg-7.1.2/libavcodec/amfenc.h 2025-10-27 10:07:02.440421671 +0100 -@@ -114,6 +114,7 @@ - int max_b_frames; - int qvbr_quality_level; - int hw_high_motion_quality_boost; -+ int forced_idr; - - // HEVC - specific options - -@@ -173,6 +174,8 @@ - */ - extern const enum AVPixelFormat ff_amf_pix_fmts[]; - -+int ff_amf_get_color_primaries(AVCodecContext *avctx); -+int ff_amf_get_transfer_characteristic(AVCodecContext *avctx); - int ff_amf_get_color_profile(AVCodecContext *avctx); - - /** -diff -Naur ffmpeg-7.1.2.old/libavcodec/amfenc_h264.c ffmpeg-7.1.2/libavcodec/amfenc_h264.c ---- ffmpeg-7.1.2.old/libavcodec/amfenc_h264.c 2025-10-27 10:07:00.604474124 +0100 -+++ ffmpeg-7.1.2/libavcodec/amfenc_h264.c 2025-10-27 10:07:02.440571423 +0100 -@@ -133,6 +133,7 @@ - { "me_half_pel", "Enable ME Half Pixel", OFFSET(me_half_pel), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE }, - { "me_quarter_pel", "Enable ME Quarter Pixel", OFFSET(me_quarter_pel),AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE }, - -+ { "forced_idr", "Force I frames to be IDR frames", OFFSET(forced_idr) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, - { "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) , AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE }, - - -@@ -201,6 +202,8 @@ - AMFRate framerate; - AMFSize framesize = AMFConstructSize(avctx->width, avctx->height); - int deblocking_filter = (avctx->flags & AV_CODEC_FLAG_LOOP_FILTER) ? 1 : 0; -+ amf_int64 color_primaries; -+ amf_int64 transfer_characteristic; - amf_int64 color_profile; - enum AVPixelFormat pix_fmt; - -@@ -273,7 +276,11 @@ - AMF_ASSIGN_PROPERTY_RATIO(res, ctx->encoder, AMF_VIDEO_ENCODER_ASPECT_RATIO, ratio); - } - -+ color_primaries = ff_amf_get_color_primaries(avctx); -+ transfer_characteristic = ff_amf_get_transfer_characteristic(avctx); - color_profile = ff_amf_get_color_profile(avctx); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_OUTPUT_COLOR_PRIMARIES, color_primaries); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_OUTPUT_TRANSFER_CHARACTERISTIC, transfer_characteristic); - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_OUTPUT_COLOR_PROFILE, color_profile); - - /// Color Range (Support for older Drivers) -@@ -287,10 +294,6 @@ - AMF_RETURN_IF_FALSE(ctx, pix_fmt != AV_PIX_FMT_P010, AVERROR_INVALIDDATA, "10-bit input video is not supported by AMF H264 encoder\n"); - - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_COLOR_BIT_DEPTH, AMF_COLOR_BIT_DEPTH_8); -- /// Color Transfer Characteristics (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_OUTPUT_TRANSFER_CHARACTERISTIC, (amf_int64)avctx->color_trc); -- /// Color Primaries (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_OUTPUT_COLOR_PRIMARIES, (amf_int64)avctx->color_primaries); - - // autodetect rate control method - if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_UNKNOWN) { -diff -Naur ffmpeg-7.1.2.old/libavcodec/amfenc_hevc.c ffmpeg-7.1.2/libavcodec/amfenc_hevc.c ---- ffmpeg-7.1.2.old/libavcodec/amfenc_hevc.c 2025-10-27 10:07:00.324471654 +0100 -+++ ffmpeg-7.1.2/libavcodec/amfenc_hevc.c 2025-10-27 10:07:02.440657756 +0100 -@@ -100,6 +100,7 @@ - { "me_half_pel", "Enable ME Half Pixel", OFFSET(me_half_pel), AV_OPT_TYPE_BOOL,{ .i64 = -1 }, -1, 1, VE }, - { "me_quarter_pel", "Enable ME Quarter Pixel ", OFFSET(me_quarter_pel),AV_OPT_TYPE_BOOL,{ .i64 = -1 }, -1, 1, VE }, - -+ { "forced_idr", "Force I frames to be IDR frames", OFFSET(forced_idr) ,AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, - { "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL,{ .i64 = -1 }, -1, 1, VE }, - - -@@ -167,6 +168,8 @@ - AMFSize framesize = AMFConstructSize(avctx->width, avctx->height); - int deblocking_filter = (avctx->flags & AV_CODEC_FLAG_LOOP_FILTER) ? 1 : 0; - amf_int64 color_depth; -+ amf_int64 color_primaries; -+ amf_int64 transfer_characteristic; - amf_int64 color_profile; - enum AVPixelFormat pix_fmt; - -@@ -241,7 +244,11 @@ - AMF_ASSIGN_PROPERTY_RATIO(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_ASPECT_RATIO, ratio); - } - -+ color_primaries = ff_amf_get_color_primaries(avctx); -+ transfer_characteristic = ff_amf_get_transfer_characteristic(avctx); - color_profile = ff_amf_get_color_profile(avctx); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, color_primaries); -+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, transfer_characteristic); - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE, color_profile); - /// Color Range (Support for older Drivers) - AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE, !!(avctx->color_range == AVCOL_RANGE_JPEG)); -@@ -253,15 +260,6 @@ - color_depth = AMF_COLOR_BIT_DEPTH_10; - } - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH, color_depth); -- if (color_depth == AMF_COLOR_BIT_DEPTH_8) { -- /// Color Transfer Characteristics (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709); -- /// Color Primaries (AMF matches ISO/IEC) -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT709); -- } else { -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084); -- AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT2020); -- } - - // Picture control properties - AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR, ctx->gops_per_idr); -diff -Naur ffmpeg-7.1.2.old/libavcodec/av1dec.c ffmpeg-7.1.2/libavcodec/av1dec.c ---- ffmpeg-7.1.2.old/libavcodec/av1dec.c 2025-10-27 10:07:00.478473013 +0100 -+++ ffmpeg-7.1.2/libavcodec/av1dec.c 2025-10-27 10:07:02.454638605 +0100 -@@ -541,6 +541,7 @@ - CONFIG_AV1_NVDEC_HWACCEL + \ - CONFIG_AV1_VAAPI_HWACCEL + \ - CONFIG_AV1_VDPAU_HWACCEL + \ -+ CONFIG_AV1_VIDEOTOOLBOX_HWACCEL + \ - CONFIG_AV1_VULKAN_HWACCEL) - enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; - -@@ -568,6 +569,9 @@ - #if CONFIG_AV1_VDPAU_HWACCEL - *fmtp++ = AV_PIX_FMT_VDPAU; - #endif -+#if CONFIG_AV1_VIDEOTOOLBOX_HWACCEL -+ *fmtp++ = AV_PIX_FMT_VIDEOTOOLBOX; -+#endif - #if CONFIG_AV1_VULKAN_HWACCEL - *fmtp++ = AV_PIX_FMT_VULKAN; - #endif -@@ -592,6 +596,9 @@ - #if CONFIG_AV1_VDPAU_HWACCEL - *fmtp++ = AV_PIX_FMT_VDPAU; - #endif -+#if CONFIG_AV1_VIDEOTOOLBOX_HWACCEL -+ *fmtp++ = AV_PIX_FMT_VIDEOTOOLBOX; -+#endif - #if CONFIG_AV1_VULKAN_HWACCEL - *fmtp++ = AV_PIX_FMT_VULKAN; - #endif -@@ -1002,6 +1009,8 @@ - break; - } - case ITU_T_T35_PROVIDER_CODE_DOLBY: { +diff -Naur ffmpeg-8.1.1.old/libavcodec/av1dec.c ffmpeg-8.1.1/libavcodec/av1dec.c +--- ffmpeg-8.1.1.old/libavcodec/av1dec.c 2026-05-22 09:46:43.359258035 +0200 ++++ ffmpeg-8.1.1/libavcodec/av1dec.c 2026-05-22 09:46:44.827987092 +0200 +@@ -1019,6 +1019,8 @@ + if (ret < 0) + return ret; + } else if (country_code == ITU_T_T35_COUNTRY_CODE_US && provider_code == ITU_T_T35_PROVIDER_CODE_DOLBY) { + AVBufferRef *rpu_buf; + AVFrameSideData *rpu; int provider_oriented_code = bytestream2_get_be32(&gb); - if (itut_t35->itu_t_t35_country_code != ITU_T_T35_COUNTRY_CODE_US || - provider_oriented_code != 0x800) -@@ -1014,6 +1023,18 @@ - break; // ignore + if (provider_oriented_code != 0x800) + return 0; // ignore +@@ -1030,6 +1032,18 @@ + return 0; // ignore } + rpu_buf = av_buffer_alloc(itut_t35->payload_size); @@ -890,110 +43,13 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/av1dec.c ffmpeg-7.1.2/libavcodec/av1dec.c ret = ff_dovi_attach_side_data(&s->dovi, frame); if (ret < 0) return ret; -@@ -1439,6 +1460,10 @@ - - if (raw_tile_group && (s->tile_num == raw_tile_group->tg_end + 1)) { - int show_frame = s->raw_frame_header->show_frame; -+ // Set nb_unit to point at the next OBU, to indicate which -+ // OBUs have been processed for this current frame. (If this -+ // frame gets output, we set nb_unit to this value later too.) -+ s->nb_unit = i + 1; - if (avctx->hwaccel && s->cur_frame.f) { - ret = FF_HW_SIMPLE_CALL(avctx, end_frame); - if (ret < 0) { -@@ -1449,6 +1474,8 @@ - - update_reference_list(avctx); - -+ // Set start_unit to indicate the first OBU of the next frame. -+ s->start_unit = s->nb_unit; - raw_tile_group = NULL; - s->raw_frame_header = NULL; - -@@ -1478,7 +1505,7 @@ - s->raw_frame_header = NULL; - av_packet_unref(s->pkt); - ff_cbs_fragment_reset(&s->current_obu); -- s->nb_unit = 0; -+ s->nb_unit = s->start_unit = 0; - } - if (!ret && !frame->buf[0]) - ret = AVERROR(EAGAIN); -@@ -1505,7 +1532,7 @@ - return ret; - } - -- s->nb_unit = 0; -+ s->nb_unit = s->start_unit = 0; - av_log(avctx, AV_LOG_DEBUG, "Total OBUs on this packet: %d.\n", - s->current_obu.nb_units); - } -@@ -1526,7 +1553,7 @@ - - av1_frame_unref(&s->cur_frame); - s->operating_point_idc = 0; -- s->nb_unit = 0; -+ s->nb_unit = s->start_unit = 0; - s->raw_frame_header = NULL; - s->raw_seq = NULL; - s->cll = NULL; -@@ -1594,6 +1621,9 @@ - #if CONFIG_AV1_VDPAU_HWACCEL - HWACCEL_VDPAU(av1), - #endif -+#if CONFIG_AV1_VIDEOTOOLBOX_HWACCEL -+ HWACCEL_VIDEOTOOLBOX(av1), -+#endif - #if CONFIG_AV1_VULKAN_HWACCEL - HWACCEL_VULKAN(av1), - #endif -diff -Naur ffmpeg-7.1.2.old/libavcodec/av1dec.h ffmpeg-7.1.2/libavcodec/av1dec.h ---- ffmpeg-7.1.2.old/libavcodec/av1dec.h 2025-10-27 10:07:00.402472342 +0100 -+++ ffmpeg-7.1.2/libavcodec/av1dec.h 2025-10-27 10:07:02.454762738 +0100 -@@ -114,7 +114,8 @@ - AV1Frame ref[AV1_NUM_REF_FRAMES]; - AV1Frame cur_frame; - -- int nb_unit; -+ int nb_unit; ///< The index of the next OBU to be processed. -+ int start_unit; ///< The index of the first OBU of the current frame. - - // AVOptions - int operating_point; -diff -Naur ffmpeg-7.1.2.old/libavcodec/bsf/hevc_mp4toannexb.c ffmpeg-7.1.2/libavcodec/bsf/hevc_mp4toannexb.c ---- ffmpeg-7.1.2.old/libavcodec/bsf/hevc_mp4toannexb.c 2025-10-27 10:07:00.449472757 +0100 -+++ ffmpeg-7.1.2/libavcodec/bsf/hevc_mp4toannexb.c 2025-10-27 10:07:02.435022530 +0100 -@@ -125,6 +125,7 @@ - AVPacket *in; - GetByteContext gb; - -+ int has_sps = 0, has_pps = 0; - int got_irap = 0; - int i, ret = 0; - -@@ -158,11 +159,14 @@ - } - - nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f; -+ has_sps = (has_sps || nalu_type == HEVC_NAL_SPS); -+ has_pps = (has_pps || nalu_type == HEVC_NAL_PPS); - - /* prepend extradata to IRAP frames */ - is_irap = nalu_type >= HEVC_NAL_BLA_W_LP && - nalu_type <= HEVC_NAL_RSV_IRAP_VCL23; -- add_extradata = is_irap && !got_irap; -+ /* ignore the extradata if IRAP frame has sps and pps */ -+ add_extradata = is_irap && !got_irap && !(has_sps && has_pps); - extra_size = add_extradata * ctx->par_out->extradata_size; - got_irap |= is_irap; - -diff -Naur ffmpeg-7.1.2.old/libavcodec/ccaption_dec.c ffmpeg-7.1.2/libavcodec/ccaption_dec.c ---- ffmpeg-7.1.2.old/libavcodec/ccaption_dec.c 2025-10-27 10:07:00.593474027 +0100 -+++ ffmpeg-7.1.2/libavcodec/ccaption_dec.c 2025-10-27 10:07:02.429490227 +0100 -@@ -889,12 +889,13 @@ +diff -Naur ffmpeg-8.1.1.old/libavcodec/ccaption_dec.c ffmpeg-8.1.1/libavcodec/ccaption_dec.c +--- ffmpeg-8.1.1.old/libavcodec/ccaption_dec.c 2026-05-22 09:46:43.439258722 +0200 ++++ ffmpeg-8.1.1/libavcodec/ccaption_dec.c 2026-05-22 09:46:44.825712124 +0200 +@@ -893,12 +893,13 @@ if (ctx->buffer[bidx].str[0] || ctx->real_time) { - ff_dlog(ctx, "cdp writing data (%s)\n", ctx->buffer[bidx].str); + ff_dlog(avctx, "cdp writing data (%s)\n", ctx->buffer[bidx].str); - start_time = ctx->buffer_time[0]; - sub->pts = start_time; - end_time = ctx->buffer_time[1]; @@ -1008,9 +64,9 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/ccaption_dec.c ffmpeg-7.1.2/libavcodec/cc else sub->end_display_time = -1; ret = ff_ass_add_rect2(sub, ctx->buffer[bidx].str, ctx->readorder++, 0, NULL, NULL, &nb_rect_allocated); -diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsubdec.c ---- ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c 2025-10-27 10:07:00.303471468 +0100 -+++ ffmpeg-7.1.2/libavcodec/dvdsubdec.c 2025-10-27 10:07:02.428490218 +0100 +diff -Naur ffmpeg-8.1.1.old/libavcodec/dvdsubdec.c ffmpeg-8.1.1/libavcodec/dvdsubdec.c +--- ffmpeg-8.1.1.old/libavcodec/dvdsubdec.c 2026-05-22 09:46:43.236256978 +0200 ++++ ffmpeg-8.1.1/libavcodec/dvdsubdec.c 2026-05-22 09:46:44.824762926 +0200 @@ -45,6 +45,8 @@ int buf_size; int forced_subs_only; @@ -1032,7 +88,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu return -1; if (AV_RB16(buf) == 0) { /* HD subpicture with 4-byte offsets */ -@@ -243,15 +248,22 @@ +@@ -243,15 +248,21 @@ cmd_pos = 2; } @@ -1041,15 +97,14 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu + size = READ_OFFSET(buf + (big_offsets ? 2 : 0)); - cmd_pos = READ_OFFSET(buf + cmd_pos); ++ if (size == 0) ++ return -1; - if (cmd_pos < 0 || cmd_pos > buf_size - 2 - offset_size) { - if (cmd_pos > size) { -- av_log(ctx, AV_LOG_ERROR, "Discarding invalid packet\n"); +- av_log(logctx, AV_LOG_ERROR, "Discarding invalid packet\n"); - return 0; - } -+ if (size == 0) -+ return -1; -+ + if (buf_size < size) return AVERROR(EAGAIN); + @@ -1061,7 +116,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu } while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) { -@@ -524,10 +536,13 @@ +@@ -524,10 +535,13 @@ int appended = 0; int is_menu; @@ -1075,8 +130,8 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu return ret; } buf = ctx->buf; -@@ -538,7 +553,12 @@ - is_menu = decode_dvd_subtitles(ctx, sub, buf, buf_size); +@@ -538,7 +552,12 @@ + is_menu = decode_dvd_subtitles(avctx, ctx, sub, buf, buf_size); if (is_menu == AVERROR(EAGAIN)) { *data_size = 0; - return appended ? 0 : append_to_cached_buf(avctx, buf, buf_size); @@ -1089,7 +144,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu } if (is_menu < 0) { -@@ -547,9 +567,10 @@ +@@ -547,9 +566,10 @@ reset_rects(sub); *data_size = 0; @@ -1101,7 +156,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu goto no_subtitle; if (ctx->forced_subs_only && !(sub->rects[0]->flags & AV_SUBTITLE_FLAG_FORCED)) -@@ -557,6 +578,8 @@ +@@ -557,6 +577,8 @@ ctx->buf_size = 0; *data_size = 1; @@ -1110,15 +165,15 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu return buf_size; } -@@ -682,6 +705,7 @@ +@@ -683,6 +705,7 @@ av_log(avctx, AV_LOG_DEBUG, " 0x%06"PRIx32, ctx->palette[i]); av_log(avctx, AV_LOG_DEBUG, "\n"); } + ctx->pts = AV_NOPTS_VALUE; - return 1; + return 0; } -@@ -698,6 +722,7 @@ +@@ -699,6 +722,7 @@ { "palette", "set the global palette", OFFSET(palette_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, { "ifo_palette", "obtain the global palette from .IFO file", OFFSET(ifo_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, { "forced_subs_only", "Only show forced subtitles", OFFSET(forced_subs_only), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, SD}, @@ -1126,297 +181,84 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/dvdsubdec.c ffmpeg-7.1.2/libavcodec/dvdsu { NULL } }; static const AVClass dvdsub_class = { -diff -Naur ffmpeg-7.1.2.old/libavcodec/eac3dec.c ffmpeg-7.1.2/libavcodec/eac3dec.c ---- ffmpeg-7.1.2.old/libavcodec/eac3dec.c 2025-10-27 10:07:00.490473118 +0100 -+++ ffmpeg-7.1.2/libavcodec/eac3dec.c 2025-10-27 10:07:02.463392296 +0100 -@@ -53,8 +53,6 @@ - EAC3_GAQ_124 - } EAC3GaqMode; - --#define EAC3_SR_CODE_REDUCED 3 -- - static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s) - { - int bin, bnd, ch, i; -@@ -287,7 +285,7 @@ - } - } - --static int ff_eac3_parse_header(AC3DecodeContext *s) -+static int ff_eac3_parse_header(AC3DecodeContext *s, const AC3HeaderInfo *hdr) - { - int i, blk, ch; - int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data; -@@ -323,11 +321,10 @@ - avpriv_request_sample(s->avctx, "Reduced sampling rate"); - return AVERROR_PATCHWELCOME; - } -- skip_bits(gbc, 5); // skip bitstream id - - /* volume control params */ - for (i = 0; i < (s->channel_mode ? 1 : 2); i++) { -- s->dialog_normalization[i] = -get_bits(gbc, 5); -+ s->dialog_normalization[i] = hdr->dialog_normalization[i]; - if (s->dialog_normalization[i] == 0) { - s->dialog_normalization[i] = -31; +diff -Naur ffmpeg-8.1.1.old/libavcodec/libdav1d.c ffmpeg-8.1.1/libavcodec/libdav1d.c +--- ffmpeg-8.1.1.old/libavcodec/libdav1d.c 2026-05-22 09:46:43.355258001 +0200 ++++ ffmpeg-8.1.1/libavcodec/libdav1d.c 2026-05-22 09:46:44.828124641 +0200 +@@ -415,6 +415,8 @@ + if (res < 0) + return res; + } else if (country_code == ITU_T_T35_COUNTRY_CODE_US && provider_code == ITU_T_T35_PROVIDER_CODE_DOLBY) { ++ AVBufferRef *rpu_buf; ++ AVFrameSideData *rpu; + int provider_oriented_code = bytestream2_get_be32(&gb); + if (provider_oriented_code != 0x800) + return 0; // ignore +@@ -426,6 +428,18 @@ + return 0; // ignore } -@@ -335,147 +332,30 @@ - s->level_gain[i] = powf(2.0f, - (float)(s->target_level - s->dialog_normalization[i])/6.0f); - } -- s->compression_exists[i] = get_bits1(gbc); -- if (s->compression_exists[i]) { -- s->heavy_dynamic_range[i] = AC3_HEAVY_RANGE(get_bits(gbc, 8)); -+ if (hdr->compression_exists[i]) { -+ s->heavy_dynamic_range[i] = AC3_HEAVY_RANGE(hdr->heavy_dynamic_range[i]); - } - } -- /* dependent stream channel map */ -- if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) { -- if (get_bits1(gbc)) { -- int64_t channel_layout = 0; -- int channel_map = get_bits(gbc, 16); -- av_log(s->avctx, AV_LOG_DEBUG, "channel_map: %0X\n", channel_map); -- -- for (i = 0; i < 16; i++) -- if (channel_map & (1 << (EAC3_MAX_CHANNELS - i - 1))) -- channel_layout |= ff_eac3_custom_channel_map_locations[i][1]; -- -- if (av_popcount64(channel_layout) > EAC3_MAX_CHANNELS) { -- return AVERROR_INVALIDDATA; -- } -- s->channel_map = channel_map; -- } -- } -+ s->channel_map = hdr->channel_map; - - /* mixing metadata */ -- if (get_bits1(gbc)) { -- /* center and surround mix levels */ -- if (s->channel_mode > AC3_CHMODE_STEREO) { -- s->preferred_downmix = get_bits(gbc, 2); -- if (s->channel_mode & 1) { -- /* if three front channels exist */ -- s->center_mix_level_ltrt = get_bits(gbc, 3); -- s->center_mix_level = get_bits(gbc, 3); -- } -- if (s->channel_mode & 4) { -- /* if a surround channel exists */ -- s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7); -- s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7); -- } -- } -- -- /* lfe mix level */ -- if (s->lfe_on && (s->lfe_mix_level_exists = get_bits1(gbc))) { -- s->lfe_mix_level = get_bits(gbc, 5); -- } -- -- /* info for mixing with other streams and substreams */ -- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) { -- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) { -- // TODO: apply program scale factor -- if (get_bits1(gbc)) { -- skip_bits(gbc, 6); // skip program scale factor -- } -- } -- if (get_bits1(gbc)) { -- skip_bits(gbc, 6); // skip external program scale factor -- } -- /* skip mixing parameter data */ -- switch(get_bits(gbc, 2)) { -- case 1: skip_bits(gbc, 5); break; -- case 2: skip_bits(gbc, 12); break; -- case 3: { -- int mix_data_size = (get_bits(gbc, 5) + 2) << 3; -- skip_bits_long(gbc, mix_data_size); -- break; -- } -- } -- /* skip pan information for mono or dual mono source */ -- if (s->channel_mode < AC3_CHMODE_STEREO) { -- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) { -- if (get_bits1(gbc)) { -- /* note: this is not in the ATSC A/52B specification -- reference: ETSI TS 102 366 V1.1.1 -- section: E.1.3.1.25 */ -- skip_bits(gbc, 8); // skip pan mean direction index -- skip_bits(gbc, 6); // skip reserved paninfo bits -- } -- } -- } -- /* skip mixing configuration information */ -- if (get_bits1(gbc)) { -- for (blk = 0; blk < s->num_blocks; blk++) { -- if (s->num_blocks == 1 || get_bits1(gbc)) { -- skip_bits(gbc, 5); -- } -- } -- } -- } -- } -+ s->preferred_downmix = hdr->preferred_downmix; -+ s->center_mix_level_ltrt = hdr->center_mix_level_ltrt; -+ s->center_mix_level = hdr->center_mix_level; -+ s->surround_mix_level_ltrt = hdr->surround_mix_level_ltrt; -+ s->surround_mix_level = hdr->surround_mix_level; -+ s->lfe_mix_level_exists = hdr->lfe_mix_level_exists; -+ s->lfe_mix_level = hdr->lfe_mix_level; -+ s->dolby_surround_mode = hdr->dolby_surround_mode; -+ s->dolby_headphone_mode = hdr->dolby_headphone_mode; -+ s->dolby_surround_ex_mode = hdr->dolby_surround_ex_mode; - - /* informational metadata */ -- if (get_bits1(gbc)) { -- s->bitstream_mode = get_bits(gbc, 3); -- skip_bits(gbc, 2); // skip copyright bit and original bitstream bit -- if (s->channel_mode == AC3_CHMODE_STEREO) { -- s->dolby_surround_mode = get_bits(gbc, 2); -- s->dolby_headphone_mode = get_bits(gbc, 2); -- } -- if (s->channel_mode >= AC3_CHMODE_2F2R) { -- s->dolby_surround_ex_mode = get_bits(gbc, 2); -- } -- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) { -- if (get_bits1(gbc)) { -- skip_bits(gbc, 8); // skip mix level, room type, and A/D converter type -- } -- } -- if (s->bit_alloc_params.sr_code != EAC3_SR_CODE_REDUCED) { -- skip_bits1(gbc); // skip source sample rate code -- } -- } -- -- /* converter synchronization flag -- If frames are less than six blocks, this bit should be turned on -- once every 6 blocks to indicate the start of a frame set. -- reference: RFC 4598, Section 2.1.3 Frame Sets */ -- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) { -- skip_bits1(gbc); // skip converter synchronization flag -- } -- -- /* original frame size code if this stream was converted from AC-3 */ -- if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT && -- (s->num_blocks == 6 || get_bits1(gbc))) { -- skip_bits(gbc, 6); // skip frame size code -- } -+ s->bitstream_mode = hdr->bitstream_mode; - - /* additional bitstream info */ -- if (get_bits1(gbc)) { -- int addbsil = get_bits(gbc, 6); -- for (i = 0; i < addbsil + 1; i++) { -- if (i == 0) { -- /* In this 8 bit chunk, the LSB is equal to flag_ec3_extension_type_a -- which can be used to detect Atmos presence */ -- skip_bits(gbc, 7); -- if (get_bits1(gbc)) { -- s->eac3_extension_type_a = 1; -- } -- } else { -- skip_bits(gbc, 8); // skip additional bit stream info -- } -- } -- } -+ s->eac3_extension_type_a = hdr->eac3_extension_type_a; - - /* audio frame syntax flags, strategy data, and per-frame data */ - -diff -Naur ffmpeg-7.1.2.old/libavcodec/hwaccels.h ffmpeg-7.1.2/libavcodec/hwaccels.h ---- ffmpeg-7.1.2.old/libavcodec/hwaccels.h 2025-10-27 10:07:00.251471009 +0100 -+++ ffmpeg-7.1.2/libavcodec/hwaccels.h 2025-10-27 10:07:02.454807062 +0100 -@@ -26,6 +26,7 @@ - extern const struct FFHWAccel ff_av1_nvdec_hwaccel; - extern const struct FFHWAccel ff_av1_vaapi_hwaccel; - extern const struct FFHWAccel ff_av1_vdpau_hwaccel; -+extern const struct FFHWAccel ff_av1_videotoolbox_hwaccel; - extern const struct FFHWAccel ff_av1_vulkan_hwaccel; - extern const struct FFHWAccel ff_h263_vaapi_hwaccel; - extern const struct FFHWAccel ff_h263_videotoolbox_hwaccel; -diff -Naur ffmpeg-7.1.2.old/libavcodec/libdav1d.c ffmpeg-7.1.2/libavcodec/libdav1d.c ---- ffmpeg-7.1.2.old/libavcodec/libdav1d.c 2025-10-27 10:07:00.474472977 +0100 -+++ ffmpeg-7.1.2/libavcodec/libdav1d.c 2025-10-27 10:07:02.436286040 +0100 -@@ -563,6 +563,8 @@ - break; - } - case ITU_T_T35_PROVIDER_CODE_DOLBY: { -+ AVBufferRef *rpu_buf; -+ AVFrameSideData *rpu; - int provider_oriented_code = bytestream2_get_be32(&gb); - if (itut_t35->country_code != ITU_T_T35_COUNTRY_CODE_US || - provider_oriented_code != 0x800) -@@ -575,6 +577,18 @@ - break; // ignore - } - -+ rpu_buf = av_buffer_alloc(itut_t35->payload_size); -+ if (rpu_buf) { -+ memcpy(rpu_buf->data, itut_t35->payload, itut_t35->payload_size); -+ rpu = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_DOVI_RPU_BUFFER_T35, rpu_buf); -+ if (!rpu) { -+ av_buffer_unref(&rpu_buf); -+ goto fail; -+ } -+ } else { -+ goto fail; ++ rpu_buf = av_buffer_alloc(itut_t35->payload_size); ++ if (rpu_buf) { ++ memcpy(rpu_buf->data, itut_t35->payload, itut_t35->payload_size); ++ rpu = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_DOVI_RPU_BUFFER_T35, rpu_buf); ++ if (!rpu) { ++ av_buffer_unref(&rpu_buf); ++ return AVERROR(ENOMEM); + } ++ } else { ++ return AVERROR(ENOMEM); ++ } + - res = ff_dovi_attach_side_data(&dav1d->dovi, frame); - if (res < 0) - goto fail; -diff -Naur ffmpeg-7.1.2.old/libavcodec/Makefile ffmpeg-7.1.2/libavcodec/Makefile ---- ffmpeg-7.1.2.old/libavcodec/Makefile 2025-10-27 10:07:01.865180885 +0100 -+++ ffmpeg-7.1.2/libavcodec/Makefile 2025-10-27 10:07:02.454516424 +0100 -@@ -1008,6 +1008,7 @@ - OBJS-$(CONFIG_AV1_NVDEC_HWACCEL) += nvdec_av1.o - OBJS-$(CONFIG_AV1_VAAPI_HWACCEL) += vaapi_av1.o - OBJS-$(CONFIG_AV1_VDPAU_HWACCEL) += vdpau_av1.o -+OBJS-$(CONFIG_AV1_VIDEOTOOLBOX_HWACCEL) += videotoolbox_av1.o - OBJS-$(CONFIG_AV1_VULKAN_HWACCEL) += vulkan_decode.o vulkan_av1.o - OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o - OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o -diff -Naur ffmpeg-7.1.2.old/libavcodec/mfenc.c ffmpeg-7.1.2/libavcodec/mfenc.c ---- ffmpeg-7.1.2.old/libavcodec/mfenc.c 2025-10-27 10:07:00.524473418 +0100 -+++ ffmpeg-7.1.2/libavcodec/mfenc.c 2025-10-27 10:07:02.459027162 +0100 -@@ -1315,3 +1315,4 @@ - - MF_ENCODER(VIDEO, h264, H264, venc_opts, VFMTS, VCAPS, defaults); - MF_ENCODER(VIDEO, hevc, HEVC, venc_opts, VFMTS, VCAPS, defaults); -+MF_ENCODER(VIDEO, av1, AV1, venc_opts, VFMTS, VCAPS, defaults); -diff -Naur ffmpeg-7.1.2.old/libavcodec/mf_utils.c ffmpeg-7.1.2/libavcodec/mf_utils.c ---- ffmpeg-7.1.2.old/libavcodec/mf_utils.c 2025-10-27 10:07:00.467472915 +0100 -+++ ffmpeg-7.1.2/libavcodec/mf_utils.c 2025-10-27 10:07:02.458887429 +0100 -@@ -240,6 +240,7 @@ - GUID_ENTRY(MFMediaType_Video), - GUID_ENTRY(MFAudioFormat_PCM), - GUID_ENTRY(MFAudioFormat_Float), -+ GUID_ENTRY(ff_MFVideoFormat_AV1), - GUID_ENTRY(MFVideoFormat_H264), - GUID_ENTRY(MFVideoFormat_H264_ES), - GUID_ENTRY(ff_MFVideoFormat_HEVC), -@@ -507,6 +508,7 @@ - const CLSID *ff_codec_to_mf_subtype(enum AVCodecID codec) + res = ff_dovi_attach_side_data(&dav1d->dovi, frame); + if (res < 0) + return res; +diff -Naur ffmpeg-8.1.1.old/libavcodec/mfenc.c ffmpeg-8.1.1/libavcodec/mfenc.c +--- ffmpeg-8.1.1.old/libavcodec/mfenc.c 2026-05-22 09:46:43.392258318 +0200 ++++ ffmpeg-8.1.1/libavcodec/mfenc.c 2026-05-22 09:46:44.843013851 +0200 +@@ -904,6 +904,8 @@ + static int mf_encv_input_adjust(AVCodecContext *avctx, IMFMediaType *type) { - switch (codec) { -+ case AV_CODEC_ID_AV1: return &ff_MFVideoFormat_AV1; - case AV_CODEC_ID_H264: return &MFVideoFormat_H264; - case AV_CODEC_ID_HEVC: return &ff_MFVideoFormat_HEVC; - case AV_CODEC_ID_AC3: return &MFAudioFormat_Dolby_AC3; -diff -Naur ffmpeg-7.1.2.old/libavcodec/mf_utils.h ffmpeg-7.1.2/libavcodec/mf_utils.h ---- ffmpeg-7.1.2.old/libavcodec/mf_utils.h 2025-10-27 10:07:00.429472580 +0100 -+++ ffmpeg-7.1.2/libavcodec/mf_utils.h 2025-10-27 10:07:02.458955668 +0100 -@@ -113,6 +113,7 @@ + enum AVPixelFormat pix_fmt = ff_media_type_to_pix_fmt((IMFAttributes *)type); ++ AVRational framerate; ++ + if (avctx->pix_fmt == AV_PIX_FMT_D3D11) { + if (pix_fmt != AV_PIX_FMT_NV12 && pix_fmt != AV_PIX_FMT_D3D11) { + av_log(avctx, AV_LOG_ERROR, "unsupported input pixel format set\n"); +@@ -916,7 +918,16 @@ + } + } - DEFINE_MEDIATYPE_GUID(ff_MFVideoFormat_HEVC, 0x43564548); // FCC('HEVC') - DEFINE_MEDIATYPE_GUID(ff_MFVideoFormat_HEVC_ES, 0x53564548); // FCC('HEVS') -+DEFINE_MEDIATYPE_GUID(ff_MFVideoFormat_AV1, 0x31305641); // FCC('AV01') +- //ff_MFSetAttributeSize((IMFAttributes *)type, &MF_MT_FRAME_SIZE, avctx->width, avctx->height); ++ ff_MFSetAttributeSize((IMFAttributes *)type, &MF_MT_FRAME_SIZE, avctx->width, avctx->height); ++ IMFAttributes_SetUINT32(type, &MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); ++ ++ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) { ++ framerate = avctx->framerate; ++ } else { ++ framerate = av_inv_q(avctx->time_base); ++ } ++ ++ ff_MFSetAttributeRatio((IMFAttributes *)type, &MF_MT_FRAME_RATE, framerate.num, framerate.den); + return 0; + } +diff -Naur ffmpeg-8.1.1.old/libavcodec/nvenc.c ffmpeg-8.1.1/libavcodec/nvenc.c +--- ffmpeg-8.1.1.old/libavcodec/nvenc.c 2026-05-22 09:46:43.187256558 +0200 ++++ ffmpeg-8.1.1/libavcodec/nvenc.c 2026-05-22 09:46:44.844360889 +0200 +@@ -680,7 +680,9 @@ - // This enum is missing from mingw-w64's codecapi.h by v7.0.0. -diff -Naur ffmpeg-7.1.2.old/libavcodec/pgssubdec.c ffmpeg-7.1.2/libavcodec/pgssubdec.c ---- ffmpeg-7.1.2.old/libavcodec/pgssubdec.c 2025-10-27 10:07:00.318471601 +0100 -+++ ffmpeg-7.1.2/libavcodec/pgssubdec.c 2025-10-27 10:07:02.446191090 +0100 + #ifdef NVENC_HAVE_MVHEVC + ctx->multiview_supported = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_MVHEVC_ENCODE) > 0; +- if(ctx->profile == NV_ENC_HEVC_PROFILE_MULTIVIEW_MAIN && !ctx->multiview_supported) { ++ if (avctx->codec_id == AV_CODEC_ID_HEVC && ++ ctx->profile == NV_ENC_HEVC_PROFILE_MULTIVIEW_MAIN && ++ !ctx->multiview_supported) { + av_log(avctx, AV_LOG_WARNING, "Multiview not supported by the device\n"); + return AVERROR(ENOSYS); + } +diff -Naur ffmpeg-8.1.1.old/libavcodec/pgssubdec.c ffmpeg-8.1.1/libavcodec/pgssubdec.c +--- ffmpeg-8.1.1.old/libavcodec/pgssubdec.c 2026-05-22 09:46:43.249257090 +0200 ++++ ffmpeg-8.1.1/libavcodec/pgssubdec.c 2026-05-22 09:46:44.829747128 +0200 @@ -35,9 +35,11 @@ #include "libavutil/opt.h" @@ -1865,7 +707,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/pgssubdec.c ffmpeg-7.1.2/libavcodec/pgssu - PGSSubObjectRef *const object = &ctx->presentation.objects[i]; - - if (buf_end - buf < 8) { -- av_log(avctx, AV_LOG_ERROR, "Insufficent space for object\n"); +- av_log(avctx, AV_LOG_ERROR, "Insufficient space for object\n"); - ctx->presentation.object_count = i; - return AVERROR_INVALIDDATA; - } @@ -1895,7 +737,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/pgssubdec.c ffmpeg-7.1.2/libavcodec/pgssu - object->y = object->x = 0; - if (avctx->err_recognition & AV_EF_EXPLODE) { + if (buf_end - buf < 8) { -+ av_log(avctx, AV_LOG_ERROR, "Insufficent space for object\n"); ++ av_log(avctx, AV_LOG_ERROR, "Insufficient space for object\n"); + ctx->presentation.object_count = i; return AVERROR_INVALIDDATA; } @@ -2197,9 +1039,9 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/pgssubdec.c ffmpeg-7.1.2/libavcodec/pgssu break; case DISPLAY_SEGMENT: if (*got_sub_ptr) { -diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc_av1.c ffmpeg-7.1.2/libavcodec/qsvenc_av1.c ---- ffmpeg-7.1.2.old/libavcodec/qsvenc_av1.c 2025-10-27 10:07:00.531473480 +0100 -+++ ffmpeg-7.1.2/libavcodec/qsvenc_av1.c 2025-10-27 10:07:02.443863055 +0100 +diff -Naur ffmpeg-8.1.1.old/libavcodec/qsvenc_av1.c ffmpeg-8.1.1/libavcodec/qsvenc_av1.c +--- ffmpeg-8.1.1.old/libavcodec/qsvenc_av1.c 2026-05-22 09:46:43.398258370 +0200 ++++ ffmpeg-8.1.1/libavcodec/qsvenc_av1.c 2026-05-22 09:46:44.831983132 +0200 @@ -189,6 +189,10 @@ { "tile_cols", "Number of columns for tiled encoding", OFFSET(qsv.tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, { "tile_rows", "Number of rows for tiled encoding", OFFSET(qsv.tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, @@ -2211,10 +1053,10 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc_av1.c ffmpeg-7.1.2/libavcodec/qsve { NULL }, }; -diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c ---- ffmpeg-7.1.2.old/libavcodec/qsvenc.c 2025-10-27 10:07:00.592474018 +0100 -+++ ffmpeg-7.1.2/libavcodec/qsvenc.c 2025-10-27 10:07:02.443621469 +0100 -@@ -494,6 +494,9 @@ +diff -Naur ffmpeg-8.1.1.old/libavcodec/qsvenc.c ffmpeg-8.1.1/libavcodec/qsvenc.c +--- ffmpeg-8.1.1.old/libavcodec/qsvenc.c 2026-05-22 09:46:43.438258714 +0200 ++++ ffmpeg-8.1.1/libavcodec/qsvenc.c 2026-05-22 09:46:44.831729364 +0200 +@@ -492,6 +492,9 @@ mfxExtAV1BitstreamParam *av1_bs_param = (mfxExtAV1BitstreamParam *)coding_opts[1]; mfxExtCodingOption2 *co2 = (mfxExtCodingOption2*)coding_opts[2]; mfxExtCodingOption3 *co3 = (mfxExtCodingOption3*)coding_opts[3]; @@ -2224,7 +1066,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c av_log(avctx, AV_LOG_VERBOSE, "profile: %s; level: %"PRIu16"\n", print_profile(avctx->codec_id, info->CodecProfile), info->CodecLevel); -@@ -566,6 +569,13 @@ +@@ -564,6 +567,13 @@ print_threestate(av1_bs_param->WriteIVFHeaders)); av_log(avctx, AV_LOG_VERBOSE, "LowDelayBRC: %s\n", print_threestate(co3->LowDelayBRC)); av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d;\n", co2->MaxFrameSize); @@ -2238,7 +1080,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c } #endif -@@ -1282,6 +1292,28 @@ +@@ -1280,6 +1290,28 @@ } #endif @@ -2267,7 +1109,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c if (!check_enc_param(avctx,q)) { av_log(avctx, AV_LOG_ERROR, "some encoding parameters are not supported by the QSV " -@@ -1389,11 +1421,21 @@ +@@ -1387,11 +1419,21 @@ .Header.BufferSz = sizeof(co3), }; @@ -2289,7 +1131,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c }; if (!QSV_RUNTIME_VERSION_ATLEAST(q->ver, 2, 5)) { -@@ -1842,6 +1884,13 @@ +@@ -1840,6 +1882,13 @@ return ret; } @@ -2303,9 +1145,9 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.c ffmpeg-7.1.2/libavcodec/qsvenc.c q->avctx = avctx; return 0; -diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.h ffmpeg-7.1.2/libavcodec/qsvenc.h ---- ffmpeg-7.1.2.old/libavcodec/qsvenc.h 2025-10-27 10:07:00.282471283 +0100 -+++ ffmpeg-7.1.2/libavcodec/qsvenc.h 2025-10-27 10:07:02.443799916 +0100 +diff -Naur ffmpeg-8.1.1.old/libavcodec/qsvenc.h ffmpeg-8.1.1/libavcodec/qsvenc.h +--- ffmpeg-8.1.1.old/libavcodec/qsvenc.h 2026-05-22 09:46:43.217256815 +0200 ++++ ffmpeg-8.1.1/libavcodec/qsvenc.h 2026-05-22 09:46:44.831918190 +0200 @@ -38,6 +38,7 @@ #define QSV_HAVE_EXT_VP9_TILES QSV_VERSION_ATLEAST(1, 29) @@ -2338,157 +1180,10 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/qsvenc.h ffmpeg-7.1.2/libavcodec/qsvenc.h } QSVEncContext; int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q); -diff -Naur ffmpeg-7.1.2.old/libavcodec/videotoolbox_av1.c ffmpeg-7.1.2/libavcodec/videotoolbox_av1.c ---- ffmpeg-7.1.2.old/libavcodec/videotoolbox_av1.c 1970-01-01 01:00:00.000000000 +0100 -+++ ffmpeg-7.1.2/libavcodec/videotoolbox_av1.c 2025-10-27 10:07:02.455024552 +0100 -@@ -0,0 +1,105 @@ -+/* -+ * Videotoolbox hardware acceleration for AV1 -+ * Copyright (c) 2023 Jan Ekström -+ * Copyright (c) 2024 Ruslan Chernenko -+ * Copyright (c) 2024 Martin Storsjö -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include "libavutil/mem.h" -+ -+#include "av1dec.h" -+#include "hwaccel_internal.h" -+#include "internal.h" -+#include "vt_internal.h" -+ -+CFDataRef ff_videotoolbox_av1c_extradata_create(AVCodecContext *avctx) -+{ -+ AV1DecContext *s = avctx->priv_data; -+ uint8_t *buf; -+ CFDataRef data; -+ if (!s->raw_seq) -+ return NULL; -+ -+ buf = av_malloc(s->seq_data_ref->size + 4); -+ if (!buf) -+ return NULL; -+ buf[0] = 0x81; // version and marker (constant) -+ buf[1] = s->raw_seq->seq_profile << 5 | s->raw_seq->seq_level_idx[0]; -+ buf[2] = s->raw_seq->seq_tier[0] << 7 | -+ s->raw_seq->color_config.high_bitdepth << 6 | -+ s->raw_seq->color_config.twelve_bit << 5 | -+ s->raw_seq->color_config.mono_chrome << 4 | -+ s->raw_seq->color_config.subsampling_x << 3 | -+ s->raw_seq->color_config.subsampling_y << 2 | -+ s->raw_seq->color_config.chroma_sample_position; -+ -+ if (s->raw_seq->initial_display_delay_present_flag) -+ buf[3] = 0 << 5 | -+ s->raw_seq->initial_display_delay_present_flag << 4 | -+ s->raw_seq->initial_display_delay_minus_1[0]; -+ else -+ buf[3] = 0x00; -+ memcpy(buf + 4, s->seq_data_ref->data, s->seq_data_ref->size); -+ data = CFDataCreate(kCFAllocatorDefault, buf, s->seq_data_ref->size + 4); -+ av_free(buf); -+ return data; -+}; -+ -+ -+static int videotoolbox_av1_start_frame(AVCodecContext *avctx, -+ const uint8_t *buffer, -+ uint32_t size) -+{ -+ return 0; -+} -+ -+static int videotoolbox_av1_decode_slice(AVCodecContext *avctx, -+ const uint8_t *buffer, -+ uint32_t size) -+{ -+ return 0; -+} -+ -+static int videotoolbox_av1_end_frame(AVCodecContext *avctx) -+{ -+ const AV1DecContext *s = avctx->priv_data; -+ VTContext *vtctx = avctx->internal->hwaccel_priv_data; -+ AVFrame *frame = s->cur_frame.f; -+ -+ vtctx->bitstream_size = 0; -+ for (int i = s->start_unit; i < s->nb_unit; i++) -+ ff_videotoolbox_buffer_append(vtctx, s->current_obu.units[i].data, -+ s->current_obu.units[i].data_size); -+ return ff_videotoolbox_common_end_frame(avctx, frame); -+} -+ -+const FFHWAccel ff_av1_videotoolbox_hwaccel = { -+ .p.name = "av1_videotoolbox", -+ .p.type = AVMEDIA_TYPE_VIDEO, -+ .p.id = AV_CODEC_ID_AV1, -+ .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, -+ .alloc_frame = ff_videotoolbox_alloc_frame, -+ .start_frame = videotoolbox_av1_start_frame, -+ .decode_slice = videotoolbox_av1_decode_slice, -+ .end_frame = videotoolbox_av1_end_frame, -+ .frame_params = ff_videotoolbox_frame_params, -+ .init = ff_videotoolbox_common_init, -+ .uninit = ff_videotoolbox_uninit, -+ .priv_data_size = sizeof(VTContext), -+}; -diff -Naur ffmpeg-7.1.2.old/libavcodec/videotoolbox.c ffmpeg-7.1.2/libavcodec/videotoolbox.c ---- ffmpeg-7.1.2.old/libavcodec/videotoolbox.c 2025-10-27 10:07:00.379472139 +0100 -+++ ffmpeg-7.1.2/libavcodec/videotoolbox.c 2025-10-27 10:07:02.456490466 +0100 -@@ -56,6 +56,10 @@ - enum { kCMVideoCodecType_VP9 = 'vp09' }; - #endif - -+#if !HAVE_KCMVIDEOCODECTYPE_AV1 -+enum { kCMVideoCodecType_AV1 = 'av01' }; -+#endif -+ - #define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING 12 - - typedef struct VTHWFrame { -@@ -92,6 +96,26 @@ - return 0; - } - -+int ff_videotoolbox_buffer_append(VTContext *vtctx, -+ const uint8_t *buffer, -+ uint32_t size) -+{ -+ void *tmp; -+ -+ tmp = av_fast_realloc(vtctx->bitstream, -+ &vtctx->allocated_size, -+ vtctx->bitstream_size + size); -+ -+ if (!tmp) -+ return AVERROR(ENOMEM); -+ -+ vtctx->bitstream = tmp; -+ memcpy(vtctx->bitstream + vtctx->bitstream_size, buffer, size); -+ vtctx->bitstream_size += size; -+ -+ return 0; -+} -+ - static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame) - { - int ret; -@@ -108,9 +132,6 @@ +diff -Naur ffmpeg-8.1.1.old/libavcodec/videotoolbox.c ffmpeg-8.1.1/libavcodec/videotoolbox.c +--- ffmpeg-8.1.1.old/libavcodec/videotoolbox.c 2026-05-22 09:46:43.289257434 +0200 ++++ ffmpeg-8.1.1/libavcodec/videotoolbox.c 2026-05-22 09:46:44.834914447 +0200 +@@ -132,9 +132,6 @@ frame->crop_top = 0; frame->crop_bottom = 0; @@ -2498,7 +1193,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/videotoolbox.c ffmpeg-7.1.2/libavcodec/vi frame->data[3] = (uint8_t*)ref->pixbuf; if (ref->hw_frames_ctx) { -@@ -790,7 +811,7 @@ +@@ -820,7 +817,7 @@ #if TARGET_OS_IPHONE CFDictionarySetValue(buffer_attributes, kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue); #else @@ -2507,28 +1202,7 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/videotoolbox.c ffmpeg-7.1.2/libavcodec/vi #endif CFRelease(io_surface_properties); -@@ -847,6 +868,13 @@ - CFDictionarySetValue(avc_info, CFSTR("vpcC"), data); - break; - #endif -+#if CONFIG_AV1_VIDEOTOOLBOX_HWACCEL -+ case kCMVideoCodecType_AV1 : -+ data = ff_videotoolbox_av1c_extradata_create(avctx); -+ if (data) -+ CFDictionarySetValue(avc_info, CFSTR("av1C"), data); -+ break; -+#endif - default: - break; - } -@@ -912,10 +940,30 @@ - case AV_CODEC_ID_VP9 : - videotoolbox->cm_codec_type = kCMVideoCodecType_VP9; - break; -+ case AV_CODEC_ID_AV1 : -+ videotoolbox->cm_codec_type = kCMVideoCodecType_AV1; -+ break; - default : +@@ -956,6 +953,23 @@ break; } @@ -2552,30 +1226,9 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/videotoolbox.c ffmpeg-7.1.2/libavcodec/vi #if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && AV_HAS_BUILTIN(__builtin_available) if (avctx->codec_id == AV_CODEC_ID_PRORES) { if (__builtin_available(macOS 10.9, *)) { -diff -Naur ffmpeg-7.1.2.old/libavcodec/vt_internal.h ffmpeg-7.1.2/libavcodec/vt_internal.h ---- ffmpeg-7.1.2.old/libavcodec/vt_internal.h 2025-10-27 10:07:00.531473480 +0100 -+++ ffmpeg-7.1.2/libavcodec/vt_internal.h 2025-10-27 10:07:02.455086969 +0100 -@@ -56,6 +56,9 @@ - int ff_videotoolbox_buffer_copy(VTContext *vtctx, - const uint8_t *buffer, - uint32_t size); -+int ff_videotoolbox_buffer_append(VTContext *vtctx, -+ const uint8_t *buffer, -+ uint32_t size); - int ff_videotoolbox_uninit(AVCodecContext *avctx); - int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx, - const uint8_t *buffer, -@@ -64,6 +67,7 @@ - const uint8_t *buffer, - uint32_t size); - int ff_videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame); -+CFDataRef ff_videotoolbox_av1c_extradata_create(AVCodecContext *avctx); - CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx); - CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx); - CFDataRef ff_videotoolbox_vpcc_extradata_create(AVCodecContext *avctx); -diff -Naur ffmpeg-7.1.2.old/libavfilter/vf_vpp_qsv.c ffmpeg-7.1.2/libavfilter/vf_vpp_qsv.c ---- ffmpeg-7.1.2.old/libavfilter/vf_vpp_qsv.c 2025-10-27 10:07:00.764475536 +0100 -+++ ffmpeg-7.1.2/libavfilter/vf_vpp_qsv.c 2025-10-27 10:07:02.461658339 +0100 +diff -Naur ffmpeg-8.1.1.old/libavfilter/vf_vpp_qsv.c ffmpeg-8.1.1/libavfilter/vf_vpp_qsv.c +--- ffmpeg-8.1.1.old/libavfilter/vf_vpp_qsv.c 2026-05-22 09:46:43.549259667 +0200 ++++ ffmpeg-8.1.1/libavfilter/vf_vpp_qsv.c 2026-05-22 09:46:44.833281760 +0200 @@ -494,9 +494,9 @@ outvsi_conf.Header.BufferId = MFX_EXTBUFF_VIDEO_SIGNAL_INFO_OUT; outvsi_conf.Header.BufferSz = sizeof(mfxExtVideoSignalInfo); @@ -2589,10 +1242,10 @@ diff -Naur ffmpeg-7.1.2.old/libavfilter/vf_vpp_qsv.c ffmpeg-7.1.2/libavfilter/vf outvsi_conf.ColourDescriptionPresent = 1; if (memcmp(&vpp->invsi_conf, &invsi_conf, sizeof(mfxExtVideoSignalInfo)) || -diff -Naur ffmpeg-7.1.2.old/libavformat/isom.h ffmpeg-7.1.2/libavformat/isom.h ---- ffmpeg-7.1.2.old/libavformat/isom.h 2025-10-27 10:07:00.909476815 +0100 -+++ ffmpeg-7.1.2/libavformat/isom.h 2025-10-27 10:07:02.422783282 +0100 -@@ -272,6 +272,9 @@ +diff -Naur ffmpeg-8.1.1.old/libavformat/isom.h ffmpeg-8.1.1/libavformat/isom.h +--- ffmpeg-8.1.1.old/libavformat/isom.h 2026-05-22 09:46:43.642260465 +0200 ++++ ffmpeg-8.1.1/libavformat/isom.h 2026-05-22 09:46:44.813590520 +0200 +@@ -282,6 +282,9 @@ MOVEncryptionIndex *encryption_index; } cenc; @@ -2600,12 +1253,12 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/isom.h ffmpeg-7.1.2/libavformat/isom.h + int fallback; + struct IAMFDemuxContext *iamf; + int iamf_stream_offset; } MOVStreamContext; - -diff -Naur ffmpeg-7.1.2.old/libavformat/matroskaenc.c ffmpeg-7.1.2/libavformat/matroskaenc.c ---- ffmpeg-7.1.2.old/libavformat/matroskaenc.c 2025-10-27 10:07:00.955477221 +0100 -+++ ffmpeg-7.1.2/libavformat/matroskaenc.c 2025-10-27 10:07:02.430490236 +0100 -@@ -2933,6 +2933,16 @@ +diff -Naur ffmpeg-8.1.1.old/libavformat/matroskaenc.c ffmpeg-8.1.1/libavformat/matroskaenc.c +--- ffmpeg-8.1.1.old/libavformat/matroskaenc.c 2026-05-22 09:46:43.671260715 +0200 ++++ ffmpeg-8.1.1/libavformat/matroskaenc.c 2026-05-22 09:46:44.826961178 +0200 +@@ -2994,6 +2994,16 @@ case AV_CODEC_ID_AAC: if (side_data_size && mkv->track.bc) { int output_sample_rate = 0; @@ -2622,10 +1275,10 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/matroskaenc.c ffmpeg-7.1.2/libavformat/m ret = get_aac_sample_rates(s, mkv, side_data, side_data_size, &track->sample_rate, &output_sample_rate); if (ret < 0) -diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c ---- ffmpeg-7.1.2.old/libavformat/mov.c 2025-10-27 10:07:00.889476639 +0100 -+++ ffmpeg-7.1.2/libavformat/mov.c 2025-10-27 10:07:02.447584145 +0100 -@@ -56,6 +56,7 @@ +diff -Naur ffmpeg-8.1.1.old/libavformat/mov.c ffmpeg-8.1.1/libavformat/mov.c +--- ffmpeg-8.1.1.old/libavformat/mov.c 2026-05-22 09:46:43.629260354 +0200 ++++ ffmpeg-8.1.1/libavformat/mov.c 2026-05-22 09:46:44.816270549 +0200 +@@ -57,6 +57,7 @@ #include "libavcodec/mpegaudiodecheader.h" #include "libavcodec/mlp_parse.h" #include "avformat.h" @@ -2741,15 +1394,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) { char tmp_key[AV_FOURCC_MAX_STRING_SIZE] = {0}; -@@ -354,6 +449,7 @@ - int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL; - int raw = 0; - int num = 0; -+ AVDictionary *metadata; - - switch (atom.type) { - case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break; -@@ -364,35 +460,71 @@ +@@ -370,36 +465,71 @@ case MKTAG( 'a','k','I','D'): key = "account_type"; parse = mov_metadata_int8_no_padding; break; case MKTAG( 'a','p','I','D'): key = "account_id"; break; @@ -2806,6 +1451,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c return mov_metadata_loci(c, pb, atom.size); case MKTAG( 'm','a','n','u'): key = "make"; break; case MKTAG( 'm','o','d','l'): key = "model"; break; +- case MKTAG( 'n','a','m','e'): key = "name"; break; + case MKTAG( 'n','a','m','e'): key = "title"; raw = 1; break; case MKTAG( 'p','c','s','t'): key = "podcast"; parse = mov_metadata_int8_no_padding; break; @@ -2824,7 +1470,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c case MKTAG( 's','o','a','a'): key = "sort_album_artist"; break; case MKTAG( 's','o','a','l'): key = "sort_album"; break; case MKTAG( 's','o','a','r'): key = "sort_artist"; break; -@@ -401,6 +533,8 @@ +@@ -408,6 +538,8 @@ case MKTAG( 's','o','s','n'): key = "sort_show"; break; case MKTAG( 's','t','i','k'): key = "media_type"; parse = mov_metadata_int8_no_padding; break; @@ -2833,7 +1479,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c case MKTAG( 't','r','k','n'): key = "track"; parse = mov_metadata_track_or_disc_number; break; case MKTAG( 't','v','e','n'): key = "episode_id"; break; -@@ -410,17 +544,23 @@ +@@ -417,17 +549,23 @@ case MKTAG( 't','v','s','h'): key = "show"; break; case MKTAG( 't','v','s','n'): key = "season_number"; parse = mov_metadata_int8_bypass_padding; break; @@ -2858,7 +1504,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c case MKTAG(0xa9,'e','d','1'): key = "edit_date"; break; case MKTAG(0xa9,'e','n','c'): key = "encoder"; break; case MKTAG(0xa9,'f','m','t'): key = "original_format"; break; -@@ -428,23 +568,45 @@ +@@ -435,23 +573,45 @@ case MKTAG(0xa9,'g','r','p'): key = "grouping"; break; case MKTAG(0xa9,'h','s','t'): key = "host_computer"; break; case MKTAG(0xa9,'i','n','f'): key = "comment"; break; @@ -2904,40 +1550,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c } retry: if (c->itunes_metadata && atom.size > 8) { -@@ -571,17 +733,23 @@ - } - str[str_size] = 0; - } -- c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED; -- av_dict_set(&c->fc->metadata, key, str, 0); -+ if (c->trak_index < 0) { -+ metadata = c->fc->metadata; -+ c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED; -+ if (!strcmp(key, "encoder")) { -+ int major, minor, micro; -+ if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, µ) == 3) { -+ c->handbrake_version = 1000000*major + 1000*minor + micro; -+ } -+ } -+ } -+ else { -+ metadata = c->fc->streams[c->trak_index]->metadata; -+ } -+ av_dict_set(&metadata, key, str, 0); - if (*language && strcmp(language, "und")) { - snprintf(key2, sizeof(key2), "%s-%s", key, language); -- av_dict_set(&c->fc->metadata, key2, str, 0); -- } -- if (!strcmp(key, "encoder")) { -- int major, minor, micro; -- if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, µ) == 3) { -- c->handbrake_version = 1000000*major + 1000*minor + micro; -- } -+ av_dict_set(&metadata, key2, str, 0); - } - } - -@@ -9088,6 +9256,23 @@ +@@ -9514,6 +9674,22 @@ return ret; } @@ -2956,12 +1569,11 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c + + return 0; +} -+ + static const MOVParseTableEntry mov_default_parse_table[] = { { MKTAG('A','C','L','R'), mov_read_aclr }, { MKTAG('A','P','R','G'), mov_read_avid }, -@@ -9190,6 +9375,7 @@ +@@ -9616,6 +9792,7 @@ { MKTAG('v','p','c','C'), mov_read_vpcc }, { MKTAG('m','d','c','v'), mov_read_mdcv }, { MKTAG('c','l','l','i'), mov_read_clli }, @@ -2969,7 +1581,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c { MKTAG('d','v','c','C'), mov_read_dvcc_dvvc }, { MKTAG('d','v','v','C'), mov_read_dvcc_dvvc }, { MKTAG('d','v','w','C'), mov_read_dvcc_dvvc }, -@@ -10374,6 +10560,23 @@ +@@ -11071,6 +11248,23 @@ err = ff_replaygain_export(st, s->metadata); if (err < 0) return err; @@ -2979,9 +1591,9 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c + AVPacketSideData *sd; + int *fallback; + sd = av_packet_side_data_new(&st->codecpar->coded_side_data, -+ &st->codecpar->nb_coded_side_data, -+ AV_PKT_DATA_FALLBACK_TRACK, -+ sizeof(int), 0); ++ &st->codecpar->nb_coded_side_data, ++ AV_PKT_DATA_FALLBACK_TRACK, ++ sizeof(int), 0); + if (!sd) + return AVERROR(ENOMEM); + fallback = (int*)sd->data; @@ -2993,9 +1605,9 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/mov.c ffmpeg-7.1.2/libavformat/mov.c break; case AVMEDIA_TYPE_VIDEO: if (sc->display_matrix) { -diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc.c ---- ffmpeg-7.1.2.old/libavformat/movenc.c 2025-10-27 10:07:00.933477027 +0100 -+++ ffmpeg-7.1.2/libavformat/movenc.c 2025-10-27 10:07:02.463726465 +0100 +diff -Naur ffmpeg-8.1.1.old/libavformat/movenc.c ffmpeg-8.1.1/libavformat/movenc.c +--- ffmpeg-8.1.1.old/libavformat/movenc.c 2026-05-22 09:46:43.657260595 +0200 ++++ ffmpeg-8.1.1/libavformat/movenc.c 2026-05-22 09:46:44.845270798 +0200 @@ -28,6 +28,7 @@ #include "movenc.h" @@ -3004,78 +1616,39 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc #include "avio_internal.h" #include "dovi_isom.h" #include "riff.h" -@@ -393,6 +394,8 @@ - uint16_t chan_loc; - /* if there is no dependent substream, then one bit reserved instead */ - } substream[1]; /* TODO: support 8 independent substreams */ -+ /* indicates the decoding complexity, 8 bits */ -+ uint8_t complexity_index_type_a; - }; +@@ -1001,6 +1002,15 @@ + if (track->multichannel_as_mono) + return 0; - static int mov_write_ac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track) -@@ -474,6 +477,8 @@ - info->data_rate = FFMAX(info->data_rate, hdr->bit_rate / 1000); - info->ac3_bit_rate_code = FFMAX(info->ac3_bit_rate_code, - hdr->ac3_bit_rate_code); -+ info->complexity_index_type_a = hdr->complexity_index_type_a; -+ - num_blocks = hdr->num_blocks; - - if (!info->ec3_done) { -@@ -532,8 +537,6 @@ - int parent = hdr->substreamid; - - while (cumul_size != pkt->size) { -- GetBitContext gbc; -- int i; - ret = avpriv_ac3_parse_header(&hdr, pkt->data + cumul_size, pkt->size - cumul_size); - if (ret < 0) - goto end; -@@ -544,20 +547,9 @@ - info->substream[parent].num_dep_sub++; - ret /= 8; - -- /* header is parsed up to lfeon, but custom channel map may be needed */ -- init_get_bits8(&gbc, pkt->data + cumul_size + ret, pkt->size - cumul_size - ret); -- /* skip bsid */ -- skip_bits(&gbc, 5); -- /* skip volume control params */ -- for (i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { -- skip_bits(&gbc, 5); // skip dialog normalization -- if (get_bits1(&gbc)) { -- skip_bits(&gbc, 8); // skip compression gain word -- } -- } - /* get the dependent stream channel map, if exists */ -- if (get_bits1(&gbc)) -- info->substream[parent].chan_loc |= (get_bits(&gbc, 16) >> 5) & 0x1f; -+ if (hdr->channel_map_present) -+ info->substream[parent].chan_loc |= (hdr->channel_map >> 5) & 0x1f; - else - info->substream[parent].chan_loc |= hdr->channel_mode; - cumul_size += hdr->frame_size; -@@ -614,7 +606,7 @@ - } - - info = track->eac3_priv; -- size = 2 + ((32 * (info->num_ind_sub + 1) + 7) >> 3); -+ size = 2 + (4 * (info->num_ind_sub + 1)) + (2 * !!info->complexity_index_type_a); - buf = av_malloc(size); - if (!buf) { - return AVERROR(ENOMEM); -@@ -639,6 +631,11 @@ - put_bits(&pbc, 9, info->substream[i].chan_loc); - } - } -+ if (info->complexity_index_type_a) { -+ put_bits(&pbc, 7, 0); /* reserved */ -+ put_bits(&pbc, 1, 1); // flag_eac3_extension_type_a -+ put_bits(&pbc, 8, info->complexity_index_type_a); ++ // Custom channels layout is not handled properly for these formats ++ // unset it for now, it will fallback to the layout stored in the extradata ++ // TODO: find the reason ++ if (track->par->codec_id == AV_CODEC_ID_AAC || ++ track->par->codec_id == AV_CODEC_ID_ALAC) ++ { ++ return 0; + } - flush_put_bits(&pbc); - size = put_bytes_output(&pbc); ++ + ret = ff_mov_get_channel_layout_tag(track->par, &layout_tag, + &bitmap, &channel_desc); -@@ -4055,6 +4052,41 @@ +@@ -1373,11 +1383,13 @@ + int64_t pos = avio_tell(pb); + int version = 0; + uint32_t tag = track->tag; ++ int lpcm_flags = 0; + int ret = 0; + + if (track->mode == MODE_MOV) { +- if (track->timescale > UINT16_MAX || !track->par->ch_layout.nb_channels) { +- if (mov_get_lpcm_flags(track->par->codec_id)) ++ lpcm_flags = mov_get_lpcm_flags(track->par->codec_id); ++ if (track->timescale > UINT16_MAX || track->par->ch_layout.nb_channels > 2 || lpcm_flags) { ++ if (lpcm_flags) + tag = AV_RL32("lpcm"); + version = 2; + } else if (track->audio_vbr || mov_pcm_le_gt16(track->par->codec_id) || +@@ -4244,6 +4256,41 @@ return len + 24; } @@ -3117,7 +1690,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc static int mov_write_track_metadata(AVIOContext *pb, AVStream *st, const char *tag, const char *str) { -@@ -4129,8 +4161,23 @@ +@@ -4318,8 +4365,23 @@ if (ret < 0) return ret; @@ -3142,7 +1715,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc if (mov->mode & MODE_MP4) { if ((ret = mov_write_track_kinds(pb_buf, st)) < 0) -@@ -4505,20 +4552,66 @@ +@@ -4694,20 +4756,66 @@ return size; } @@ -3212,7 +1785,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc avio_wb32(pb, size); ffio_wfourcc(pb, name); -@@ -4526,7 +4619,9 @@ +@@ -4715,7 +4823,9 @@ ffio_wfourcc(pb, "data"); avio_wb32(pb, 0x15); avio_wb32(pb, 0); @@ -3223,7 +1796,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc else avio_w8 (pb, num); return size; -@@ -4582,6 +4677,8 @@ +@@ -4771,6 +4881,8 @@ mov_write_string_metadata(s, pb, "\251lyr", "lyrics" , 1); mov_write_string_metadata(s, pb, "desc", "description",1); mov_write_string_metadata(s, pb, "ldes", "synopsis" , 1); @@ -3232,7 +1805,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc mov_write_string_metadata(s, pb, "tvsh", "show" , 1); mov_write_string_metadata(s, pb, "tven", "episode_id",1); mov_write_string_metadata(s, pb, "tvnn", "network" , 1); -@@ -4592,10 +4689,67 @@ +@@ -4781,10 +4893,67 @@ mov_write_int8_metadata (s, pb, "hdvd", "hd_video", 1); mov_write_int8_metadata (s, pb, "pgap", "gapless_playback",1); mov_write_int8_metadata (s, pb, "cpil", "compilation", 1); @@ -3300,7 +1873,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc return update_size(pb, pos); } -@@ -4727,35 +4881,6 @@ +@@ -4916,35 +5085,6 @@ return 0; } @@ -3336,7 +1909,7 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s) { int64_t pos = avio_tell(pb); -@@ -4794,14 +4919,14 @@ +@@ -4983,14 +5123,14 @@ return ret; if (mov->mode & MODE_3GP) { @@ -3359,20 +1932,26 @@ diff -Naur ffmpeg-7.1.2.old/libavformat/movenc.c ffmpeg-7.1.2/libavformat/movenc mov_write_loci_tag(s, pb_buf); } else if (mov->mode == MODE_MOV && !(mov->flags & FF_MOV_FLAG_USE_MDTA)) { // the title field breaks gtkpod with mp4 and my suspicion is that stuff is not valid in mp4 mov_write_string_metadata(s, pb_buf, "\251ART", "artist", 0); -diff -Naur ffmpeg-7.1.2.old/libavutil/frame.c ffmpeg-7.1.2/libavutil/frame.c ---- ffmpeg-7.1.2.old/libavutil/frame.c 2025-10-27 10:07:00.804475889 +0100 -+++ ffmpeg-7.1.2/libavutil/frame.c 2025-10-27 10:07:02.436386459 +0100 -@@ -45,6 +45,7 @@ - [AV_FRAME_DATA_FILM_GRAIN_PARAMS] = { "Film grain parameters" }, - [AV_FRAME_DATA_DETECTION_BBOXES] = { "Bounding boxes for object detection and classification" }, - [AV_FRAME_DATA_DOVI_RPU_BUFFER] = { "Dolby Vision RPU Data" }, -+ [AV_FRAME_DATA_DOVI_RPU_BUFFER_T35] = { "Dolby Vision RPU ITU T35 Data" }, - [AV_FRAME_DATA_DOVI_METADATA] = { "Dolby Vision Metadata" }, - [AV_FRAME_DATA_LCEVC] = { "LCEVC NAL data" }, - [AV_FRAME_DATA_VIEW_ID] = { "View ID" }, -diff -Naur ffmpeg-7.1.2.old/libavutil/frame.h ffmpeg-7.1.2/libavutil/frame.h ---- ffmpeg-7.1.2.old/libavutil/frame.h 2025-10-27 10:07:00.786475730 +0100 -+++ ffmpeg-7.1.2/libavutil/frame.h 2025-10-27 10:07:02.436480126 +0100 +@@ -7542,6 +7682,7 @@ + track->tag = MKTAG('t','e','x','t'); + track->timescale = mov->movie_timescale; + track->par = avcodec_parameters_alloc(); ++ track->language = mov->tracks[0].language; + if (!track->par) + return AVERROR(ENOMEM); + track->par->codec_type = AVMEDIA_TYPE_SUBTITLE; +@@ -7779,7 +7920,7 @@ + int i, width = 720, height = 480; + int have_palette = 0, have_size = 0; + uint32_t palette[16]; +- char *cur = track->extradata[track->last_stsd_index]; ++ char *cur = st->codecpar->extradata; + + while (cur && *cur) { + if (strncmp("palette:", cur, 8) == 0) { +diff -Naur ffmpeg-8.1.1.old/libavutil/frame.h ffmpeg-8.1.1/libavutil/frame.h +--- ffmpeg-8.1.1.old/libavutil/frame.h 2026-05-22 09:46:43.563259787 +0200 ++++ ffmpeg-8.1.1/libavutil/frame.h 2026-05-22 09:46:44.828225461 +0200 @@ -201,6 +201,12 @@ AV_FRAME_DATA_DOVI_RPU_BUFFER, @@ -3386,10 +1965,81 @@ diff -Naur ffmpeg-7.1.2.old/libavutil/frame.h ffmpeg-7.1.2/libavutil/frame.h * Parsed Dolby Vision metadata, suitable for passing to a software * implementation. The payload is the AVDOVIMetadata struct defined in * libavutil/dovi_meta.h. -diff -Naur ffmpeg-7.1.2.old/libavutil/hwcontext_videotoolbox.c ffmpeg-7.1.2/libavutil/hwcontext_videotoolbox.c ---- ffmpeg-7.1.2.old/libavutil/hwcontext_videotoolbox.c 2025-10-27 10:07:00.813475968 +0100 -+++ ffmpeg-7.1.2/libavutil/hwcontext_videotoolbox.c 2025-10-27 10:07:02.457067390 +0100 -@@ -183,7 +183,8 @@ +diff -Naur ffmpeg-8.1.1.old/libavutil/hwcontext_d3d11va.c ffmpeg-8.1.1/libavutil/hwcontext_d3d11va.c +--- ffmpeg-8.1.1.old/libavutil/hwcontext_d3d11va.c 2026-05-22 09:46:43.580605581 +0200 ++++ ffmpeg-8.1.1/libavutil/hwcontext_d3d11va.c 2026-05-22 09:46:44.836668492 +0200 +@@ -85,6 +85,9 @@ + int nb_surfaces; + int nb_surfaces_used; + ++ int max_retries; ++ int retries; ++ + DXGI_FORMAT format; + + ID3D11Texture2D *staging_texture; +@@ -260,7 +263,9 @@ + ID3D11Texture2D_GetDesc(hwctx->texture, &texDesc); + + if (s->nb_surfaces_used >= texDesc.ArraySize) { +- av_log(ctx, AV_LOG_ERROR, "Static surface pool size exceeded.\n"); ++ if (s->retries >= s->max_retries) { ++ av_log(ctx, AV_LOG_ERROR, "Static surface pool size exceeded.\n"); ++ } + return NULL; + } + +@@ -346,20 +351,34 @@ + static int d3d11va_get_buffer(AVHWFramesContext *ctx, AVFrame *frame) + { + AVD3D11FrameDescriptor *desc; ++ D3D11VAFramesContext *s = ctx->hwctx; ++ s->retries = 0; ++ s->max_retries = 50; + +- frame->buf[0] = av_buffer_pool_get(ctx->pool); +- if (!frame->buf[0]) +- return AVERROR(ENOMEM); +- +- desc = (AVD3D11FrameDescriptor *)frame->buf[0]->data; +- +- frame->data[0] = (uint8_t *)desc->texture; +- frame->data[1] = (uint8_t *)desc->index; +- frame->format = AV_PIX_FMT_D3D11; +- frame->width = ctx->width; +- frame->height = ctx->height; ++ /** ++ * Loop until a buffer becomes available from the pool. ++ * In a full hardware pipeline, all buffers may be temporarily in use by ++ * other modules (encoder/filter/decoder). Rather than immediately failing ++ * with ENOMEM, we wait for a buffer to be released back to the pool, which ++ * maintains pipeline flow and prevents unnecessary allocation failures ++ * during normal operation. ++ */ ++ while (s->retries < s->max_retries) { ++ frame->buf[0] = av_buffer_pool_get(ctx->pool); ++ if (frame->buf[0]) { ++ desc = (AVD3D11FrameDescriptor *)frame->buf[0]->data; ++ frame->data[0] = (uint8_t *)desc->texture; ++ frame->data[1] = (uint8_t *)desc->index; ++ frame->format = AV_PIX_FMT_D3D11; ++ frame->width = ctx->width; ++ frame->height = ctx->height; ++ return 0; ++ } + +- return 0; ++ av_usleep(1000); ++ } ++ ++ return AVERROR(ENOMEM); + } + + static int d3d11va_transfer_get_formats(AVHWFramesContext *ctx, +diff -Naur ffmpeg-8.1.1.old/libavutil/hwcontext_videotoolbox.c ffmpeg-8.1.1/libavutil/hwcontext_videotoolbox.c +--- ffmpeg-8.1.1.old/libavutil/hwcontext_videotoolbox.c 2026-05-22 09:46:43.581259942 +0200 ++++ ffmpeg-8.1.1/libavutil/hwcontext_videotoolbox.c 2026-05-22 09:46:44.835041707 +0200 +@@ -191,7 +191,8 @@ VTFramesContext *fctx = ctx->hwctx; AVVTFramesContext *hw_ctx = &fctx->p; CVReturn err; @@ -3399,7 +2049,7 @@ diff -Naur ffmpeg-7.1.2.old/libavutil/hwcontext_videotoolbox.c ffmpeg-7.1.2/liba uint32_t cv_pixfmt; CFMutableDictionaryRef attributes, iosurface_properties; -@@ -216,6 +217,15 @@ +@@ -224,6 +225,15 @@ CFRelease(w); CFRelease(h); @@ -3415,27 +2065,14 @@ diff -Naur ffmpeg-7.1.2.old/libavutil/hwcontext_videotoolbox.c ffmpeg-7.1.2/liba err = CVPixelBufferPoolCreate( NULL, NULL, -diff -Naur ffmpeg-7.1.2.old/libswscale/swscale_unscaled.c ffmpeg-7.1.2/libswscale/swscale_unscaled.c ---- ffmpeg-7.1.2.old/libswscale/swscale_unscaled.c 2025-10-27 10:07:00.644474477 +0100 -+++ ffmpeg-7.1.2/libswscale/swscale_unscaled.c 2025-10-27 10:07:02.433490262 +0100 -@@ -341,7 +341,7 @@ - const uint8_t *tsrc0 = src[0]; - for (x = c->srcW; x > 0; x--) { - t = *tsrc0++; -- output_pixel(tdstY++, t | (t << 8)); -+ output_pixel(tdstY++, (t << 8)); - } - src[0] += srcStride[0]; - dstY += dstStride[0] / 2; -@@ -352,9 +352,9 @@ - const uint8_t *tsrc2 = src[2]; - for (x = c->srcW / 2; x > 0; x--) { - t = *tsrc1++; -- output_pixel(tdstUV++, t | (t << 8)); -+ output_pixel(tdstUV++, (t << 8)); - t = *tsrc2++; -- output_pixel(tdstUV++, t | (t << 8)); -+ output_pixel(tdstUV++, (t << 8)); - } - src[1] += srcStride[1]; - src[2] += srcStride[2]; +diff -Naur ffmpeg-8.1.1.old/libavutil/side_data.c ffmpeg-8.1.1/libavutil/side_data.c +--- ffmpeg-8.1.1.old/libavutil/side_data.c 2026-05-22 09:46:43.561259770 +0200 ++++ ffmpeg-8.1.1/libavutil/side_data.c 2026-05-22 09:46:44.828308077 +0200 +@@ -42,6 +42,7 @@ + [AV_FRAME_DATA_DETECTION_BBOXES] = { "Bounding boxes for object detection and classification", AV_SIDE_DATA_PROP_SIZE_DEPENDENT }, + [AV_FRAME_DATA_DOVI_RPU_BUFFER] = { "Dolby Vision RPU Data", AV_SIDE_DATA_PROP_COLOR_DEPENDENT }, + [AV_FRAME_DATA_DOVI_METADATA] = { "Dolby Vision Metadata", AV_SIDE_DATA_PROP_COLOR_DEPENDENT }, ++ [AV_FRAME_DATA_DOVI_RPU_BUFFER_T35] = { "Dolby Vision RPU ITU T35 Data", AV_SIDE_DATA_PROP_COLOR_DEPENDENT }, + [AV_FRAME_DATA_LCEVC] = { "LCEVC NAL data", AV_SIDE_DATA_PROP_SIZE_DEPENDENT }, + [AV_FRAME_DATA_VIEW_ID] = { "View ID" }, + [AV_FRAME_DATA_STEREO3D] = { "Stereo 3D", AV_SIDE_DATA_PROP_GLOBAL }, diff --git a/anda/multimedia/ffmpeg/ffmpeg-LCEVCdec-4.patch b/anda/multimedia/ffmpeg/ffmpeg-LCEVCdec-4.patch deleted file mode 100644 index ae0aa51e88..0000000000 --- a/anda/multimedia/ffmpeg/ffmpeg-LCEVCdec-4.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -Naur ffmpeg-7.1.2.old/libavcodec/lcevcdec.c ffmpeg-7.1.2/libavcodec/lcevcdec.c ---- ffmpeg-7.1.2.old/libavcodec/lcevcdec.c 2025-10-27 10:07:00.369472051 +0100 -+++ ffmpeg-7.1.2/libavcodec/lcevcdec.c 2025-10-27 10:07:01.223246583 +0100 -@@ -139,7 +139,7 @@ - if (!sd) - return 1; - -- res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, 0, sd->data, sd->size); -+ res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, (uint64_t) in->pts, sd->data, sd->size); - if (res != LCEVC_Success) - return AVERROR_EXTERNAL; - -@@ -147,7 +147,7 @@ - if (ret < 0) - return ret; - -- res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, 0, picture, -1, NULL); -+ res = LCEVC_SendDecoderBase(lcevc->decoder, (uint64_t) in->pts, picture, -1, NULL); - if (res != LCEVC_Success) - return AVERROR_EXTERNAL; - -diff -Naur ffmpeg-7.1.2.old/libavfilter/vf_lcevc.c ffmpeg-7.1.2/libavfilter/vf_lcevc.c ---- ffmpeg-7.1.2.old/libavfilter/vf_lcevc.c 2025-10-27 10:07:00.732521928 +0100 -+++ ffmpeg-7.1.2/libavfilter/vf_lcevc.c 2025-10-27 10:07:01.223846623 +0100 -@@ -139,7 +139,7 @@ - return ret; - - if (sd) { -- res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, 0, sd->data, sd->size); -+ res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, (uint64_t) in->pts, sd->data, sd->size); - if (res == LCEVC_Again) - return AVERROR(EAGAIN); - else if (res != LCEVC_Success) { -@@ -148,7 +148,7 @@ - } - } - -- res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, 0, picture, -1, in); -+ res = LCEVC_SendDecoderBase(lcevc->decoder, (uint64_t) in->pts, picture, -1, in); - if (res != LCEVC_Success) { - av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderBase failed\n"); - LCEVC_FreePicture(lcevc->decoder, picture); diff --git a/anda/multimedia/ffmpeg/ffmpeg-allow-fdk-aac-free.patch b/anda/multimedia/ffmpeg/ffmpeg-allow-fdk-aac-free.patch new file mode 100644 index 0000000000..3e0e4ff155 --- /dev/null +++ b/anda/multimedia/ffmpeg/ffmpeg-allow-fdk-aac-free.patch @@ -0,0 +1,33 @@ +From 26eb0232fa41d603a2f016faf5610de79f694c02 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Sun, 10 May 2026 00:10:38 +0200 +Subject: [PATCH] fdk-aac-free-devel is GPL compatible + +See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 1759694..6cf4f08 100755 +--- a/configure ++++ b/configure +@@ -2003,7 +2003,6 @@ EXTERNAL_LIBRARY_GPL_LIST=" + + EXTERNAL_LIBRARY_NONFREE_LIST=" + decklink +- libfdk_aac + libmpeghdec + " + +@@ -2044,6 +2043,7 @@ EXTERNAL_LIBRARY_LIST=" + libcodec2 + libdav1d + libdc1394 ++ libfdk_aac + libflite + libfontconfig + libfreetype +-- +2.54.0 + diff --git a/anda/multimedia/ffmpeg/ffmpeg-chromium.patch b/anda/multimedia/ffmpeg/ffmpeg-chromium.patch index 5c8c6cbfd9..9872622869 100644 --- a/anda/multimedia/ffmpeg/ffmpeg-chromium.patch +++ b/anda/multimedia/ffmpeg/ffmpeg-chromium.patch @@ -1,31 +1,46 @@ -diff -Naur ffmpeg-7.1.2.old/libavformat/avformat.h ffmpeg-7.1.2/libavformat/avformat.h ---- ffmpeg-7.1.2.old/libavformat/avformat.h 2025-10-27 10:07:00.895476692 +0100 -+++ ffmpeg-7.1.2/libavformat/avformat.h 2025-10-27 10:07:01.866348795 +0100 -@@ -1202,6 +1202,10 @@ - +From d32aacab65a322b66d6a1b48f6cdb03e42bde0f9 Mon Sep 17 00:00:00 2001 +From: Frank Liberato +Date: Wed, 7 Jul 2021 19:01:22 -0700 +Subject: [PATCH] Add av_stream_get_first_dts for Chromium + +--- + libavformat/avformat.h | 4 ++++ + libavformat/utils.c | 7 +++++++ + 2 files changed, 11 insertions(+) + +diff --git a/libavformat/avformat.h b/libavformat/avformat.h +index 1916aa2dc5..e6682849fa 100644 +--- a/libavformat/avformat.h ++++ b/libavformat/avformat.h +@@ -1170,6 +1170,10 @@ typedef struct AVStreamGroup { + struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); - + +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st); +// Chromium: We use the internal field first_dts ^^^ + #define AV_PROGRAM_RUNNING 1 - + /** -diff -Naur ffmpeg-7.1.2.old/libavformat/utils.c ffmpeg-7.1.2/libavformat/utils.c ---- ffmpeg-7.1.2.old/libavformat/utils.c 2025-10-27 10:07:00.899476727 +0100 -+++ ffmpeg-7.1.2/libavformat/utils.c 2025-10-27 10:07:01.866992658 +0100 -@@ -44,6 +44,13 @@ +diff --git a/libavformat/utils.c b/libavformat/utils.c +index cf4d68bff9..7d750abf88 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -56,6 +56,13 @@ int ff_unlock_avformat(void) * various utility functions for use within FFmpeg */ +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st) +{ -+ return cffstream(st)->first_dts; ++ return cffstream(st)->first_dts; +} +// Chromium: We use the internal field first_dts ^^^ + /* an arbitrarily chosen "sane" max packet size -- 50M */ #define SANE_CHUNK_SIZE (50000000) - + +-- +2.41.0 + diff --git a/anda/multimedia/ffmpeg/ffmpeg-codec-choice.patch b/anda/multimedia/ffmpeg/ffmpeg-codec-choice.patch new file mode 100644 index 0000000000..f6a4ead570 --- /dev/null +++ b/anda/multimedia/ffmpeg/ffmpeg-codec-choice.patch @@ -0,0 +1,58 @@ +From: Jan Engelhardt + +Edit the default codec selection such that + + ffmpeg -i youtube.blah.webm foobar.mkv + +without any further arguments can produce a result even on a +reduced codec selection list. + +--- + libavformat/matroskaenc.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +Index: ffmpeg-7.0/libavformat/matroskaenc.c +=================================================================== +--- ffmpeg-7.0.orig/libavformat/matroskaenc.c ++++ ffmpeg-7.0/libavformat/matroskaenc.c +@@ -3540,16 +3540,25 @@ static int mkv_query_codec(enum AVCodecI + return 0; + } + ++#define PREFAUDIO \ ++ CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : \ ++ CONFIG_AAC_ENCODER ? AV_CODEC_ID_AAC : \ ++ CONFIG_VORBIS_ENCODER ? AV_CODEC_ID_VORBIS : \ ++ AV_CODEC_ID_AC3 ++ + const FFOutputFormat ff_matroska_muxer = { + .p.name = "matroska", + .p.long_name = NULL_IF_CONFIG_SMALL("Matroska"), + .p.mime_type = "video/x-matroska", + .p.extensions = "mkv", + .priv_data_size = sizeof(MatroskaMuxContext), +- .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? +- AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3, +- .p.video_codec = CONFIG_LIBX264_ENCODER ? +- AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, ++ .p.audio_codec = PREFAUDIO, ++ .p.video_codec = ++ CONFIG_LIBVPX_VP9_ENCODER ? AV_CODEC_ID_VP9 : \ ++ CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : \ ++ CONFIG_LIBVPX_VP8_ENCODER ? AV_CODEC_ID_VP8 : \ ++ CONFIG_MPEG4_ENCODER ? AV_CODEC_ID_MPEG4 : \ ++ AV_CODEC_ID_THEORA, + .init = mkv_init, + .deinit = mkv_deinit, + .write_header = mkv_write_header, +@@ -3617,8 +3626,7 @@ const FFOutputFormat ff_matroska_audio_m + .p.mime_type = "audio/x-matroska", + .p.extensions = "mka", + .priv_data_size = sizeof(MatroskaMuxContext), +- .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? +- AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3, ++ .p.audio_codec = PREFAUDIO, + .p.video_codec = AV_CODEC_ID_NONE, + .init = mkv_init, + .deinit = mkv_deinit, + diff --git a/anda/multimedia/ffmpeg/ffmpeg-cuda-13.patch b/anda/multimedia/ffmpeg/ffmpeg-cuda-13.patch deleted file mode 100644 index 28bba4a1a7..0000000000 --- a/anda/multimedia/ffmpeg/ffmpeg-cuda-13.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure ---- ffmpeg-7.1.2.old/configure 2025-10-27 10:07:02.273543997 +0100 -+++ ffmpeg-7.1.2/configure 2025-10-27 10:07:02.276510125 +0100 -@@ -4710,6 +4710,9 @@ - if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then - nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2" - fi -+ if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then -+ nvccflags_default="-gencode arch=compute_75,code=sm_75 -O2" -+ fi - fi - - set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ diff --git a/anda/multimedia/ffmpeg/ffmpeg-decklink-14.patch b/anda/multimedia/ffmpeg/ffmpeg-decklink-14.patch deleted file mode 100644 index 779e398257..0000000000 --- a/anda/multimedia/ffmpeg/ffmpeg-decklink-14.patch +++ /dev/null @@ -1,454 +0,0 @@ -diff -Naur ffmpeg-7.1.2.old/doc/outdevs.texi ffmpeg-7.1.2/doc/outdevs.texi ---- ffmpeg-7.1.2.old/doc/outdevs.texi 2025-10-27 10:07:00.979477433 +0100 -+++ ffmpeg-7.1.2/doc/outdevs.texi 2025-10-27 10:07:02.002148270 +0100 -@@ -240,6 +240,10 @@ - outgoing VANC data will be dropped. - Defaults to @samp{1048576}. - -+@item block_until_available -+Retries output if device appears unavailable. Retry rate is 60 times a second. -+Defaults to @option{0}. -+ - @end table - - @subsection Examples -diff -Naur ffmpeg-7.1.2.old/fftools/ffmpeg_sched.c ffmpeg-7.1.2/fftools/ffmpeg_sched.c ---- ffmpeg-7.1.2.old/fftools/ffmpeg_sched.c 2025-10-27 10:07:01.220479559 +0100 -+++ ffmpeg-7.1.2/fftools/ffmpeg_sched.c 2025-10-27 10:07:02.002549025 +0100 -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - #include "cmdutils.h" - #include "ffmpeg_sched.h" -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_common_c.h ffmpeg-7.1.2/libavdevice/decklink_common_c.h ---- ffmpeg-7.1.2.old/libavdevice/decklink_common_c.h 2025-10-27 10:07:00.829476109 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_common_c.h 2025-10-27 10:07:02.003002589 +0100 -@@ -74,6 +74,7 @@ - int64_t timestamp_align; - int timing_offset; - int wait_for_tc; -+ int block_until_available; - DecklinkSignalLossAction signal_loss_action; - }; - -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_common.cpp ffmpeg-7.1.2/libavdevice/decklink_common.cpp ---- ffmpeg-7.1.2.old/libavdevice/decklink_common.cpp 2025-10-27 10:07:00.828476101 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_common.cpp 2025-10-27 10:07:02.003115933 +0100 -@@ -25,7 +25,7 @@ - #include "libavformat/internal.h" - } - --#include -+#include - #ifdef _WIN32 - #include - #else -@@ -53,6 +53,7 @@ - - #include "decklink_common.h" - -+ - static IDeckLinkIterator *decklink_create_iterator(AVFormatContext *avctx) - { - IDeckLinkIterator *iter; -@@ -512,8 +513,8 @@ - return AVERROR(EIO); - - while (ret == 0 && iter->Next(&dl) == S_OK) { -- IDeckLinkOutput *output_config; -- IDeckLinkInput *input_config; -+ IDeckLinkOutput_v14_2_1 *output_config; -+ IDeckLinkInput_v14_2_1 *input_config; - const char *display_name = NULL; - const char *unique_name = NULL; - AVDeviceInfo *new_device = NULL; -@@ -527,14 +528,14 @@ - goto next; - - if (show_outputs) { -- if (dl->QueryInterface(IID_IDeckLinkOutput, (void **)&output_config) == S_OK) { -+ if (dl->QueryInterface(IID_IDeckLinkOutput_v14_2_1, (void **)&output_config) == S_OK) { - output_config->Release(); - add = 1; - } - } - - if (show_inputs) { -- if (dl->QueryInterface(IID_IDeckLinkInput, (void **)&input_config) == S_OK) { -+ if (dl->QueryInterface(IID_IDeckLinkInput_v14_2_1, (void **)&input_config) == S_OK) { - input_config->Release(); - add = 1; - } -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_common.h ffmpeg-7.1.2/libavdevice/decklink_common.h ---- ffmpeg-7.1.2.old/libavdevice/decklink_common.h 2025-10-27 10:07:00.831476127 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_common.h 2025-10-27 10:07:02.003408083 +0100 -@@ -93,8 +93,8 @@ - struct decklink_ctx { - /* DeckLink SDK interfaces */ - IDeckLink *dl; -- IDeckLinkOutput *dlo; -- IDeckLinkInput *dli; -+ IDeckLinkOutput_v14_2_1 *dlo; -+ IDeckLinkInput_v14_2_1 *dli; - IDeckLinkConfiguration *cfg; - IDeckLinkProfileAttributes *attr; - decklink_output_callback *output_callback; -@@ -134,7 +134,6 @@ - AVStream *klv_st; - AVStream *teletext_st; - uint16_t cdp_sequence_num; -- - /* Options */ - int list_devices; - int list_formats; -@@ -149,13 +148,16 @@ - BMDPixelFormat raw_format; - DecklinkSignalLossAction signal_loss_action; - -+ - int frames_preroll; - int frames_buffer; - - pthread_mutex_t mutex; - pthread_cond_t cond; - int frames_buffer_available_spots; -+ int outstanding_frames; - int autodetect; -+ int block_until_available; - - #if CONFIG_LIBKLVANC - struct klvanc_context_s *vanc_ctx; -@@ -249,3 +251,4 @@ - int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q); - - #endif /* AVDEVICE_DECKLINK_COMMON_H */ -+ -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_dec.cpp ffmpeg-7.1.2/libavdevice/decklink_dec.cpp ---- ffmpeg-7.1.2.old/libavdevice/decklink_dec.cpp 2025-10-27 10:07:00.828476101 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_dec.cpp 2025-10-27 10:07:02.003669356 +0100 -@@ -31,7 +31,7 @@ - #include "libavformat/internal.h" - } - --#include -+#include - - extern "C" { - #include "config.h" -@@ -56,6 +56,7 @@ - #include "decklink_common.h" - #include "decklink_dec.h" - -+extern bool operator==(const REFIID& me, const REFIID& other); - #define MAX_WIDTH_VANC 1920 - const BMDDisplayMode AUTODETECT_DEFAULT_MODE = bmdModeNTSC; - -@@ -105,13 +106,13 @@ - {bmdModeUnknown, 0, -1, -1, -1} - }; - --class decklink_allocator : public IDeckLinkMemoryAllocator -+class decklink_allocator : public IDeckLinkMemoryAllocator_v14_2_1 - { - public: - decklink_allocator(): _refs(1) { } - virtual ~decklink_allocator() { } - -- // IDeckLinkMemoryAllocator methods -+ // IDeckLinkMemoryAllocator_v14_2_1 methods - virtual HRESULT STDMETHODCALLTYPE AllocateBuffer(unsigned int bufferSize, void* *allocatedBuffer) - { - void *buf = av_malloc(bufferSize + AV_INPUT_BUFFER_PADDING_SIZE); -@@ -129,7 +130,15 @@ - virtual HRESULT STDMETHODCALLTYPE Decommit() { return S_OK; } - - // IUnknown methods -- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; } -+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) -+ { -+ if (iid == IID_IDeckLinkMemoryAllocator_v14_2_1) { -+ *ppv = (IDeckLinkMemoryAllocator_v14_2_1*)this; -+ AddRef(); -+ return S_OK; -+ } -+ return E_NOINTERFACE; -+ } - virtual ULONG STDMETHODCALLTYPE AddRef(void) { return ++_refs; } - virtual ULONG STDMETHODCALLTYPE Release(void) - { -@@ -472,7 +481,7 @@ - } - - --static void handle_klv(AVFormatContext *avctx, decklink_ctx *ctx, IDeckLinkVideoInputFrame *videoFrame, int64_t pts) -+static void handle_klv(AVFormatContext *avctx, decklink_ctx *ctx, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame, int64_t pts) - { - const uint8_t KLV_DID = 0x44; - const uint8_t KLV_IN_VANC_SDID = 0x04; -@@ -574,17 +583,25 @@ - } - } - --class decklink_input_callback : public IDeckLinkInputCallback -+class decklink_input_callback : public IDeckLinkInputCallback_v14_2_1 - { - public: - explicit decklink_input_callback(AVFormatContext *_avctx); - ~decklink_input_callback(); - -- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; } -+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) -+ { -+ if (iid == IID_IDeckLinkInputCallback_v14_2_1) { -+ *ppv = (IDeckLinkInputCallback_v14_2_1*)this; -+ AddRef(); -+ return S_OK; -+ } -+ return E_NOINTERFACE; -+ } - virtual ULONG STDMETHODCALLTYPE AddRef(void); - virtual ULONG STDMETHODCALLTYPE Release(void); - virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags); -- virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*); -+ virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame_v14_2_1*, IDeckLinkAudioInputPacket*); - - private: - std::atomic _refs; -@@ -593,7 +610,7 @@ - int no_video; - int64_t initial_video_pts; - int64_t initial_audio_pts; -- IDeckLinkVideoInputFrame* last_video_frame; -+ IDeckLinkVideoInputFrame_v14_2_1* last_video_frame; - }; - - decklink_input_callback::decklink_input_callback(AVFormatContext *_avctx) : _refs(1) -@@ -625,7 +642,7 @@ - return ret; - } - --static int64_t get_pkt_pts(IDeckLinkVideoInputFrame *videoFrame, -+static int64_t get_pkt_pts(IDeckLinkVideoInputFrame_v14_2_1 *videoFrame, - IDeckLinkAudioInputPacket *audioFrame, - int64_t wallclock, - int64_t abs_wallclock, -@@ -679,7 +696,7 @@ - return pts; - } - --static int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame *videoFrame) -+static int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame) - { - IDeckLinkTimecode *timecode; - int ret = AVERROR(ENOENT); -@@ -701,7 +718,7 @@ - return ret; - } - --static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame *videoFrame) -+static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame) - { - AVRational frame_rate = ctx->video_st->r_frame_rate; - int ret; -@@ -726,7 +743,7 @@ - } - - HRESULT decklink_input_callback::VideoInputFrameArrived( -- IDeckLinkVideoInputFrame *videoFrame, IDeckLinkAudioInputPacket *audioFrame) -+ IDeckLinkVideoInputFrame_v14_2_1 *videoFrame, IDeckLinkAudioInputPacket *audioFrame) - { - void *frameBytes; - void *audioFrameBytes; -@@ -1141,7 +1158,7 @@ - goto error; - - /* Get input device. */ -- if (ctx->dl->QueryInterface(IID_IDeckLinkInput, (void **) &ctx->dli) != S_OK) { -+ if (ctx->dl->QueryInterface(IID_IDeckLinkInput_v14_2_1, (void **) &ctx->dli) != S_OK) { - av_log(avctx, AV_LOG_ERROR, "Could not open input device from '%s'\n", - avctx->url); - ret = AVERROR(EIO); -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_enc_c.c ffmpeg-7.1.2/libavdevice/decklink_enc_c.c ---- ffmpeg-7.1.2.old/libavdevice/decklink_enc_c.c 2025-10-27 10:07:00.833476145 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_enc_c.c 2025-10-27 10:07:02.004050964 +0100 -@@ -32,6 +32,7 @@ - { "list_devices", "use ffmpeg -sinks decklink instead", OFFSET(list_devices), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC | AV_OPT_FLAG_DEPRECATED}, - { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC }, - { "preroll" , "video preroll in seconds", OFFSET(preroll ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC }, -+ { "block_until_available", "wait for device to become available instead of raising error", OFFSET(block_until_available), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, - { "vanc_queue_size", "VANC queue buffer size", OFFSET(vanc_queue_size), AV_OPT_TYPE_INT64, { .i64 = (1024 * 1024)}, 0, INT64_MAX, ENC }, - #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000 - { "duplex_mode" , "duplex mode" , OFFSET(duplex_mode ), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 5, ENC, .unit = "duplex_mode"}, -diff -Naur ffmpeg-7.1.2.old/libavdevice/decklink_enc.cpp ffmpeg-7.1.2/libavdevice/decklink_enc.cpp ---- ffmpeg-7.1.2.old/libavdevice/decklink_enc.cpp 2025-10-27 10:07:00.832476136 +0100 -+++ ffmpeg-7.1.2/libavdevice/decklink_enc.cpp 2025-10-27 10:07:02.004296918 +0100 -@@ -20,6 +20,8 @@ - */ - - #include -+#include -+ - using std::atomic; - - /* Include internal.h first to avoid conflict between winsock.h (used by -@@ -28,7 +30,7 @@ - #include "libavformat/internal.h" - } - --#include -+#include - - extern "C" { - #include "libavformat/avformat.h" -@@ -47,8 +49,26 @@ - #include "libklvanc/pixels.h" - #endif - -+extern bool operator==(const REFIID& me, const REFIID& other){ -+ return me.byte0 == other.byte0 && -+ me.byte1 == other.byte1 && -+ me.byte2 == other.byte2 && -+ me.byte3 == other.byte3 && -+ me.byte4 == other.byte4 && -+ me.byte5 == other.byte5 && -+ me.byte6 == other.byte6 && -+ me.byte7 == other.byte7 && -+ me.byte8 == other.byte8 && -+ me.byte9 == other.byte9 && -+ me.byte10 == other.byte10 && -+ me.byte11 == other.byte11 && -+ me.byte12 == other.byte12 && -+ me.byte13 == other.byte13 && -+ me.byte14 == other.byte14 && -+ me.byte15 == other.byte15; -+} - /* DeckLink callback class declaration */ --class decklink_frame : public IDeckLinkVideoFrame -+class decklink_frame : public IDeckLinkVideoFrame_v14_2_1 - { - public: - decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe, AVCodecID codec_id, int height, int width) : -@@ -111,7 +131,16 @@ - _ancillary->AddRef(); - return S_OK; - } -- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; } -+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) -+ { -+ if (iid == IID_IDeckLinkVideoFrame_v14_2_1) -+ { -+ *ppv = (IDeckLinkVideoFrame_v14_2_1*)this; -+ AddRef(); -+ return S_OK; -+ } -+ return E_NOINTERFACE; -+ } - virtual ULONG STDMETHODCALLTYPE AddRef(void) { return ++_refs; } - virtual ULONG STDMETHODCALLTYPE Release(void) - { -@@ -138,10 +167,10 @@ - std::atomic _refs; - }; - --class decklink_output_callback : public IDeckLinkVideoOutputCallback -+class decklink_output_callback : public IDeckLinkVideoOutputCallback_v14_2_1 - { - public: -- virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted(IDeckLinkVideoFrame *_frame, BMDOutputFrameCompletionResult result) -+ virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted(IDeckLinkVideoFrame_v14_2_1 *_frame, BMDOutputFrameCompletionResult result) - { - decklink_frame *frame = static_cast(_frame); - struct decklink_ctx *ctx = frame->_ctx; -@@ -155,11 +184,22 @@ - ctx->frames_buffer_available_spots++; - pthread_cond_broadcast(&ctx->cond); - pthread_mutex_unlock(&ctx->mutex); -- -+ pthread_mutex_lock(&ctx->mutex); -+ ctx->outstanding_frames--; -+ pthread_mutex_unlock(&ctx->mutex); - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE ScheduledPlaybackHasStopped(void) { return S_OK; } -- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; } -+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) -+ { -+ if (iid == IID_IDeckLinkVideoOutputCallback_v14_2_1) -+ { -+ *ppv = (IDeckLinkVideoOutputCallback_v14_2_1*)this; -+ AddRef(); -+ return S_OK; -+ } -+ return E_NOINTERFACE; -+ } - virtual ULONG STDMETHODCALLTYPE AddRef(void) { return 1; } - virtual ULONG STDMETHODCALLTYPE Release(void) { return 1; } - }; -@@ -204,9 +244,14 @@ - av_log(avctx, AV_LOG_WARNING, "Could not enable video output with VANC! Trying without...\n"); - ctx->supports_vanc = 0; - } -- if (!ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputFlagDefault) != S_OK) { -- av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n"); -- return -1; -+ while (!ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputFlagDefault) != S_OK) { -+ if (!ctx->block_until_available) { -+ av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n"); -+ return -1; -+ }; -+ av_log(avctx, AV_LOG_WARNING, "Could not enable video output, waiting for device...\n"); -+ usleep(1000000 / 60); -+ continue; - } - - /* Set callback. */ -@@ -370,6 +415,10 @@ - struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data; - struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; - -+ av_log(avctx, AV_LOG_DEBUG, "Wating for %d outstanding frames to return their results\n", ctx->outstanding_frames); -+ while (ctx->outstanding_frames > 0){ -+ usleep(1); -+ } - if (ctx->playback_started) { - BMDTimeValue actual; - ctx->dlo->StopScheduledPlayback(ctx->last_pts * ctx->bmd_tb_num, -@@ -739,7 +788,7 @@ - ctx->first_pts = pkt->pts; - - /* Schedule frame for playback. */ -- hr = ctx->dlo->ScheduleVideoFrame((class IDeckLinkVideoFrame *) frame, -+ hr = ctx->dlo->ScheduleVideoFrame((class IDeckLinkVideoFrame_v14_2_1 *) frame, - pkt->pts * ctx->bmd_tb_num, - ctx->bmd_tb_num, ctx->bmd_tb_den); - /* Pass ownership to DeckLink, or release on failure */ -@@ -750,6 +799,9 @@ - return AVERROR(EIO); - } - -+ pthread_mutex_lock(&ctx->mutex); -+ ctx->outstanding_frames++; -+ pthread_mutex_unlock(&ctx->mutex); - ctx->dlo->GetBufferedVideoFrameCount(&buffered); - av_log(avctx, AV_LOG_DEBUG, "Buffered video frames: %d.\n", (int) buffered); - if (pkt->pts > 2 && buffered <= 2) -@@ -850,6 +902,7 @@ - ctx->list_devices = cctx->list_devices; - ctx->list_formats = cctx->list_formats; - ctx->preroll = cctx->preroll; -+ ctx->block_until_available = cctx->block_until_available; - ctx->duplex_mode = cctx->duplex_mode; - ctx->first_pts = AV_NOPTS_VALUE; - if (cctx->link > 0 && (unsigned int)cctx->link < FF_ARRAY_ELEMS(decklink_link_conf_map)) -@@ -874,7 +927,7 @@ - return ret; - - /* Get output device. */ -- if (ctx->dl->QueryInterface(IID_IDeckLinkOutput, (void **) &ctx->dlo) != S_OK) { -+ if (ctx->dl->QueryInterface(IID_IDeckLinkOutput_v14_2_1, (void **) &ctx->dlo) != S_OK) { - av_log(avctx, AV_LOG_ERROR, "Could not open output device from '%s'\n", - avctx->url); - ret = AVERROR(EIO); diff --git a/anda/multimedia/ffmpeg/ffmpeg-nvcc.patch b/anda/multimedia/ffmpeg/ffmpeg-nvcc.patch deleted file mode 100644 index 7dcf2259c3..0000000000 --- a/anda/multimedia/ffmpeg/ffmpeg-nvcc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure ---- ffmpeg-7.1.2.old/configure 2025-10-27 10:07:01.862821941 +0100 -+++ ffmpeg-7.1.2/configure 2025-10-27 10:07:02.140469997 +0100 -@@ -6766,7 +6766,7 @@ - nvccflags=$nvccflags_default - fi - --nvccflags="$nvccflags -std=c++11" -+nvccflags="$nvccflags -std=c++14" - - if enabled x86_64 || enabled ppc64 || enabled aarch64; then - nvccflags="$nvccflags -m64" diff --git a/anda/multimedia/ffmpeg/ffmpeg-svt-vp9.patch b/anda/multimedia/ffmpeg/ffmpeg-svt-vp9.patch index 6bdae213ed..b017c32115 100644 --- a/anda/multimedia/ffmpeg/ffmpeg-svt-vp9.patch +++ b/anda/multimedia/ffmpeg/ffmpeg-svt-vp9.patch @@ -1,15 +1,7 @@ -diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure ---- ffmpeg-7.1.2.old/configure 2025-10-27 10:07:00.645474486 +0100 -+++ ffmpeg-7.1.2/configure 2025-10-27 10:07:01.726484024 +0100 -@@ -278,6 +278,7 @@ - --enable-libsrt enable Haivision SRT protocol via libsrt [no] - --enable-libssh enable SFTP protocol via libssh [no] - --enable-libsvtav1 enable AV1 encoding via SVT [no] -+ --enable-libsvtvp9 enable VP9 encoding via svt [no] - --enable-libtensorflow enable TensorFlow as a DNN module backend - for DNN based filters like sr [no] - --enable-libtesseract enable Tesseract, needed for ocr filter [no] -@@ -1955,6 +1956,7 @@ +diff -Naur ffmpeg-8.1.1.old/configure ffmpeg-8.1.1/configure +--- ffmpeg-8.1.1.old/configure 2026-05-22 09:46:43.476259040 +0200 ++++ ffmpeg-8.1.1/configure 2026-05-22 09:46:43.942340977 +0200 +@@ -2083,6 +2083,7 @@ libshaderc libshine libsmbclient @@ -17,7 +9,7 @@ diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure libsnappy libsoxr libspeex -@@ -3579,6 +3581,7 @@ +@@ -3825,6 +3826,7 @@ libvpx_vp8_encoder_deps="libvpx" libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx" @@ -25,7 +17,7 @@ diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure libvvenc_encoder_deps="libvvenc" libwebp_encoder_deps="libwebp" libwebp_anim_encoder_deps="libwebp" -@@ -7028,6 +7031,7 @@ +@@ -7387,6 +7389,7 @@ die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl @@ -33,10 +25,24 @@ diff -Naur ffmpeg-7.1.2.old/configure ffmpeg-7.1.2/configure enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init -diff -Naur ffmpeg-7.1.2.old/libavcodec/allcodecs.c ffmpeg-7.1.2/libavcodec/allcodecs.c ---- ffmpeg-7.1.2.old/libavcodec/allcodecs.c 2025-10-27 10:07:00.517473357 +0100 -+++ ffmpeg-7.1.2/libavcodec/allcodecs.c 2025-10-27 10:07:01.728697010 +0100 -@@ -796,6 +796,7 @@ +diff -Naur ffmpeg-8.1.1.old/configure.rej ffmpeg-8.1.1/configure.rej +--- ffmpeg-8.1.1.old/configure.rej 1970-01-01 01:00:00.000000000 +0100 ++++ ffmpeg-8.1.1/configure.rej 2026-05-22 09:46:43.944047173 +0200 +@@ -0,0 +1,10 @@ ++--- configure 2026-03-10 10:00:58.102559577 +0100 +++++ configure 2026-03-10 10:00:58.530928613 +0100 ++@@ -278,6 +278,7 @@ ++ --enable-libsrt enable Haivision SRT protocol via libsrt [no] ++ --enable-libssh enable SFTP protocol via libssh [no] ++ --enable-libsvtav1 enable AV1 encoding via SVT [no] +++ --enable-libsvtvp9 enable VP9 encoding via svt [no] ++ --enable-libtensorflow enable TensorFlow as a DNN module backend ++ for DNN based filters like sr [no] ++ --enable-libtesseract enable Tesseract, needed for ocr filter [no] +diff -Naur ffmpeg-8.1.1.old/libavcodec/allcodecs.c ffmpeg-8.1.1/libavcodec/allcodecs.c +--- ffmpeg-8.1.1.old/libavcodec/allcodecs.c 2026-05-22 09:46:43.386258267 +0200 ++++ ffmpeg-8.1.1/libavcodec/allcodecs.c 2026-05-22 09:46:43.944175014 +0200 +@@ -826,6 +826,7 @@ extern const FFCodec ff_libvo_amrwbenc_encoder; extern const FFCodec ff_libvorbis_encoder; extern const FFCodec ff_libvorbis_decoder; @@ -44,9 +50,9 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/allcodecs.c ffmpeg-7.1.2/libavcodec/allco extern const FFCodec ff_libvpx_vp8_encoder; extern const FFCodec ff_libvpx_vp8_decoder; extern FFCodec ff_libvpx_vp9_encoder; -diff -Naur ffmpeg-7.1.2.old/libavcodec/libsvt_vp9.c ffmpeg-7.1.2/libavcodec/libsvt_vp9.c ---- ffmpeg-7.1.2.old/libavcodec/libsvt_vp9.c 1970-01-01 01:00:00.000000000 +0100 -+++ ffmpeg-7.1.2/libavcodec/libsvt_vp9.c 2025-10-27 10:07:01.729099438 +0100 +diff -Naur ffmpeg-8.1.1.old/libavcodec/libsvt_vp9.c ffmpeg-8.1.1/libavcodec/libsvt_vp9.c +--- ffmpeg-8.1.1.old/libavcodec/libsvt_vp9.c 1970-01-01 01:00:00.000000000 +0100 ++++ ffmpeg-8.1.1/libavcodec/libsvt_vp9.c 2026-05-22 09:46:43.944263059 +0200 @@ -0,0 +1,701 @@ +/* +* Scalable Video Technology for VP9 encoder library plugin @@ -749,10 +755,10 @@ diff -Naur ffmpeg-7.1.2.old/libavcodec/libsvt_vp9.c ffmpeg-7.1.2/libavcodec/libs + .defaults = eb_enc_defaults, + .p.wrapper_name = "libsvt_vp9", +}; -diff -Naur ffmpeg-7.1.2.old/libavcodec/Makefile ffmpeg-7.1.2/libavcodec/Makefile ---- ffmpeg-7.1.2.old/libavcodec/Makefile 2025-10-27 10:07:00.259471080 +0100 -+++ ffmpeg-7.1.2/libavcodec/Makefile 2025-10-27 10:07:01.729297932 +0100 -@@ -1157,6 +1157,7 @@ +diff -Naur ffmpeg-8.1.1.old/libavcodec/Makefile ffmpeg-8.1.1/libavcodec/Makefile +--- ffmpeg-8.1.1.old/libavcodec/Makefile 2026-05-22 09:46:43.194256618 +0200 ++++ ffmpeg-8.1.1/libavcodec/Makefile 2026-05-22 09:46:43.944732404 +0200 +@@ -1217,6 +1217,7 @@ OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \ vorbis_data.o diff --git a/anda/multimedia/ffmpeg/ffmpeg-vapoursynth-script-soname.patch b/anda/multimedia/ffmpeg/ffmpeg-vapoursynth-script-soname.patch new file mode 100644 index 0000000000..fb3ac775e7 --- /dev/null +++ b/anda/multimedia/ffmpeg/ffmpeg-vapoursynth-script-soname.patch @@ -0,0 +1,12 @@ +diff -Naur ffmpeg-7.1.2.old/libavformat/vapoursynth.c ffmpeg-7.1.2/libavformat/vapoursynth.c +--- ffmpeg-7.1.2.old/libavformat/vapoursynth.c 2025-10-27 14:43:15.744230401 +0100 ++++ ffmpeg-7.1.2/libavformat/vapoursynth.c 2025-10-27 14:43:36.732183431 +0100 +@@ -49,7 +49,7 @@ + #else + #include + #define VSSCRIPT_NAME "libvapoursynth-script" +- #define VSSCRIPT_LIB VSSCRIPT_NAME SLIBSUF ++ #define VSSCRIPT_LIB VSSCRIPT_NAME SLIBSUF ".0" + #endif + + struct VSState { diff --git a/anda/multimedia/ffmpeg/ffmpeg.spec b/anda/multimedia/ffmpeg/ffmpeg.spec index bcb49817fa..66268a0e79 100644 --- a/anda/multimedia/ffmpeg/ffmpeg.spec +++ b/anda/multimedia/ffmpeg/ffmpeg.spec @@ -1,432 +1,734 @@ -%bcond bootstrap 1 +# For a complete build enable this +%bcond all_codecs 1 -%if %{with bootstrap} -%bcond chromaprint 0 -%bcond lcevcdec 0 +# Break dependency cycles by disabling certain optional dependencies. +%bcond bootstrap 0 + +# If building with all codecs, 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 %{!?with_all_codecs:-free}%{?with_all_codecs:%{nil}} + +# For alternative builds (do not enable in Fedora!) +%bcond freeworld_lavc 0 + +%if %{with freeworld_lavc} +# Freeworld builds enable all codecs +%global with_all_codecs 1 +# Freeworld builds do not need a package suffix +%global pkg_suffix %{nil} +%global basepkg_suffix -free +%endif + +# Fails due to asm issue +%ifarch %{ix86} %{arm} +%bcond lto 0 +# relocations in .text from nasm-compiled code on i686 only +# https://bugzilla.redhat.com/show_bug.cgi?id=2428281 +%global _pkg_extra_ldflags "-Wl,-z,notext" %else -%bcond chromaprint 1 -%bcond lcevcdec 1 -%endif - -%global _lto_cflags %{nil} - -%global avcodec_soversion 61 -%global avdevice_soversion 61 -%global avfilter_soversion 10 -%global avformat_soversion 61 -%global avutil_soversion 59 -%global postproc_soversion 58 -%global swresample_soversion 5 -%global swscale_soversion 8 - -Summary: A complete solution to record, convert and stream audio and video -Name: ffmpeg -Version: 8.1.1 -Release: 1%{?dist} -License: LGPLv3+ -URL: http://%{name}.org/ -Epoch: 1 - -Source0: http://%{name}.org/releases/%{name}-%{version}.tar.xz - -# https://github.com/OpenVisualCloud/SVT-VP9/tree/master/ffmpeg_plugin -Patch0: %{name}-svt-vp9.patch -# https://github.com/HandBrake/HandBrake/tree/8902805364f00e0d420c4d4b33053a31d27045ab -Patch1: %{name}-HandBrake.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=2240127 -# Reference: https://crbug.com/1306560 -Patch2: %{name}-chromium.patch -# Fix build with recent NVCC: -Patch3: %{name}-nvcc.patch -# https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/f8a300c6739ea2ca648579d7faf3ae9811b9f19a -Patch4: %{name}-cuda-13.patch -# Support LCEVCdec 4.0+: -Patch5: https://aur.archlinux.org/cgit/aur.git/plain/080-ffmpeg-lcevcdec4.0.0-fix.patch?h=ffmpeg-full#/%{name}-LCEVCdec-4.patch -# https://github.com/magarnicle/FFmpeg/commits/DeckLink_SDK_14_4/ -Patch6: %{name}-decklink-14.patch - -BuildRequires: AMF-devel >= 1.4.28 -BuildRequires: bzip2-devel -BuildRequires: codec2-devel -BuildRequires: decklink-devel >= 14.2 -BuildRequires: doxygen -BuildRequires: frei0r-devel -BuildRequires: gmp-devel -BuildRequires: gsm-devel -BuildRequires: ilbc-devel -BuildRequires: lame-devel >= 3.98.3 -BuildRequires: ladspa-devel -BuildRequires: libavc1394-devel -%if %{with chromaprint} -BuildRequires: libchromaprint-devel -%endif -BuildRequires: libgcrypt-devel -BuildRequires: libiec61883-devel -BuildRequires: libklvanc-devel -BuildRequires: libtheora-devel -BuildRequires: libvdpau-devel -BuildRequires: libxavs-devel -BuildRequires: mesa-libGL-devel -BuildRequires: nasm -BuildRequires: ocl-icd-devel -BuildRequires: openal-soft-devel -BuildRequires: opencore-amr-devel -BuildRequires: perl(Pod::Man) -BuildRequires: snappy-devel -BuildRequires: soxr-devel -BuildRequires: subversion -BuildRequires: texinfo -BuildRequires: twolame-devel >= 0.3.10 -BuildRequires: vo-amrwbenc-devel -BuildRequires: xvidcore-devel -BuildRequires: xz-devel - -BuildRequires: pkgconfig(alsa) -BuildRequires: pkgconfig(aom) >= 1.0.0 -BuildRequires: pkgconfig(aribb24) >= 1.0.3 -BuildRequires: pkgconfig(caca) -BuildRequires: pkgconfig(dav1d) >= 0.5.0 -BuildRequires: pkgconfig(davs2) >= 1.6.0 -BuildRequires: pkgconfig(dvdnav) >= 6.1.1 -BuildRequires: pkgconfig(fdk-aac) -BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(freetype2) -BuildRequires: pkgconfig(fribidi) -BuildRequires: pkgconfig(harfbuzz) -BuildRequires: pkgconfig(jack) -BuildRequires: pkgconfig(kvazaar) >= 0.8.1 -BuildRequires: pkgconfig(lc3) >= 1.1.0 -BuildRequires: pkgconfig(lcms2) >= 2.13 -%if %{with lcevcdec} -BuildRequires: pkgconfig(lcevc_dec) >= 2.0.0 -%endif -BuildRequires: pkgconfig(libaribcaption) >= 1.1.1 -BuildRequires: pkgconfig(libass) >= 0.11.0 -BuildRequires: pkgconfig(libbluray) -BuildRequires: pkgconfig(libbs2b) -BuildRequires: pkgconfig(libcdio_paranoia) -BuildRequires: pkgconfig(libdc1394-2) -BuildRequires: pkgconfig(libdrm) -BuildRequires: pkgconfig(libgme) -BuildRequires: pkgconfig(libjxl) >= 0.7.0 -#BuildRequires: pkgconfig(lensfun) > 0.3.95 -BuildRequires: pkgconfig(libmodplug) -BuildRequires: pkgconfig(libmysofa) -BuildRequires: pkgconfig(libopenjp2) >= 2.1.0 -BuildRequires: pkgconfig(libopenmpt) >= 0.2.6557 -BuildRequires: pkgconfig(libplacebo) >= 4.192.0 -BuildRequires: pkgconfig(libpulse) -BuildRequires: pkgconfig(libqrencode) -#BuildRequires: pkgconfig(libquirc) -BuildRequires: pkgconfig(librabbitmq) >= 0.7.1 -BuildRequires: pkgconfig(librist) >= 0.2.7 -BuildRequires: pkgconfig(librtmp) -BuildRequires: pkgconfig(librsvg-2.0) -BuildRequires: pkgconfig(libssh) -BuildRequires: pkgconfig(libtcmalloc) -BuildRequires: pkgconfig(libva) >= 0.35.0 -BuildRequires: pkgconfig(libva-drm) -BuildRequires: pkgconfig(libva-x11) -BuildRequires: pkgconfig(libv4l2) -BuildRequires: pkgconfig(libvvenc) >= 1.11.0 -BuildRequires: pkgconfig(libwebp) -BuildRequires: pkgconfig(libwebpmux) >= 0.4.0 -BuildRequires: pkgconfig(libxml-2.0) -BuildRequires: pkgconfig(libzmq) >= 4.2.1 -BuildRequires: pkgconfig(lilv-0) -BuildRequires: pkgconfig(lv2) -#BuildRequires: pkgconfig(OpenCL) -#BuildRequires: pkgconfig(opencv) -BuildRequires: pkgconfig(openh264) -BuildRequires: pkgconfig(openssl) -BuildRequires: pkgconfig(opus) -BuildRequires: pkgconfig(rav1e) >= 0.4.0 -BuildRequires: pkgconfig(rubberband) >= 1.8.1 -BuildRequires: pkgconfig(sdl2) -BuildRequires: pkgconfig(shaderc) >= 2019.1 -#BuildRequires: pkgconfig(shine) -BuildRequires: pkgconfig(smbclient) -BuildRequires: pkgconfig(speex) -BuildRequires: pkgconfig(srt) >= 1.3.0 -BuildRequires: pkgconfig(SvtAv1Enc) >= 0.9.0 -BuildRequires: pkgconfig(tesseract) -BuildRequires: pkgconfig(uavs3d) >= 1.1.41 -BuildRequires: pkgconfig(vapoursynth-script) >= 42 -BuildRequires: pkgconfig(vidstab) >= 0.98 -BuildRequires: pkgconfig(vorbis) -BuildRequires: pkgconfig(vorbisenc) -BuildRequires: pkgconfig(vpx) >= 1.4.0 -BuildRequires: pkgconfig(vulkan) >= 1.3.277 -BuildRequires: pkgconfig(xavs2) >= 1.3.0 -BuildRequires: pkgconfig(xcb) >= 1.4 -BuildRequires: pkgconfig(xcb-shape) -BuildRequires: pkgconfig(xcb-shm) -BuildRequires: pkgconfig(xcb-xfixes) -BuildRequires: pkgconfig(xevd) >= 0.4.1 -BuildRequires: pkgconfig(xeve) >= 0.4.3 -BuildRequires: pkgconfig(xext) -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(x264) -BuildRequires: pkgconfig(x265) -BuildRequires: pkgconfig(xv) -BuildRequires: pkgconfig(zimg) >= 2.7.0 -BuildRequires: pkgconfig(zlib) -BuildRequires: pkgconfig(zvbi-0.2) >= 0.2.28 - -%ifarch x86_64 aarch64 -BuildRequires: cuda-cudart-devel -BuildRequires: cuda-nvcc -BuildRequires: pkgconfig(ffnvcodec) >= 12.0.16.0 +%bcond lto 1 %endif %ifarch x86_64 -BuildRequires: pkgconfig(libmfx) -BuildRequires: pkgconfig(libvmaf) >= 2.0.0 -BuildRequires: pkgconfig(SvtVp9Enc) -BuildRequires: pkgconfig(vpl) >= 2.6 +%bcond vpl 1 +%bcond vmaf 1 +%else +%bcond vpl 0 +%bcond vmaf 0 +%endif + +%ifarch s390 s390x riscv64 +%bcond dc1394 0 +%bcond ffnvcodec 0 +%else +%bcond dc1394 1 +%bcond ffnvcodec 1 +%endif + +%if 0%{?rhel} +# Disable dependencies not available or wanted on RHEL/EPEL +%bcond chromaprint 0 +%bcond flite 0 +%else +# Break chromaprint dependency cycle (Fedora-only): +# ffmpeg (libavcodec-free) → chromaprint → ffmpeg +%bcond chromaprint %{without boostrap} +%bcond flite 1 +%endif + +%if 0%{?rhel} && 0%{?rhel} <= 9 +# Disable some features because RHEL 9 packages are too old +%bcond lcms2 0 +%bcond placebo 0 +%else +%bcond lcms2 1 +%bcond placebo 1 +%endif + +%if 0%{?el10} +# Disable temporarily while we want for liblc3 to be upgraded +# Cf. https://issues.redhat.com/browse/RHEL-127169 +%bcond lc3 0 +%else +%bcond lc3 1 +%endif + +# For using an alternative build of EVC codecs +%bcond evc_main 0 + +%if %{with all_codecs} +%bcond rtmp 1 +%bcond vvc 1 +%bcond x264 1 +%bcond x265 1 +%else +%bcond rtmp 0 +%bcond vvc 0 +%bcond x264 0 +%bcond x265 0 +%endif + +%if %{without lto} +%global _lto_cflags %{nil} +%endif + +# FIXME: GCC says there's incompatible pointer casts going on in libavdevice... +%global build_type_safety_c 2 + +%global av_codec_soversion 62 +%global av_device_soversion 62 +%global av_filter_soversion 11 +%global av_format_soversion 62 +%global av_util_soversion 60 +%global swresample_soversion 6 +%global swscale_soversion 9 + +Name: ffmpeg +%global pkg_name %{name}%{?pkg_suffix} + +Version: 8.1.1 +Release: 1%{?dist} +Epoch: 1 +Summary: A complete solution to record, convert and stream audio and video +License: GPL-3.0-or-later +URL: https://ffmpeg.org/ +Source0: https://ffmpeg.org/releases/ffmpeg-%{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 +Source20: enable_decoders +Source21: enable_encoders + +%if %{without all_codecs} +# Fixes for reduced codec selection on free build +Patch1: ffmpeg-codec-choice.patch +%endif +# Allow to build with fdk-aac-free +# See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 +Patch2: ffmpeg-allow-fdk-aac-free.patch + +# HandBrake patches +Patch3: ffmpeg-svt-vp9.patch +Patch4: ffmpeg-HandBrake.patch + +# https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/23211 +Patch5: ffmpeg-vapoursynth-script-soname.patch + +# Add first_dts getter to libavformat for Chromium +# See: https://bugzilla.redhat.com/show_bug.cgi?id=2240127 +# Reference: https://crbug.com/1306560 +Patch1002: ffmpeg-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: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} + +BuildRequires: AMF-devel +# NOTE: This MUST by done otherwise the binary is NOT REDISTRIBUTABLE. +# Even though FDK itself may be redistributable. +# See: https://ffmpeg.org/doxygen/4.4/md_LICENSE.html +# DO NOT change this to pkgconfig(fdk-aac). +BuildRequires: fdk-aac-free-devel +%if %{with flite} +BuildRequires: flite-devel >= 2.2 +%endif +BuildRequires: game-music-emu-devel +BuildRequires: gcc +BuildRequires: git-core +BuildRequires: gnupg2 +BuildRequires: gsm-devel +BuildRequires: ladspa-devel +BuildRequires: lame-devel +BuildRequires: libgcrypt-devel +BuildRequires: libklvanc-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(aribb24) >= 1.0.3 +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(caca) +BuildRequires: pkgconfig(codec2) +BuildRequires: pkgconfig(dav1d) +BuildRequires: pkgconfig(dvdnav) +BuildRequires: pkgconfig(dvdread) +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(harfbuzz) +BuildRequires: pkgconfig(libilbc) +BuildRequires: pkgconfig(jack) +%if %{with lc3} +BuildRequires: pkgconfig(lc3) >= 1.1.0 +%endif +%if %{with lcms2} +BuildRequires: pkgconfig(lcms2) >= 2.13 +%endif +BuildRequires: pkgconfig(libaribcaption) >= 1.1.1 +BuildRequires: pkgconfig(libass) +BuildRequires: pkgconfig(libbluray) +BuildRequires: pkgconfig(libbs2b) +BuildRequires: pkgconfig(libcdio) +BuildRequires: pkgconfig(libcdio_paranoia) +%if %{with chromaprint} +BuildRequires: pkgconfig(libchromaprint) +%endif +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(libjxl) >= 0.7.0 +BuildRequires: pkgconfig(libmodplug) +BuildRequires: pkgconfig(libopenjp2) +BuildRequires: pkgconfig(libopenmpt) +%if %{with placebo} +BuildRequires: pkgconfig(libplacebo) >= 4.192.0 +%endif +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(libqrencode) +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(oapv) +BuildRequires: pkgconfig(ogg) +BuildRequires: pkgconfig(openal) +BuildRequires: pkgconfig(opencore-amrnb) +BuildRequires: pkgconfig(OpenCL) +BuildRequires: pkgconfig(openh264) +BuildRequires: pkgconfig(opus) +BuildRequires: pkgconfig(rav1e) +BuildRequires: pkgconfig(rubberband) +BuildRequires: pkgconfig(sdl2) +BuildRequires: pkgconfig(shaderc) >= 2019.1 +BuildRequires: pkgconfig(smbclient) +BuildRequires: pkgconfig(snappy) +BuildRequires: pkgconfig(soxr) +BuildRequires: pkgconfig(speex) +BuildRequires: pkgconfig(srt) +BuildRequires: pkgconfig(SvtAv1Enc) >= 0.9.0 +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) >= 1.3.255 +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 vpl} +BuildRequires: pkgconfig(vpl) >= 2.6 +%endif +%if %{with evc_main} +BuildRequires: pkgconfig(xevd) +BuildRequires: pkgconfig(xeve) +%else +BuildRequires: pkgconfig(xevdb) +BuildRequires: pkgconfig(xeveb) +%endif +%if %{with x264} +BuildRequires: pkgconfig(x264) +%endif +%if %{with x265} +BuildRequires: pkgconfig(x265) +%endif +%if %{with vmaf} +BuildRequires: pkgconfig(libvmaf) %endif -Obsoletes: %{name}-free < %{epoch}:%{version}-%{release} -Provides: %{name}-free = %{epoch}:%{version}-%{release} %description -FFmpeg is a complete and free Internet live audio and video -broadcasting solution for Linux/Unix. It also includes a digital -VCR. It can encode in real time in many formats including MPEG1 audio -and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash. +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. -%package libs -Summary: Metapackage for %{name} libraries -Requires: libavcodec%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavdevice%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavfilter%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavformat%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libpostproc%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswresample%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswscale%{?_isa} = %{epoch}:%{version}-%{release} +%if %{without all_codecs} +This build of ffmpeg is limited in the number of codecs supported. +%endif -%description libs -FFmpeg is a complete and free Internet live audio and video -broadcasting solution for Linux/Unix. It also includes a digital -VCR. It can encode in real time in many formats including MPEG1 audio -and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash. -This metapackage pulls in all the %{name} libraries. +%dnl -------------------------------------------------------------------------------- -%package devel -Summary: Metapackage for %{name} development files -Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +%if ! %{with freeworld_lavc} + +%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: 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 + +%files -n %{pkg_name} +%doc CREDITS README.md +%{_bindir}/ffmpeg +%{_bindir}/ffplay +%{_bindir}/ffprobe +%{_mandir}/man1/ff*.1* +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/ffprobe.xsd +%{_datadir}/%{name}/libvpx-*.ffpreset + +%dnl -------------------------------------------------------------------------------- + +%package -n %{pkg_name}-devel +Summary: Development package for %{name} +Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libavdevice%{?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: libswresample%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: pkgconfig -%description devel -FFmpeg is a complete and free Internet live audio and video broadcasting -solution for Linux/Unix. It also includes a digital VCR. It can encode in real -time in many formats. This package contains development files for %{name}. +%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. -%package -n libavcodec +%files -n %{pkg_name}-devel +%doc MAINTAINERS doc/APIchanges doc/*.txt +%doc _doc/examples + +%dnl -------------------------------------------------------------------------------- + +%package -n libavcodec%{?pkg_suffix} Summary: FFmpeg codec library -Obsoletes: libavcodec-free < %{epoch}:%{version}-%{release} -Provides: libavcodec-free = %{epoch}:%{version}-%{release} +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} +# We require libopenh264 library, which has a dummy implementation and a real one +# In the event that this is being installed, we want to prefer openh264 if available +Suggests: openh264%{_isa} -%description -n libavcodec -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. +%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. -%package -n libavcodec-devel +%if %{without all_codecs} +This build of ffmpeg is limited in the number of codecs supported. +%endif + +%files -n libavcodec%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavcodec.so.%{av_codec_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%package -n libavcodec%{?pkg_suffix}-devel Summary: Development files for FFmpeg's codec library -Requires: libavcodec%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig -Obsoletes: libavcodec-free-devel < %{epoch}:%{version}-%{release} -Provides: libavcodec-free-devel = %{epoch}:%{version}-%{release} -%description -n 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. +%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 -Summary: FFMpeg devices muxing/demuxing library -Obsoletes: libavdevice-free < %{epoch}:%{version}-%{release} -Provides: libavdevice-free = %{epoch}:%{version}-%{release} +%files -n libavcodec%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavcodec +%{_libdir}/pkgconfig/libavcodec.pc +%{_libdir}/libavcodec.so +%{_mandir}/man3/libavcodec.3* -%description -n libavdevice -Libavdevice is a complementary library to libavf "libavformat". It provides -various "special" platform-specific muxers and demuxers, e.g. for grabbing -devices, audio capture and playback etc. +%dnl -------------------------------------------------------------------------------- -%package -n libavdevice-devel -Summary: Development files for FFMpeg devices muxing/demuxing library -Requires: libavcodec-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavdevice%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavfilter-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavformat-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} +%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. + +%files -n libavdevice%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavdevice.so.%{av_device_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%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: libswresample%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig -Obsoletes: libavdevice-free-devel < %{epoch}:%{version}-%{release} -Provides: libavdevice-free-devel = %{epoch}:%{version}-%{release} -%description -n libavdevice-devel +%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 +%files -n libavdevice%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavdevice +%{_libdir}/pkgconfig/libavdevice.pc +%{_libdir}/libavdevice.so +%{_mandir}/man3/libavdevice.3* + +%dnl -------------------------------------------------------------------------------- + +%package -n libavfilter%{?pkg_suffix} Summary: FFmpeg audio and video filtering library -Requires: libavcodec%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavformat%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libpostproc%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswresample%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswscale%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: libavfilter-free < %{epoch}:%{version}-%{release} -Provides: libavfilter-free = %{epoch}:%{version}-%{release} +Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} -%description -n libavfilter -The libavfilter library provides a generic audio/video filtering framework -containing several filters, sources and sinks. +%description -n libavfilter%{?pkg_suffix} +The libavfilter library provides a generic audio/video filtering +framework containing several filters, sources and sinks. -%package -n libavfilter-devel +%files -n libavfilter%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavfilter.so.%{av_filter_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%package -n libavfilter%{?pkg_suffix}-devel Summary: Development files for FFmpeg's audio/video filter library -Requires: libavcodec-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavfilter%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavformat-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libpostproc-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswresample-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswscale-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libavutil%{?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 -Obsoletes: libavfilter-free-devel < %{epoch}:%{version}-%{release} -Provides: libavfilter-free-devel = %{epoch}:%{version}-%{release} -%description -n libavfilter-devel +%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 +%files -n libavfilter%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavfilter +%{_libdir}/pkgconfig/libavfilter.pc +%{_libdir}/libavfilter.so +%{_mandir}/man3/libavfilter.3* + +%dnl -------------------------------------------------------------------------------- + +%package -n libavformat%{?pkg_suffix} Summary: FFmpeg's stream format library -Obsoletes: libavformat-free < %{epoch}:%{version}-%{release} -Provides: libavformat-free = %{epoch}:%{version}-%{release} +Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} -%description -n libavformat -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. +%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. -%package -n libavformat-devel +%if %{without all_codecs} +This build of ffmpeg is limited in the number of codecs supported. +%endif + +%files -n libavformat%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavformat.so.%{av_format_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%package -n libavformat%{?pkg_suffix}-devel Summary: Development files for FFmpeg's stream format library -Requires: libavcodec-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavformat%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswresample-devel%{?_isa} = %{epoch}:%{version}-%{release} +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 -Obsoletes: libavformat-free-devel < %{epoch}:%{version}-%{release} -Provides: libavformat-free-devel = %{epoch}:%{version}-%{release} -%description -n libavformat-devel +%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 -Summary: FFmpeg's utility library -Obsoletes: libavutil-free < %{epoch}:%{version}-%{release} -Provides: libavutil-free = %{epoch}:%{version}-%{release} +%files -n libavformat%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavformat +%{_libdir}/pkgconfig/libavformat.pc +%{_libdir}/libavformat.so +%{_mandir}/man3/libavformat.3* -%description -n libavutil +%dnl -------------------------------------------------------------------------------- + +%package -n libavutil%{?pkg_suffix} +Summary: FFmpeg's utility library +Group: System/Libraries +Obsoletes: libpostproc%{?pkg_suffix} < 8.0 + +%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-devel -Summary: Development files for FFmpeg's utility library -Requires: libavutil%{?_isa} = %{epoch}:%{version}-%{release} -Requires: pkgconfig -Obsoletes: libavutil-free-devel < %{epoch}:%{version}-%{release} -Provides: libavutil-free-devel = %{epoch}:%{version}-%{release} +%files -n libavutil%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavutil.so.%{av_util_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%package -n libavutil%{?pkg_suffix}-devel +Summary: Development files for FFmpeg's utility library +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: pkgconfig +Obsoletes: libpostproc%{?pkg_suffix}-devel < 8.0 + +%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). -%description -n libavutil-devel This subpackage contains the headers for FFmpeg libavutil. -%package -n libpostproc -Summary: FFmpeg post-processing library -Obsoletes: libpostproc-free < %{epoch}:%{version}-%{release} -Provides: libpostproc-free = %{epoch}:%{version}-%{release} +%files -n libavutil%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavutil +%{_libdir}/pkgconfig/libavutil.pc +%{_libdir}/libavutil.so +%{_mandir}/man3/libavutil.3* -%description -n libpostproc -A library with video postprocessing filters, such as deblocking and -deringing filters, noise reduction, automatic contrast and brightness -correction, linear/cubic interpolating deinterlacing. +%dnl -------------------------------------------------------------------------------- -%package -n libpostproc-devel -Summary: Development files for the FFmpeg post-processing library -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libpostproc%{?_isa} = %{epoch}:%{version}-%{release} -Requires: pkgconfig -Obsoletes: libpostproc-free-devel < %{epoch}:%{version}-%{release} -Provides: libpostproc-free-devel = %{epoch}:%{version}-%{release} - -%description -n libpostproc-devel -This subpackage contains the headers for FFmpeg libpostproc. - -%package -n libswresample +%package -n libswresample%{?pkg_suffix} Summary: FFmpeg software resampling library -Requires: libavutil%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: libavresemple < %{epoch}:%{version}-%{release} -Provides: libavresemple = %{epoch}:%{version}-%{release} -Obsoletes: libswresample-free < %{epoch}:%{version}-%{release} -Provides: libswresample-free = %{epoch}:%{version}-%{release} +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} -%description -n libswresample +%description -n libswresample%{?pkg_suffix} The libswresample library performs audio conversion between different sample rates, channel layout and channel formats. -%package -n libswresample-devel -Summary: Development files for the FFmpeg software resampling library -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswresample%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: libavresemple-devel < %{epoch}:%{version}-%{release} -Provides: libavresemple-devel = %{epoch}:%{version}-%{release} -Obsoletes: libswresample-free-devel < %{epoch}:%{version}-%{release} -Provides: libswresample-free-devel = %{epoch}:%{version}-%{release} +%files -n libswresample%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libswresample.so.%{swresample_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%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. -%description -n libswresample-devel This subpackage contains the headers for FFmpeg libswresample. -%package -n libswscale -Summary: FFmpeg image scaling and colorspace/pixel conversion library -Obsoletes: libswscale-free < %{epoch}:%{version}-%{release} -Provides: libswscale-free = %{epoch}:%{version}-%{release} +%files -n libswresample%{?pkg_suffix}-devel +%{_includedir}/%{name}/libswresample +%{_libdir}/pkgconfig/libswresample.pc +%{_libdir}/libswresample.so +%{_mandir}/man3/libswresample.3* -%description -n libswscale +%dnl -------------------------------------------------------------------------------- + +%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-devel -Summary: Development files for FFmpeg's image scaling and colorspace library -Requires: libavutil-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: libswscale%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: libswscale-free-devel < %{epoch}:%{version}-%{release} -Provides: libswscale-free-devel = %{epoch}:%{version}-%{release} +%files -n libswscale%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libswscale.so.%{swscale_soversion}{,.*} + +%dnl -------------------------------------------------------------------------------- + +%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. -%description -n libswscale-devel This subpackage contains the headers for FFmpeg libswscale. +%files -n libswscale%{?pkg_suffix}-devel +%{_includedir}/%{name}/libswscale +%{_libdir}/pkgconfig/libswscale.pc +%{_libdir}/libswscale.so +%{_mandir}/man3/libswscale.3* + +%endif +# freeworld_lavc bcond + +%dnl -------------------------------------------------------------------------------- + +%if %{with freeworld_lavc} +%package -n libavcodec-freeworld +Summary: FFmpeg codec library - freeworld overlay +Requires: libavutil%{?basepkg_suffix}%{_isa} >= %{version}-%{release} +Requires: libswresample%{?basepkg_suffix}%{_isa} >= %{version}-%{release} +Supplements: libavcodec%{?basepkg_suffix}%{_isa} >= %{version}-%{release} +# We require libopenh264 library, which has a dummy implementation and a real one +# In the event that this is being installed, we want to install this version +Requires: openh264%{_isa} + +%description -n libavcodec-freeworld +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 build includes the full range of codecs offered by ffmpeg. + +%files -n libavcodec-freeworld +%{_sysconfdir}/ld.so.conf.d/%{name}-%{_lib}.conf +%{_libdir}/%{name}/libavcodec.so.%{av_codec_soversion}{,.*} + +# Re-enable ldconfig_scriptlets macros +%{!?ldconfig:%global ldconfig /sbin/ldconfig} +%ldconfig_scriptlets -n libavcodec-freeworld + +%endif + +%dnl -------------------------------------------------------------------------------- + %prep -%autosetup -p1 +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -# Uncomment to enable debugging while configuring -#sed -i -e 's|#!/bin/sh|#!/bin/sh -x|g' configure +%autosetup -S git_am +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 +%conf %set_build_flags +# This is not a normal configure script, don't use %%configure ./configure \ - --arch=%{_target_cpu} \ + --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-htmlpages \ --disable-static \ --disable-stripping \ + --enable-pic \ + --enable-shared \ + --enable-gpl \ + --enable-version3 \ --enable-amf \ --enable-avcodec \ --enable-avdevice \ @@ -439,15 +741,21 @@ This subpackage contains the headers for FFmpeg libswscale. %else --disable-chromaprint \ %endif - --enable-decklink \ + --disable-cuda-nvcc \ +%if %{with ffnvcodec} + --enable-cuvid \ +%endif + --disable-decklink \ --enable-frei0r \ --enable-gcrypt \ --enable-gmp \ - --enable-gpl \ + --enable-gnutls \ --enable-gray \ --enable-iconv \ --enable-ladspa \ +%if %{with lcms2} --enable-lcms2 \ +%endif --enable-libaom \ --enable-libaribb24 \ --enable-libaribcaption \ @@ -458,30 +766,33 @@ This subpackage contains the headers for FFmpeg libswscale. --enable-libcdio \ --enable-libcodec2 \ --enable-libdav1d \ - --enable-libdavs2 \ + --disable-libdavs2 \ +%if %{with dc1394} --enable-libdc1394 \ - --enable-libdrm \ +%endif --enable-libdvdnav \ --enable-libdvdread \ --enable-libfdk-aac \ +%if %{with flite} + --enable-libflite \ +%endif --enable-libfontconfig \ --enable-libfreetype \ --enable-libfribidi \ --enable-libgme \ - --enable-libgsm \ --enable-libharfbuzz \ + --enable-libgsm \ +%if %{with dc1394} --enable-libiec61883 \ +%endif --enable-libilbc \ --enable-libjack \ --enable-libjxl \ --enable-libklvanc \ - --enable-libkvazaar \ - --enable-liblc3 \ --disable-liblensfun \ -%if %{with lcevcdec} - --enable-liblcevc-dec \ -%else --disable-liblcevc-dec \ +%if %{with lc3} + --enable-liblc3 \ %endif --enable-libmodplug \ --enable-libmp3lame \ @@ -490,11 +801,14 @@ This subpackage contains the headers for FFmpeg libswscale. --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --disable-libopencv \ + --enable-liboapv \ --enable-libopenh264 \ --enable-libopenjpeg \ --enable-libopenmpt \ --enable-libopus \ +%if %{with placebo} --enable-libplacebo \ +%endif --enable-libpulse \ --enable-libqrencode \ --disable-libquirc \ @@ -502,7 +816,9 @@ This subpackage contains the headers for FFmpeg libswscale. --enable-librav1e \ --enable-librist \ --enable-librsvg \ +%if %{with librtmp} --enable-librtmp \ +%endif --enable-librubberband \ --enable-libshaderc \ --disable-libshine \ @@ -517,39 +833,57 @@ This subpackage contains the headers for FFmpeg libswscale. --enable-libtesseract \ --enable-libtheora \ --disable-libtorch \ + --disable-libuavs3d \ --enable-libtwolame \ - --enable-libuavs3d \ --enable-libv4l2 \ --enable-libvidstab \ +%if %{with vmaf} + --enable-libvmaf \ +%endif --enable-libvo-amrwbenc \ --enable-libvorbis \ +%if %{with vpl} + --enable-libvpl \ +%endif --enable-libvpx \ - --enable-libvvenc \ --enable-libwebp \ +%if %{with x264} --enable-libx264 \ +%endif +%if %{with x265} --enable-libx265 \ - --enable-libxavs2 \ - --enable-libxavs \ +%endif + --disable-libxavs2 \ + --disable-libxavs \ --enable-libxcb \ --enable-libxcb-shape \ --enable-libxcb-shm \ --enable-libxcb-xfixes \ - --enable-libxevd \ +%if %{with evc_main} --enable-libxeve \ + --enable-libxevd \ +%else + --enable-libxeveb \ + --enable-libxevdb \ +%endif --enable-libxml2 \ --enable-libxvid \ --enable-libzimg \ --enable-libzmq \ --enable-libzvbi \ +%if %{with lto} + --enable-lto \ +%endif --enable-lv2 \ --enable-lzma \ - --enable-nonfree \ --enable-manpages \ +%if %{with ffnvcodec} + --enable-nvdec \ + --enable-nvenc \ +%endif --enable-openal \ - --enable-opencl \ - --enable-opengl \ - --enable-openssl \ - --enable-postproc \ + --disable-openssl \ + --enable-pthreads \ --enable-sdl2 \ --enable-shared \ --enable-swresample \ @@ -557,140 +891,486 @@ This subpackage contains the headers for FFmpeg libswscale. --enable-v4l2-m2m \ --enable-vaapi \ --enable-vapoursynth \ - --enable-version3 \ --enable-vdpau \ --enable-vulkan \ --enable-xlib \ --enable-zlib \ - --extra-ldflags="%{build_ldflags}" \ - --incdir=%{_includedir} \ - --libdir=%{_libdir} \ - --mandir=%{_mandir} \ - --optflags="%{build_cflags}" \ - --prefix=%{_prefix} \ - --shlibdir=%{_libdir} \ -%ifarch x86_64 aarch64 - --enable-cuda-llvm \ - --enable-cuda-nvcc \ - --enable-cuvid \ - --enable-ffnvcodec \ - --enable-nvdec \ - --enable-nvenc \ - --extra-cflags="-I%{_includedir}/cuda" \ +%if %{without all_codecs} + --enable-muxers \ + --enable-demuxers \ + --enable-hwaccels \ + --disable-encoders \ + --disable-decoders \ + --disable-decoder="h264,hevc,vc1,vvc" \ + --enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_lib}.conf +cp -pa %{buildroot}%{_libdir}/libavcodec.so.%{av_codec_soversion}{,.*} %{buildroot}%{_libdir}/%{name} +# Drop unneeded stuff +rm -f %{buildroot}%{_libdir}/*.* +rm -rf %{buildroot}%{_libdir}/pkgconfig +rm -rf %{buildroot}%{_includedir} +rm -rf %{buildroot}%{_bindir} +rm -rf %{buildroot}%{_datadir} +%endif -%files devel -%doc doc/APIchanges doc/*.txt -%doc doc/html doc/examples - -%files -n libavcodec -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavcodec.so.%{avcodec_soversion}* - -%files -n libavcodec-devel -%{_includedir}/libavcodec -%{_libdir}/pkgconfig/libavcodec.pc -%{_libdir}/libavcodec.so -%{_mandir}/man3/libavcodec.3* - -%files -n libavdevice -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavdevice.so.%{avdevice_soversion}* - -%files -n libavdevice-devel -%{_includedir}/libavdevice -%{_libdir}/pkgconfig/libavdevice.pc -%{_libdir}/libavdevice.so -%{_mandir}/man3/libavdevice.3* - -%files -n libavfilter -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavfilter.so.%{avfilter_soversion}* - -%files -n libavfilter-devel -%{_includedir}/libavfilter -%{_libdir}/pkgconfig/libavfilter.pc -%{_libdir}/libavfilter.so -%{_mandir}/man3/libavfilter.3* - -%files -n libavformat -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavformat.so.%{avformat_soversion}* - -%files -n libavformat-devel -%{_includedir}/libavformat -%{_libdir}/pkgconfig/libavformat.pc -%{_libdir}/libavformat.so -%{_mandir}/man3/libavformat.3* - -%files -n libavutil -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavutil.so.%{avutil_soversion}* - -%files -n libavutil-devel -%{_includedir}/libavutil -%{_libdir}/pkgconfig/libavutil.pc -%{_libdir}/libavutil.so -%{_mandir}/man3/libavutil.3* - -%files -n libpostproc -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libpostproc.so.%{postproc_soversion}* - -%files -n libpostproc-devel -%{_includedir}/libpostproc -%{_libdir}/pkgconfig/libpostproc.pc -%{_libdir}/libpostproc.so - -%files -n libswresample -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libswresample.so.%{swresample_soversion}* - -%files -n libswresample-devel -%{_includedir}/libswresample -%{_libdir}/pkgconfig/libswresample.pc -%{_libdir}/libswresample.so -%{_mandir}/man3/libswresample.3* - -%files -n libswscale -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libswscale.so.%{swscale_soversion}* - -%files -n libswscale-devel -%{_includedir}/libswscale -%{_libdir}/pkgconfig/libswscale.pc -%{_libdir}/libswscale.so -%{_mandir}/man3/libswscale.3* %changelog -%autochangelog +* Sat May 30 2026 Gilver E. - 1:8.1.1-1 +- Rebased build onto Fedora spec with full redistributable codec support +- Ported to Terra with permission + +* Sat May 09 2026 Dominik Mierzejewski - 8.1.1-1 +- Update to 8.1.1 +- Drop merged patch + +* Wed Apr 15 2026 Nicolas Chauvet - 8.0.1-7 +- Rebuilt for vmaf-3.1.0 + +* Thu Mar 19 2026 Nicolas Chauvet - 8.0.1-6 +- Rebuilt for libplacebo + +* Mon Mar 09 2026 Dominik Mierzejewski - 8.0.1-5 +- Rebuilt for libvpx 1.16.0 + +* Mon Feb 16 2026 Nick White - 8.0.1-4 +- Enable mov_text encoder and decoder + +* Fri Jan 16 2026 Fedora Release Engineering - 8.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Thu Dec 04 2025 Marcin Juszkiewicz - 8.0.1-2 +- disable dc1394 and ffnvcodec on risc-v + +* Fri Nov 21 2025 Dominik Mierzejewski - 8.0.1-1 +- Update to 8.0.1 (resolves rhbz#2416044) +- Split configure step to conf stage + +* Fri Nov 14 2025 Neal Gompa - 8.0-2 +- Disable lc3 only on RHEL 10 + +* Sun Nov 02 2025 Neal Gompa - 8.0-1 +- Rebase to version 8.0 + +* Sun Nov 02 2025 Dominik Mierzejewski - 7.1.2-3 +- Re-enable openal support (dropped by accident in commit 5917b714, resolves rhbz#2404091) + +* Thu Oct 02 2025 Robert-André Mauchin - 7.1.2-2 +- Rebuild for svt-av1 soname bump + +* Wed Sep 24 2025 Simone Caronni - 7.1.2-1 +- Update to 7.1.2. +- Enable VANC processing for SDI. +- Explicitly list all implicitly enabled/disabled options. + +* Tue Aug 26 2025 Neal Gompa - 7.1.1-10 +- Disable all subpackages except libavcodec-freeworld with the freeworld bcond + +* Mon Aug 25 2025 Neal Gompa - 7.1.1-9 +- Enable support for MPEG-5/EVC + +* Thu Aug 21 2025 Neal Gompa - 7.1.1-8 +- Reorganize spec to group subpackage definitions together +- Add freeworld conditional for third-party builds +- Drop unneeded scriptlets + +* Fri Aug 01 2025 Neal Gompa - 7.1.1-7 +- Always verify sources + +* Tue Jul 29 2025 Nicolas Chauvet - 7.1.1-6 +- Rebuilt for libplacebo + +* Wed Jul 23 2025 Fedora Release Engineering - 7.1.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jun 13 2025 Neal Gompa - 7.1.1-4 +- Switch to regular upstream sources for package build +- Enable more codecs + +* Sat Mar 22 2025 Songsong Zhang - 7.1.1-3 +- Add missing source files for riscv64 + +* Thu Mar 13 2025 Fabio Valentini - 7.1.1-2 +- Rebuild for noopenh264 2.6.0 + +* Thu Mar 06 2025 Dominik Mierzejewski - 7.1.1-1 +- Update to 7.1.1 (resolves rhbz#2349351) +- Enable LC3 codec via liblc3 +- Backport fix for CVE-2025-22921 (resolves rhbz#2346558) + +* Fri Feb 07 2025 Yaakov Selkowitz - 7.1-1 +- Rebase to 7.1 (rhbz#2273572) + +* Wed Feb 05 2025 Robert-André Mauchin - 7.0.2-13 +- Rebuilt for aom 3.11.0 + +* Sun Feb 02 2025 Sérgio Basto - 7.0.2-12 +- Rebuild for jpegxl (libjxl) 0.11.1 + +* Wed Jan 29 2025 Simone Caronni - 7.0.2-11 +- Rebuild for updated VapourSynth. + +* Thu Jan 16 2025 Fedora Release Engineering - 7.0.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jan 09 2025 Michel Lind - 7.0.2-9 +- Rebuilt for rubberband 4 + +* Tue Nov 12 2024 Sandro Mani - 7.0.2-8 +- Rebuild (tesseract) + +* Mon Oct 07 2024 Yaakov Selkowitz - 7.0.2-7 +- Properly enable aribb24/libaribcaption +- Disable VANC dependency as it depends on decklink + +* Mon Oct 07 2024 Neal Gompa - 7.0.2-6 +- Enable SDI data processing (Kernel Labs VANC) processing +- Enable Japanese DVD subtitles/teletext (aribb24/libaribcaption) + +* Mon Oct 07 2024 Yaakov Selkowitz - 7.0.2-5 +- Properly enable noopenh264 + +* Wed Oct 02 2024 Neal Gompa - 7.0.2-4 +- Fix chromaprint bcond + +* Wed Sep 25 2024 Michel Lind - 7.0.2-3 +- Disable omxil completely, it's now retired +- Rebuild for tesseract-5.4.1-3 (soversion change from 5.4.1 to just 5.4) + +* Fri Sep 20 2024 Neal Gompa - 7.0.2-2 +- Rebuild for newer ffnvcodec + +* Fri Sep 06 2024 Neal Gompa - 7.0.2-1 +- Rebase to 7.0.2 (rhbz#2273572) +- Drop OpenH264 dlopen headers as we use noopenh264 now +- Use modern bconds + +* Sat Aug 24 2024 Fabio Valentini - 6.1.2-1 +- Update to 6.1.2 + +* Sat Jul 20 2024 Neal Gompa - 6.1.1-19 +- Backport fixes for Mesa 24.0.6+ / 21.1.4+ changes for VA-API + +* Wed Jul 17 2024 Fedora Release Engineering - 6.1.1-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Jul 16 2024 Nicolas Chauvet - 6.1.1-17 +- Rebuilt for libplacebo/vmaf + +* Wed Jun 19 2024 Dominik Mierzejewski - 6.1.1-16 +- Backport fix for CVE-2023-49528 + +* Thu Jun 13 2024 Sandro Mani - 6.1.1-15 +- Rebuild for tesseract-5.4.1 + +* Wed May 29 2024 Robert-André Mauchin - 6.1.1-14 +- Rebuild for svt-av1 2.1.0 + +* Wed May 22 2024 Simone Caronni - 6.1.1-13 +- Rebuild for updated VapourSynth. + +* Tue Apr 23 2024 Kalev Lember - 6.1.1-12 +- Stop using bundled openh264 headers in F40+ and build against noopenh264 +- Backport a fix to build with Vulkan headers >= 1.3.280.0 + +* Wed Mar 13 2024 Sérgio Basto - 6.1.1-11 +- Rebuild for jpegxl (libjxl) 0.10.2 + +* Tue Mar 12 2024 Dominik Mierzejewski - 6.1.1-10 +- Enable drawtext filter (requires libharfbuzz) + +* Wed Feb 14 2024 Sérgio Basto - 6.1.1-9 +- Rebuild for jpegxl (libjxl) 0.9.2 with soname bump + +* Wed Feb 07 2024 Pete Walter - 6.1.1-8 +- Rebuild for libvpx 1.14.x + +* Sun Jan 28 2024 Sandro Mani - 6.1.1-7 +- Rebuild (tesseract) + +* Wed Jan 24 2024 Fedora Release Engineering - 6.1.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 6.1.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 15 2024 Neal Gompa - 6.1.1-4 +- Add missing files for some of the libraries to fix riscv64 builds + +* Fri Jan 12 2024 Fabio Valentini - 6.1.1-3 +- Rebuild for dav1d 1.3.0 + +* Fri Jan 05 2024 Florian Weimer - 6.1.1-2 +- Backport upstream patch to fix C compatibility issues + +* Thu Jan 04 2024 Neal Gompa - 6.1.1-1 +- Update to 6.1.1 + +* Thu Jan 04 2024 Neal Gompa - 6.1-1 +- Rebase to 6.1 + +* Wed Dec 06 2023 Kalev Lember - 6.0.1-2 +- Prefer openh264 over noopenh264 +- Backport upstream patch to drop openh264 runtime version checks + +* Sat Nov 11 2023 Neal Gompa - 6.0.1-1 +- Update to 6.0.1 +- Add ffmpeg chromium support patch (#2240127) +- Use git to apply patches + +* Fri Nov 10 2023 Neal Gompa - 6.0-16 +- Add patches to support enhanced RTMP and AV1 encoding through VA-API +- Force AAC decoding through fdk-aac-free + +* Sun Oct 08 2023 Dominik Mierzejewski - 6.0-15 +- Backport upstream patch to fix segfault when passing non-existent filter + option (rfbz#6773) + +* Sat Oct 07 2023 Sandro Mani - 6.0-14 +- Rebuild (tesseract) + +* Fri Sep 29 2023 Nicolas Chauvet - 6.0-13 +- Rebuilt for libplacebo + +* Fri Aug 25 2023 Dominik Mierzejewski - 6.0-12 +- Backport upstream patch to fix assembly with binutils 2.41. + +* Sat Aug 05 2023 Richard Shaw - 6.0-11 +- Rebuild for codec2. + +* Fri Jul 28 2023 Dominik Mierzejewski - 6.0-10 +- Rebuild for libplacebo + +* Wed Jul 19 2023 Fedora Release Engineering - 6.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jul 14 2023 Sandro Mani - 6.0-8 +- Rebuild (tesseract) + +* Sun Jun 18 2023 Sérgio Basto - 6.0-7 +- Mass rebuild for jpegxl-0.8.1 + +* Mon Jun 12 2023 Dominik Mierzejewski - 6.0-6 +- Rebuild for libdc1394 + +* Thu Apr 06 2023 Adam Williamson - 6.0-5 +- Rebuild (tesseract) again + +* Mon Apr 03 2023 Neal Gompa - 6.0-4 +- Include RISC-V support sources in the tarball + +* Mon Apr 03 2023 Sandro Mani - 6.0-3 +- Rebuild (tesseract) + +* Wed Mar 22 2023 Nicolas Chauvet - 6.0-2 +- Backport upstream patches for libplacebo support + +* Sun Mar 12 2023 Neal Gompa - 6.0-1 +- Rebase to version 6.0 +- Enable SVT-AV1 on all architectures +- Use oneVPL for QSV +- Switch to SPDX license identifiers + +* Wed Feb 15 2023 Neal Gompa - 5.1.2-12 +- Enable support for the RIST protocol through librist + +* Wed Feb 15 2023 Tom Callaway - 5.1.2-11 +- bootstrap off + +* Wed Feb 15 2023 Tom Callaway - 5.1.2-10 +- rebuild for libvpx (bootstrap) + +* Mon Feb 13 2023 Yaakov Selkowitz - 5.1.2-9 +- Enable lcms2, lv2, placebo, rabbitmq, xv + +* Mon Feb 13 2023 Neal Gompa - 5.1.2-8 +- Disable flite for RHEL 9 as flite is too old + +* Fri Feb 03 2023 Yaakov Selkowitz - 5.1.2-7 +- Properly enable caca, flite, gme, iec61883 + +* Mon Jan 30 2023 Neal Gompa - 5.1.2-6 +- Enable more approved codecs + +* Thu Jan 19 2023 Fedora Release Engineering - 5.1.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sun Jan 15 2023 Yaakov Selkowitz - 5.1.2-4 +- Properly enable libzvbi_teletext decoder + +* Fri Dec 23 2022 Sandro Mani - 5.1.2-3 +- Rebuild (tesseract) + +* Wed Nov 09 2022 Neal Gompa - 5.1.2-2 +- Unconditionally enable Vulkan + +* Wed Oct 12 2022 Neal Gompa - 5.1.2-1 +- Update to version 5.1.2 +- Refresh dlopen headers and patch for OpenH264 2.3.1 + +* Sun Sep 04 2022 Neal Gompa - 5.1.1-1 +- Update to version 5.1.1 +- Refresh dlopen headers for OpenH264 2.3.0 +- Disable omxil and crystalhd for RHEL + +* Wed Aug 24 2022 Neal Gompa - 5.1-1 +- Rebase to version 5.1 + +* Thu Jul 21 2022 Fedora Release Engineering - 5.0.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jul 09 2022 Richard Shaw - 5.0.1-15 +- Rebuild for codec2 1.0.4. + +* Fri Jul 08 2022 Sandro Mani - 5.0.1-14 +- Rebuild (tesseract) + +* Wed Jun 22 2022 Robert-André Mauchin - 5.0.1-13 +- Rebuilt for new aom, dav1d, rav1e and svt-av1 + +* Fri Jun 17 2022 Mamoru TASAKA - 5.0.1-12 +- Rebuild for new srt + +* Thu Jun 09 2022 Neal Gompa - 5.0.1-11 +- Ensure libavdevice-devel is pulled in with devel metapackage + +* Sun Jun 05 2022 Neal Gompa - 5.0.1-10 +- Update for OpenH264 2.2.0 + +* Tue May 31 2022 Neal Gompa - 5.0.1-9 +- Rebuild for ilbc-3.0.4 + +* Thu May 26 2022 Benjamin A. Beasley - 5.0.1-9 +- Rebuild for ilbc-3.0.4 (bootstrap) + +* Sat May 21 2022 Sandro Mani - 5.0.1-8 +- Rebuild for gdal-3.5.0 and/or openjpeg-2.5.0 + +* Fri May 20 2022 Sandro Mani - 5.0.1-7 +- Rebuild for gdal-3.5.0 and/or openjpeg-2.5.0 + +* Sun Apr 24 2022 Neal Gompa - 5.0.1-6 +- Add VAAPI encoders for mjpeg, mpeg2, vp8, and vp9 +- Ensure hwaccels for enabled codecs are turned on + +* Tue Apr 19 2022 Neal Gompa - 5.0.1-5 +- Drop unused enca build dependency + +* Tue Apr 19 2022 Neal Gompa - 5.0.1-4 +- Use shaderc for Vulkan support + +* Mon Apr 18 2022 Neal Gompa - 5.0.1-3 +- Fix codec2 support enablement + +* Mon Apr 18 2022 Dominik Mierzejewski - 5.0.1-2 +- Properly enable decoding and encoding ilbc + +* Tue Apr 12 2022 Neal Gompa - 5.0.1-1 +- Update to 5.0.1 to fix crashes with muxing MP4 video (#2073980) + +* Tue Apr 05 2022 Dominik Mierzejewski - 5.0-11 +- Enable OpenCL acceleration +- be explicit about enabled external features in configure +- enable gcrypt +- drop duplicate CFLAGS and use Fedora LDFLAGS + +* Thu Mar 10 2022 Sandro Mani - 5.0-10 +- Rebuild for tesseract 5.1.0 + +* Tue Mar 08 2022 Neal Gompa - 5.0-9 +- Drop ffmpeg chromium support patch (#2061392) + +* Fri Feb 18 2022 Neal Gompa - 5.0-8 +- Add patch to return correct AVERROR with bad OpenH264 versions + +* Fri Feb 18 2022 Neal Gompa - 5.0-7 +- Update OpenH264 dlopen patch to split dlopen code into c and h files + +* Thu Feb 17 2022 Neal Gompa - 5.0-6 +- Update OpenH264 dlopen patch to use AVERROR return codes correctly + +* Tue Feb 15 2022 Neal Gompa - 5.0-5 +- Disable hardware decoders due to broken failure modes + +* Tue Feb 15 2022 Neal Gompa - 5.0-4 +- Add support for dlopening OpenH264 +- Add tarball scripts as sources + +* Sun Feb 13 2022 Neal Gompa - 5.0-3 +- Enable more QSV and V4L2M2M codecs + +* Sun Feb 13 2022 Neal Gompa - 5.0-2 +- Enable support for more hardware codecs + +* Fri Feb 11 2022 Andreas Schneider - 5.0-1 +- Initial import (fedora#2051008) diff --git a/anda/multimedia/ffmpeg/pre.rhai b/anda/multimedia/ffmpeg/pre.rhai new file mode 100644 index 0000000000..15e097c751 --- /dev/null +++ b/anda/multimedia/ffmpeg/pre.rhai @@ -0,0 +1,5 @@ +let key = get("https://ffmpeg.org/ffmpeg-devel.asc"); +let dir = sub(`/[^/]+$`, "", __script_path); + +open_file(`${dir}/ffmpeg-devel.asc`, "w").write(key); +sh(`gpg --import --import-options import-export,import-minimal ffmpeg-devel.asc > ./ffmpeg.keyring`, #{ "cwd": dir });