Skip to content

Commit cca0e7f

Browse files
committed
[FIX]: 시뮬레이터에서 비디오의 HDR이 적용돼지 않는 사항 적용
1 parent c6a7e37 commit cca0e7f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Feature/Feature/SharedVideoEditView/VideoMerger/VideoMerger.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ enum VideoMerger {
9999
videoComposition.frameDuration = CMTime(value: 1, timescale: frameRate)
100100
videoComposition.renderSize = resultSize
101101
videoComposition.instructions = layerInstructions
102+
//hdr무시
103+
videoComposition.colorPrimaries = AVVideoColorPrimaries_ITU_R_709_2
104+
videoComposition.colorTransferFunction = AVVideoTransferFunction_ITU_R_709_2
105+
videoComposition.colorYCbCrMatrix = AVVideoYCbCrMatrix_ITU_R_709_2
102106

103107
return (composition, videoComposition)
104108
}

Feature/Feature/SharedVideoEditView/View/VideoPlayer/VideoPlayerView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ extension VideoPlayerView {
6363
}
6464

6565
func replaceVideo(playerItem: AVPlayerItem) {
66+
//hdr무시
67+
let videoComposition = AVMutableVideoComposition(propertiesOf: playerItem.asset)
68+
videoComposition.colorPrimaries = AVVideoColorPrimaries_ITU_R_709_2
69+
videoComposition.colorTransferFunction = AVVideoTransferFunction_ITU_R_709_2
70+
videoComposition.colorYCbCrMatrix = AVVideoYCbCrMatrix_ITU_R_709_2
71+
playerItem.videoComposition = videoComposition
6672
player.pause()
6773
player.replaceCurrentItem(with: playerItem)
6874
}

0 commit comments

Comments
 (0)