¡@

Home 

2014/10/15 ¤U¤È 10:05:09

iphone Programming Glossary: cmtimemake

How can I add overlay text on a video, then re-encode it?

http://stackoverflow.com/questions/10190333/how-can-i-add-overlay-text-on-a-video-then-re-encode-it

videoComp AVMutableVideoComposition videoComposition videoComp.renderSize videoSize videoComp.frameDuration CMTimeMake 1 30 videoComp.animationTool AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer..

Capture 60fps in iPhone app

http://stackoverflow.com/questions/10344637/capture-60fps-in-iphone-app

The AVCaptureSessionPreset1280x720 on the iPhone4s 5.1 with frame durations set to connection.videoMinFrameDuration CMTimeMake 1 60 connection.videoMaxFrameDuration CMTimeMake 1 60 gives you a stable super smooth capture. How to capture frames into.. 5.1 with frame durations set to connection.videoMinFrameDuration CMTimeMake 1 60 connection.videoMaxFrameDuration CMTimeMake 1 60 gives you a stable super smooth capture. How to capture frames into a file @60fps Capturing frames is all very well..

How can I overlap audio files and combine for iPhone in Xcode?

http://stackoverflow.com/questions/12628554/how-can-i-overlap-audio-files-and-combine-for-iphone-in-xcode

songAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 NSError error nil BOOL ok NO CMTime startTime CMTimeMakeWithSeconds 0 1 CMTime trackDuration songAsset.duration CMTime longestTime CMTimeMake 848896 44100 19.24 seconds CMTimeRange.. nil BOOL ok NO CMTime startTime CMTimeMakeWithSeconds 0 1 CMTime trackDuration songAsset.duration CMTime longestTime CMTimeMake 848896 44100 19.24 seconds CMTimeRange tRange CMTimeRangeMake startTime trackDuration Set Volume AVMutableAudioMixInputParameters.. addObject trackMix Insert audio into track ok track insertTimeRange tRange ofTrack sourceAudioTrack atTime CMTimeMake 0 44100 error error IBAction saveRecording AVMutableComposition composition AVMutableComposition composition audioMixParams..

ASSETWriterInput for making Video from UIImages on Iphone Issues

http://stackoverflow.com/questions/3983882/assetwriterinput-for-making-video-from-uiimages-on-iphone-issues

writerInput sourcePixelBufferAttributes NULL avAdaptor appendPixelBufferixelBuffer withPresentationTime CMTimeMake 1 10 2 Making the Create sample buffer. CMSampleBufferRef sampleBuffer NULL result CMSampleBufferCreateForImageBuffer kCFAllocatorDef.. appendPixelBuffer buffer withPresentationTime kCMTimeZero adaptor appendPixelBuffer buffer withPresentationTime CMTimeMake duration 1 2 Finish the session writerInput markAsFinished videoWriter endSessionAtSourceTime CMTimeMake duration 2 videoWriter.. CMTimeMake duration 1 2 Finish the session writerInput markAsFinished videoWriter endSessionAtSourceTime CMTimeMake duration 2 videoWriter finishWriting This method is not required but is used here as an example of a pixel buffer source..

Can use AVCaptureVideoDataOutput and AVCaptureMovieFileOutput at the same time?

http://stackoverflow.com/questions/4944083/can-use-avcapturevideodataoutput-and-avcapturemoviefileoutput-at-the-same-time

0 if assetWriterInput.readyForMoreMediaData pixelBufferAdaptor appendPixelBuffer imageBuffer withPresentationTime CMTimeMake frameNumber 25 frameNumber ... and to stop ensuring the output file is finished properly ... captureSession stopRunning..

AVAssetWritter does not work with audio

http://stackoverflow.com/questions/5200077/avassetwritter-does-not-work-with-audio

kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey session addOutput output output.minFrameDuration CMTimeMake 1 30 dispatch_queue_t queue dispatch_queue_create MY QUEUE NULL output setSampleBufferDelegate self queue queue dispatch_release.. recording NO writer_input markAsFinished audio_writer_input markAsFinished video_writer endSessionAtSourceTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate start_time 30 video_writer finishWriting UISaveVideoAtPathToSavedPhotosAlbum.. writer_input video_writer addInput audio_writer_input video_writer startWriting video_writer startSessionAtSourceTime CMTimeMake 0 1 start_time NSDate alloc init Here is the delegate for the audio @implementation AudioOutputBufferDelegate void captureOutput..

AVFoundation + AssetWriter: Generate Movie With Images and Audio

http://stackoverflow.com/questions/5640657/avfoundation-assetwriter-generate-movie-with-images-and-audio

30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t kRecordingFPS append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime if buffer .. urlAsset.duration ofTrack audioAssetTrack atTime audioStartTime error error audioStartTime CMTimeAdd audioStartTime CMTimeMake int audioInfo objectForKey audioDuration floatValue kRecordingFPS 0.5 kRecordingFPS AVAssetExportSession assetExport AVAssetExportSession..

Make movie file with picture Array and song file, using AVAsset

http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset

j 30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok.. 30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool.. j 30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool..

Playing many different videos on iphone using AVPlayer

http://stackoverflow.com/questions/6258573/playing-many-different-videos-on-iphone-using-avplayer

self.myView addSubview moviePlayer.view completion ^ BOOL finished self.moviePlayer.player seekToTime CMTimeMake curTime 1 self.moviePlayer playMovie else UIView animateWithDuration 0.5 delay 0.0 options UIViewAnimationTransitionFlipFromLeft.. self.otherView addSubview moviePlayer.view completion ^ BOOL finished self.moviePlayer.player seekToTime CMTimeMake curTime 1 self.moviePlayer playMovie And last the gesture action void handleSwipeFromLeft UISwipeGestureRecognizer recognizer..

How to combine video clips with different orientation using AVFoundation

http://stackoverflow.com/questions/6575128/how-to-combine-video-clips-with-different-orientation-using-avfoundation

AVMutableVideoComposition videoComposition AVMutableVideoComposition videoComposition videoComposition.frameDuration CMTimeMake 1 30 videoComposition.renderScale 1.0 AVMutableVideoCompositionInstruction instruction AVMutableVideoCompositionInstruction.. sourceVideoTrack.naturalSize if size.width size.height layerInstruction setTransform transform atTime CMTimeMakeWithSeconds time 30 else float s size.width size.height CGAffineTransform new CGAffineTransformConcat transform CGAffineTransformMakeScale.. newer CGAffineTransformConcat new CGAffineTransformMakeTranslation x 0 layerInstruction setTransform newer atTime CMTimeMakeWithSeconds time 30 ok compositionVideoTrack insertTimeRange sourceVideoTrack.timeRange ofTrack sourceVideoTrack atTime composition..

Setting AVMutableComposition's frameDuration

http://stackoverflow.com/questions/9725193/setting-avmutablecompositions-frameduration

is exported using an AVMutableComposition on which the frameDuration is set like that videoComposition.frameDuration CMTimeMake 1 30 30 fps For some reason changing the 30 to 25 does not change the framerate of the video exported with the AVAssetExportSession..