How to slow middle of high frame rate video with AVFoundation

19 Views Asked by At

I have a 240FPS MP4 video,And I want to export a video that contains partial slow motion.To be specific,I want to scale the middle 5 seconds to slow motion, and other parts keep in original frame speed using method of dropping frames, Who can help me.

I can now use CMTimeMultiplyByFloat64 to expand each frame of the video by 8x like this:

CMSampleBufferRef sampleBuffer = (__bridge CMSampleBufferRef)(buffer);
CMTime pts = CMSampleBufferGetPresentationTimeStamp(sampleBuffer);
pts = CMTimeMultiplyByFloat64(pts, 1/8);
[self.adaptor appendPixelBuffer:sampleBuffer withPresentationTime:pts];

but only for the whole video, not for parts of the video

0

There are 0 best solutions below