fix(toDash): Add missing transfer characteristics for h264 streams (#631)

This commit is contained in:
absidue
2024-04-09 22:41:08 +02:00
committed by GitHub
parent d4a938771b
commit 010704929f

View File

@@ -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 = {