From 3c74e076fef6ef9ae892dcfda9026ae1be83c1b0 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 --- .../main/java/androidx/media3/transformer/FrameworkMuxer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/FrameworkMuxer.java b/libraries/transformer/src/main/java/androidx/media3/transformer/FrameworkMuxer.java index 29a7968611..f590129987 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/FrameworkMuxer.java +++ b/libraries/transformer/src/main/java/androidx/media3/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) {