From 98c981f6f2fcb49aa63da689bb1a8e1b099ad887 Mon Sep 17 00:00:00 2001 From: claincly Date: Wed, 9 Nov 2022 18:05:24 +0000 Subject: [PATCH] Set HDR color info on FrameworkMuxer Not setting the color info results in a missing "colr" box in the produced container, under file/moov/trak/mdia/minf/stbl/stsd/hvc1. This means extractors will not be able to find out the transcoded file is HDR. In `Transformer`, this means it can't transcode this transcoded file, because it currently relies on the container bearing HDR info to construct the transcoding sample pipeline. PiperOrigin-RevId: 487276712 (cherry picked from commit d6c8e3a8aff07be5c184473826753047bf4b2387) --- .../google/android/exoplayer2/transformer/FrameworkMuxer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java index bddae7b37d..ccc94543e9 100644 --- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java +++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java @@ -124,6 +124,7 @@ import java.nio.ByteBuffer; } else { mediaFormat = MediaFormat.createVideoFormat(castNonNull(sampleMimeType), format.width, format.height); + MediaFormatUtil.maybeSetColorInfo(mediaFormat, format.colorInfo); try { mediaMuxer.setOrientationHint(format.rotationDegrees); } catch (RuntimeException e) {