¡@

Home 

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

iphone Programming Glossary: cvpixelbufferref

how to convert a CVImageBufferRef to UIImage

http://stackoverflow.com/questions/3152259/how-to-convert-a-cvimagebufferref-to-uiimage

reasonably assume is due to performance considerations. Caveat I've not done this and am assuming that accessing the CVPixelBufferRef contents like this is a reasonable way to build the image. I can't vouch for this actually working but I can tell you that..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

fill in a lot of blanks but I think that the only really hard remaining part is getting a pixel buffer from a CGImage CVPixelBufferRef newPixelBufferFromCGImage CGImageRef image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool.. kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB..

ASSETWriterInput for making Video from UIImages on Iphone Issues

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

writerInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Write samples CVPixelBufferRef buffer Utils pixelBufferFromCGImage image.CGImage size size adaptor appendPixelBuffer buffer withPresentationTime kCMTimeZero.. 2 videoWriter finishWriting This method is not required but is used here as an example of a pixel buffer source CVPixelBufferRef pixelBufferFromCGImage CGImageRef image size CGSize size NSDictionary options NSDictionary dictionaryWithObjectsAndKeys.. kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault size.width size.height kCVPixelFormatType_32ARGB..

AVFoundation + AssetWriter: Generate Movie With Images and Audio

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

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 pixelBufferFromCGImage.. markAsFinished videoWriter finishWriting NSLog @ Write Ended And now the code for pixelBufferFromCGImage CVPixelBufferRef pixelBufferFromCGImage CGImageRef image andSize CGSize size NSDictionary options NSDictionary dictionaryWithObjectsAndKeys.. kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault size.width size.height kCVPixelFormatType_32ARGB..

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

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.. markAsFinished Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero CVPixelBufferRef buffer NULL Write all picture array in movie file. int frameCount 0 for int i 0 i m_PictArray count i buffer self pixelBufferFromCGImage.. 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 m_PictArray count i buffer self pixelBufferFromCGImage..

AVAssetWriter Woes

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

presentTime CMTimeAdd lastTime CMTimeMake 5 1000 lastTime presentTime else NSLog @ error writerInput not ready CVPixelBufferRef pixelBufferFromCGImage CGImageRef image CVPixelBufferRef pxbuffer NSDictionary options NSDictionary dictionaryWithObjectsAndKeys.. presentTime else NSLog @ error writerInput not ready CVPixelBufferRef pixelBufferFromCGImage CGImageRef image CVPixelBufferRef pxbuffer NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey.. CVPixelBufferPoolCreate there's already a pixel buffer pool created in the adaptor object so call just this instead CVPixelBufferRef pixelBuffer NULL CVPixelBufferPoolCreatePixelBuffer NULL adaptor.pixelBufferPool pixelBuffer CVPixelBufferLockBaseAddress..

Having trouble creating UIImage from CIImage in iOS5

http://stackoverflow.com/questions/7788438/having-trouble-creating-uiimage-from-ciimage-in-ios5

captureOutput didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection CVPixelBufferRef pb CMSampleBufferGetImageBuffer sampleBuffer CIImage ciImage CIImage imageWithCVPixelBuffer pb self.imageView.image UIImage..

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

texture cache. Once you render your scene into that FBO the BGRA pixels for that scene will be contained within your CVPixelBufferRef so there will be no need to pull them down using glReadPixels . This is much much faster than using glReadPixels in my benchmarks...

Record the drawing as a m4v video file - OpenGL

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

assetWriter startSessionAtSourceTime kCMTimeZero I grab and encode a color swizzled frame using the following CVPixelBufferRef pixel_buffer NULL CVReturn status CVPixelBufferPoolCreatePixelBuffer NULL assetWriterPixelBufferInput pixelBufferPool pixel_buffer..