do { try FileManager.default.removeItem(at: url) } catch { completion(MediaProcessResult(processedUrl: nil, image: nil), error) }
runs into the catch block when the temp file doesn't exist. This is every time you are processing the first time (i.e. you have clean new install of your app). This should not try to remove the file if it doesn't exist (which needs to be checked first).
Btw, I'd also recommend to stop processing on completion.
in MediaVideoProcessor
do { try FileManager.default.removeItem(at: url) } catch { completion(MediaProcessResult(processedUrl: nil, image: nil), error) }
runs into the catch block when the temp file doesn't exist. This is every time you are processing the first time (i.e. you have clean new install of your app). This should not try to remove the file if it doesn't exist (which needs to be checked first).Btw, I'd also recommend to stop processing on completion.