I am recording video with a camera that returns .mov
format then I export that video in .mp4
format and change the Quality to reduce the size of the video with the following code...
func convertMOVtoMP4(inputURL: URL, outputURL: URL, completion: @escaping (Bool) -> Void) {
let asset = AVURLAsset(url: inputURL)
DispatchQueue.main.async {
guard let exportSession = AVAssetExportSession(asset: asset,
presetName: AVAssetExportPreset960x540) else {
completion(false)
return
}
exportSession.outputURL = outputURL
exportSession.outputFileType = .mp4
exportSession.shouldOptimizeForNetworkUse = true
exportSession.exportAsynchronously {
switch exportSession.status {
case .completed:
completion(true)
default:
completion(false)
}
}
}
}
How can I modify the frame rate and bit rate when exporting video in mp4 ...