¡@

Home 

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

iphone Programming Glossary: cmtime

Getting thumbnail from a video url or data in IPhone SDK

http://stackoverflow.com/questions/1347562/getting-thumbnail-from-a-video-url-or-data-in-iphone-sdk

alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime.. initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef.. CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult result NSError error if result..

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

videoWriterInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int.. if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool.. printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput.. pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer..

Getting thumbnail from a video url or data in IPhone SDK

http://stackoverflow.com/questions/1347562/getting-thumbnail-from-a-video-url-or-data-in-iphone-sdk

options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult.. AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult result NSError.. asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult result NSError error if result AVAssetImageGeneratorSucceeded NSLog @ couldn't generate..

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

YES videoWriter addInput audioWriterInput videoWriter addInput videoWriterInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray.. andSize size BOOL append_ok NO int j 0 while append_ok 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 adaptor appendPixelBuffer.. append_ok NO int j 0 while append_ok 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 adaptor appendPixelBuffer buffer withPresentationTime..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

a frame I lock the base address of the pixel buffer CVPixelBufferLockBaseAddress pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer pixel_buffer withPresentationTime.. the base address of the pixel buffer CVPixelBufferLockBaseAddress pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer pixel_buffer withPresentationTime currentTime NSLog..

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

sourceAudioTrack 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.. 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.. 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 tRange CMTimeRangeMake..

Getting thumbnail from a video url or data in IPhone SDK

http://stackoverflow.com/questions/1347562/getting-thumbnail-from-a-video-url-or-data-in-iphone-sdk

generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im.. alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime.. TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult result NSError error if result AVAssetImageGeneratorSucceeded..

IOSurfaces - Artefacts in video and unable to grab video surfaces

http://stackoverflow.com/questions/14135215/iosurfaces-artefacts-in-video-and-unable-to-grab-video-surfaces

IOSurfaceGetBaseAddress destSurf IOSurfaceGetBytesPerRow destSurf NULL NULL NULL sampleBuffer CMTime frameTime CMTimeMake frameCount int32_t 5 adaptor appendPixelBuffer sampleBuffer withPresentationTime frameTime CFRelease.. IOSurfaceGetBaseAddress destSurf IOSurfaceGetBytesPerRow destSurf NULL NULL NULL sampleBuffer CMTime frameTime CMTimeMake frameCount int32_t 5 adaptor appendPixelBuffer sampleBuffer withPresentationTime frameTime CFRelease sampleBuffer CFRelease..

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

videoWriter addInput videoWriterInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for UIImage img in imageArray buffer self.. while append_ok j 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.. 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..

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

videoWriter addInput videoWriterInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer.. while append_ok 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.. 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..

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

composition addMutableTrackWithMediaType AVMediaTypeAudio preferredTrackID kCMPersistentTrackID_Invalid CMTime startTime kCMTimeZero videoClipPaths is a array of paths of the video clips recorded for loop to combine clips into a single.. addMutableTrackWithMediaType AVMediaTypeAudio preferredTrackID kCMPersistentTrackID_Invalid CMTime startTime kCMTimeZero videoClipPaths is a array of paths of the video clips recorded for loop to combine clips into a single video for NSInteger.. 0 compositionVideoTrack setPreferredTransform videoTrack.preferredTransform ok compositionVideoTrack insertTimeRange CMTimeRangeMake kCMTimeZero asset duration ofTrack videoTrack atTime startTime error nil ok compositionAudioTrack insertTimeRange..

Combining two .caf files on iPhone

http://stackoverflow.com/questions/7656512/combining-two-caf-files-on-iphone

sourceAudioTrack 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.. 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.. 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 tRange CMTimeRangeMake..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

pixel buffer CVPixelBufferLockBaseAddress pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer.. pixel_buffer 0 and then simply feed it into my asset writer to be encoded CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer pixel_buffer..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

recording with the following startTime NSDate date assetWriter startWriting assetWriter startSessionAtSourceTime kCMTimeZero I grab and encode a color swizzled frame using the following CVPixelBufferRef pixel_buffer NULL CVReturn status CVPixelBufferPoolCreatePixelBuffer.. to add a check here because if two consecutive times with the same value are added to the movie it aborts recording CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer.. because if two consecutive times with the same value are added to the movie it aborts recording CMTime currentTime CMTimeMakeWithSeconds NSDate date timeIntervalSinceDate startTime 120 if assetWriterPixelBufferInput appendPixelBuffer pixel_buffer..