3
0
Fork 0
forked from mirrors/nixpkgs

handbrake: build against ffmpeg with custom patches

The Handbrake project carries a set of ffmpeg patches required for
things like proper subtitle timing.

See: https://github.com/HandBrake/HandBrake/issues/4029
This commit is contained in:
Anthony Cowley 2022-10-10 11:52:00 -04:00 committed by Peter Hoeg
parent 9c341e1ba3
commit 9c85db3a37

View file

@ -93,6 +93,51 @@ let
sha256 = "1kk11zl1mk37d4cvbc75gfndmma7vy3vkp4gmkyl92kiz6zadhyy";
};
# Handbrake maintains a set of ffmpeg patches. In particular, these
# patches are required for subtitle timing to work correctly. See:
# https://github.com/HandBrake/HandBrake/issues/4029
ffmpeg-version = "4.4.1";
ffmpeg-hb = ffmpeg-full.overrideAttrs (old: {
version = ffmpeg-version;
src = fetchurl {
url = "https://www.ffmpeg.org/releases/ffmpeg-${ffmpeg-version}.tar.bz2";
hash = "sha256-j8nyCsXtlRFanihWR63Q7t1cwamKA5raFMEyRS+YrEI=";
};
patches = old.patches or [] ++ [
"${src}/contrib/ffmpeg/A01-qsv-scale-fix-green-stripes.patch"
"${src}/contrib/ffmpeg/A02-qsv-interpolation.patch"
"${src}/contrib/ffmpeg/A03-qsv-dx11-ffmpeg44.patch"
"${src}/contrib/ffmpeg/A04-configure-ensure-the-right-libmfx-version-is-used-wh.patch"
"${src}/contrib/ffmpeg/A05-qsv-add-includedir-mfx-to-the-search-path-for-old-ve.patch"
"${src}/contrib/ffmpeg/A06-qsv-load-user-plugin-for-MFX_VERSION-2.0.patch"
"${src}/contrib/ffmpeg/A07-qsv-build-audio-related-code-when-MFX_VERSION-2.0.patch"
"${src}/contrib/ffmpeg/A08-qsvenc-don-t-support-multi-frame-encode-when-MFX_VER.patch"
"${src}/contrib/ffmpeg/A09-qsvenc-don-t-support-MFX_RATECONTROL_LA_EXT-when-MFX.patch"
"${src}/contrib/ffmpeg/A10-qsv-don-t-support-OPAQUE-memory-when-MFX_VERSION-2.0.patch"
"${src}/contrib/ffmpeg/A11-qsv-opaque-deinterlace.patch"
"${src}/contrib/ffmpeg/A12-qsv-opaque-vpp.patch"
"${src}/contrib/ffmpeg/A13-qsv-opaque-hwcontext_qsv.patch"
"${src}/contrib/ffmpeg/A14-configure-check-mfxdefs.h-instead-of-mfxvp9.h-for-MF.patch"
"${src}/contrib/ffmpeg/A15-configure-allow-user-to-build-FFmpeg-against-oneVPL.patch"
"${src}/contrib/ffmpeg/A16-qsv-add-macro-QSV_ONEVPL-for-the-oneVPL-SDK.patch"
"${src}/contrib/ffmpeg/A17-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch"
"${src}/contrib/ffmpeg/A18-qsv-new-method-hwcontext_qsv.patch"
"${src}/contrib/ffmpeg/A19-qsv-fix-session-for-d3d11-device.patch"
"${src}/contrib/ffmpeg/A20-mov-read-name-track-tag-written-by-movenc.patch"
"${src}/contrib/ffmpeg/A21-movenc-write-3gpp-track-titl-tag.patch"
"${src}/contrib/ffmpeg/A22-mov-read-3gpp-udta-tags.patch"
"${src}/contrib/ffmpeg/A23-movenc-write-3gpp-track-names-tags-for-all-available.patch"
"${src}/contrib/ffmpeg/A24-FFmpeg-devel-amfenc-Add-support-for-pict_type-field.patch"
"${src}/contrib/ffmpeg/A25-dvdsubdec-fix-processing-of-partial-packets.patch"
"${src}/contrib/ffmpeg/A26-ccaption_dec-return-number-of-bytes-used.patch"
"${src}/contrib/ffmpeg/A27-dvdsubdec-return-number-of-bytes-used.patch"
"${src}/contrib/ffmpeg/A28-dvdsubdec-use-pts-of-initial-packet.patch"
"${src}/contrib/ffmpeg/A29-matroskaenc-aac-extradata-updated.patch"
"${src}/contrib/ffmpeg/A30-ccaption_dec-fix-pts-in-real_time-mode.patch"
"${src}/contrib/ffmpeg/A32-qsv-fix-decode-10bit-hdr.patch"
];
});
versionFile = writeText "version.txt" ''
BRANCH=${versions.majorMinor version}.x
DATE=1970-01-01 00:00:01 +0000
@ -152,7 +197,7 @@ let self = stdenv.mkDerivation rec {
buildInputs = [
a52dec
dav1d
ffmpeg-full
ffmpeg-hb
fontconfig
freetype
fribidi