My app captures a video clip for 3 seconds, and programmatically I want to create a 15 sec clip from recorded 3 sec clip by looping it 5 times. And finally have to save 15 sec clip in CameraRoll.
I have got my 3 sec video clip via AVCaptureMovieFileOutput
and I have its NSURL
from delegate which is currently in NSTemporaryDirectory()
.
I am using AVAssetWriterInput
for looping it. But it ask for CMSampleBufferRef
like :
[writerInput appendSampleBuffer:sampleBuffer];
How will I gee this CMSampleBufferRef
from video in NSTemporaryDirectory() ?
I have seen code for converting UIImage
to CMSampleBufferRef
, but I can find any for video file.
Any suggestion will be helpful. :)