-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
I'm on an iPhone 16 Pro Simulator with iOS 18.2 and none of the following three videos that I've attached can be compressed.
https://github.com/user-attachments/assets/2daa82bf-423a-4305-ae79-93f4b3d77b34
https://github.com/user-attachments/assets/aaff7392-9560-4463-8dee-74d2c53064fb
https://github.com/user-attachments/assets/70bbf4df-efbe-48cf-8193-e336bfbe478b
This is my swift code:
let exporter = NextLevelSessionExporter(withAsset: AVAsset.init(url: URL(fileURLWithPath: fileHandler.absolutePath(path: source))))
exporter.outputFileType = mimeType.avFileType()
exporter.outputURL = URL(fileURLWithPath: fileHandler.absolutePath(path: target))
exporter.audioOutputConfiguration = [
AVFormatIDKey: kAudioFormatMPEG4AAC,
AVEncoderBitRateKey: Int(audioBitRate),
AVNumberOfChannelsKey: 2,
AVSampleRateKey: NSNumber(value: Float(audioSampleRate))
]
exporter.videoOutputConfiguration = [
AVVideoCodecKey: AVVideoCodecType.h264,
AVVideoWidthKey: Int(size.width),
AVVideoHeightKey: Int(size.height),
AVVideoScalingModeKey: AVVideoScalingModeResizeAspectFill,
AVVideoCompressionPropertiesKey: [
AVVideoAverageBitRateKey: NSNumber(value: videoBitRate),
AVVideoProfileLevelKey: AVVideoProfileLevelH264HighAutoLevel as String,
] as [String : Any]
]
exporter.export(...)The update from 0.4.6 to 0.4.7 with #51 helped in some cases, but there are still some that are not working.