¡@

Home 

2014/10/15 ¤U¤È 10:12:51

iphone Programming Glossary: presenttime

Merge Two Video files in iPhone Application

http://stackoverflow.com/questions/10071029/merge-two-video-files-in-iphone-application

CMTime frameTime CMTimeMake pframetime 25 CMTime lastTime CMTimeMake i 1 i is from 0 to 19 of the loop above CMTime presentTime CMTimeAdd lastTime frameTime if i 0 buffer self pixelBufferFromCGImage UIImage imageNamed @ 1.jpeg CGImage else buffer.. isReadyForMoreMediaData NSThread sleepForTimeInterval 0.05 adaptor appendPixelBuffer buffer withPresentationTime presentTime i if buffer CVBufferRelease buffer NSThread sleepForTimeInterval 0.1 writerInput markAsFinished videoWriter finishWriting..

AVAssetWriter Woes

http://stackoverflow.com/questions/6189535/avassetwriter-woes

a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero buffer NULL lastTime kCMTimeZero presentTime kCMTimeZero return YES Next the two methods that append the writer and create the pixel buffer to append. void writeImageToMovie.. CMTime frameTime CMTimeMake 1 20 CMTime lastTime CMTimeMake i 20 i is from 0 to 24 of the loop above CMTime presentTime CMTimeAdd lastTime frameTime buffer self pixelBufferFromCGImage image BOOL success adaptor appendPixelBuffer buffer withPresentationTime.. frameTime buffer self pixelBufferFromCGImage image BOOL success adaptor appendPixelBuffer buffer withPresentationTime presentTime if success NSLog @ Failed to appendPixelBuffer CVPixelBufferRelease buffer presentTime CMTimeAdd lastTime CMTimeMake 5 1000..