Skip to content

Commit

Permalink
Tag color information on asset writer
Browse files Browse the repository at this point in the history
  • Loading branch information
finnvoor committed Dec 30, 2023
1 parent 056353f commit b876f07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Upscaling/UpscalingExportSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ public class UpscalingExportSession {
let videoInput = AVAssetWriterInput(mediaType: .video, outputSettings: [
AVVideoWidthKey: outputSize.width,
AVVideoHeightKey: outputSize.height,
AVVideoCodecKey: videoCodec
AVVideoCodecKey: videoCodec,
AVVideoColorPropertiesKey: [
AVVideoColorPrimariesKey: formatDescription?.colorPrimaries,
AVVideoTransferFunctionKey: formatDescription?.colorTransferFunction,
AVVideoYCbCrMatrixKey: formatDescription?.colorYCbCrMatrix
]
])
videoInput.expectsMediaDataInRealTime = false
if assetWriter.canAdd(videoInput) {
Expand Down

0 comments on commit b876f07

Please sign in to comment.