I'm using AVCaptureFileOutputRecordingDelegate - didFinishRecordingToOutputFileAt inside my custom camera UI, but I don't want to pass for this method because the video is been saved when it finish recording. For legacy reasons I can't save the video locally, then to take it in a static instance and delete it from local. How can I do that ?
Asked
Active
Viewed 148 times
1
-
After the reply of Bluewings, i tried to make a video from array of UIImages (using the example on this post: https://stackoverflow.com/questions/40788480/how-do-i-export-uiimage-array-as-a-movie-in-swift-3) that i took from the method **captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!)** but it always save the video on temp folder and then delete it. How can i create video from [UIImage] without save it in temp folder ? – Ridney Jul 26 '17 at 10:15
1 Answers
1
AVFoundation
framework has only the following output for a capture session.
AVCaptureMovieFileOutput
- to record and output a movie fileAVCaptureVideoDataOutput
- process frames from video being capturesAVCaptureAudioDataOuput
- process audio data being capturesAVCaptureStillImageOutput
- to capture still image output
Since you don't want to save the recorded video to a file. The other best option would be using AVCaptureVideoDataOutput
and get each frame on a continuous recording video and create a video from image buffer. To make a note you will not have audio output in this case. Again we can add AVCaptureAudioDataOuput
and embed the audio separately on our recorded video. But this workaround will not work for higher frame rates. So best suggestion to save the video into temp folder and delete it later.

Bluewings
- 3,438
- 3
- 18
- 31