Skip to content

Commit

Permalink
fix(toDash): Add missing transfer characteristics for h264 streams (#631
Browse files Browse the repository at this point in the history
)
  • Loading branch information
absidue authored Apr 9, 2024
1 parent d4a9387 commit 0107049
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/StreamingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 = {
Expand Down

0 comments on commit 0107049

Please sign in to comment.