Skip to content

Commit 098674e

Browse files
committed
docs(studio): trim the proxy tone-map comments to the comment ratchet
1 parent d111c2b commit 098674e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎packages/studio-server/src/helpers/proxyTranscoder.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,12 @@ async function runFfmpeg(
328328
if (!ffmpegPath) {
329329
throw new FfmpegUnavailableError();
330330
}
331-
// Tone-map what renders tone-map: a PQ or HLG transfer. The tone map discards
332-
// alpha, so the alpha-preserving VP8 variant keeps its source colour values.
331+
const keepsAlpha = variant === "vp8";
333332
const { hdrTransfer } = metadata.color;
334-
const toneMap = (hdrTransfer === "pq" || hdrTransfer === "hlg") && variant !== "vp8";
333+
const toneMap = (hdrTransfer === "pq" || hdrTransfer === "hlg") && !keepsAlpha;
335334
if (toneMap) await ensureHdrFilters(ffmpegPath);
336335
const evenScale = "scale=trunc(iw/2)*2:trunc(ih/2)*2";
337-
const pixelFormat = variant === "vp8" ? "yuva420p" : "yuv420p";
336+
const pixelFormat = keepsAlpha ? "yuva420p" : "yuv420p";
338337
// The tone map ends in RGB; older ffmpeg (seen on 5.1) converts it with BT.601 unless the matrix is named.
339338
const videoFilter = toneMap
340339
? [

0 commit comments

Comments
 (0)