Open smrkdrhashone opened 1 month ago
Update
possible solution for this might be to rotate the video at the save time, I also changed dimensions for rotation of 90 degrees like below:
let exporter = VideoX(provider: provider)
let _ = exporter.export (
options: [
.ExportSessionPresetName: AVAssetExportPresetHighestQuality,
.VideoCompositionRenderSize: rotation == 90 ? CGSize(width: size.height, height: size.width) : .zero
],
instructions: [filtering]
) { [weak self] res in
switch res {
case .success(let url):
DispatchQueue.main.async { [weak self] in
guard let self else { return }
video.play()
ProgressHUD.dismiss()
saveVideoWithOrientation (
url: url,
transform: .init(
rotationAngle: CGFloat(Degree(value: rotation).radians)
)
)
}
case .failure(let error):
print(error.localizedDescription)
}
} progress: { pro in
print(pro)
}
C7Rotate filter is not working when exporting, it even messes up another filters as well, I noticed in C7Collector file while applying the filters we fix the orientation using this.
but when exporting we just pass the block in the FilterInstruction.
I also tried manually rotating the video but it is much more memory occupying task as I want to save the video in its original quality.