I attempt to export video from Photo Library, but the export callback is never executed. I periodically check the progress of the export, and the progress is always zero.
The code below works in 99.9% cases, but sometimes on some devices (absolutely randomly) it stops working and only restart of the iPhone helps.
AVAssetExportSession.Status always in waiting state
import AVFoundation
let asset = AVAsset()
let outputURL = URL(string: "some url")!
let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPreset1280x720)
exportSession?.outputFileType = .mov
exportSession?.outputURL = outputURL
try? FileManager.default.removeItem(at: outputURL)
exportSession?.exportAsynchronously(completionHandler: {
print("sometimes never calls")
})
Other video apps also freezes (Filto, Videoleap):
from AVAssetExportSession stuck (not starting) export


No comments:
Post a Comment