Skip to content

Commit e57838d

Browse files
clainclymicrokatz
authored andcommitted
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 3c74e07)
1 parent dddc602 commit e57838d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/transformer/src/main/java/androidx/media3/transformer/FrameworkMuxer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public int addTrack(Format format) throws MuxerException {
124124
} else {
125125
mediaFormat =
126126
MediaFormat.createVideoFormat(castNonNull(sampleMimeType), format.width, format.height);
127+
MediaFormatUtil.maybeSetColorInfo(mediaFormat, format.colorInfo);
127128
try {
128129
mediaMuxer.setOrientationHint(format.rotationDegrees);
129130
} catch (RuntimeException e) {

0 commit comments

Comments
 (0)