From 010704929fa4b737f68a5a1f10bf0b166cfbf905 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:41:08 +0200 Subject: [PATCH] fix(toDash): Add missing transfer characteristics for h264 streams (#631) --- src/utils/StreamingInfo.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/StreamingInfo.ts b/src/utils/StreamingInfo.ts index ff0b7819..696f6107 100644 --- a/src/utils/StreamingInfo.ts +++ b/src/utils/StreamingInfo.ts @@ -465,9 +465,6 @@ function getColorInfo(format: Format) { if (color_info.transfer_characteristics) { transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS[color_info.transfer_characteristics]; - } else if (getStringBetweenStrings(format.mime_type, 'codecs="', '"')?.startsWith('avc1')) { - // YouTube's h264 streams always seem to be SDR, so this is a pretty safe bet. - transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS.BT709; } if (color_info.matrix_coefficients) { @@ -486,6 +483,9 @@ function getColorInfo(format: Format) { + `InnerTube client: ${url.searchParams.get('c')}\nformat:`, anonymisedFormat); } } + } else if (getStringBetweenStrings(format.mime_type, 'codecs="', '"')?.startsWith('avc1')) { + // YouTube's h264 streams always seem to be SDR, so this is a pretty safe bet. + transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS.BT709; } const info: ColorInfo = {