¡@

Home 

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

iphone Programming Glossary: pixelbuffer

ASSETWriterInput for making Video from UIImages on Iphone Issues

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

sample buffer. CMSampleBufferRef sampleBuffer NULL result CMSampleBufferCreateForImageBuffer kCFAllocatorDef ault pixelBuffer true NULL NULL videoInfo timing sampleBuffer Ship out the frame. NSParameterAssert CMSampleBufferDataIsReady sample Buffer.. videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Write samples CVPixelBufferRef buffer Utils pixelBufferFromCGImage image.CGImage size size adaptor appendPixelBuffer buffer withPresentationTime kCMTimeZero adaptor appendPixelBuffer.. 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 NSNumber numberWithBool..

How to get the Y component from CMSampleBuffer resulted from the AVCaptureSession?

http://stackoverflow.com/questions/4085474/how-to-get-the-y-component-from-cmsamplebuffer-resulted-from-the-avcapturesessio

didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection CVImageBufferRef pixelBuffer CMSampleBufferGetImageBuffer sampleBuffer CVPixelBufferLockBaseAddress pixelBuffer 0 unsigned char rawPixelBase unsigned.. connection CVImageBufferRef pixelBuffer CMSampleBufferGetImageBuffer sampleBuffer CVPixelBufferLockBaseAddress pixelBuffer 0 unsigned char rawPixelBase unsigned char CVPixelBufferGetBaseAddress pixelBuffer Do something with the raw pixels here.. CVPixelBufferLockBaseAddress pixelBuffer 0 unsigned char rawPixelBase unsigned char CVPixelBufferGetBaseAddress pixelBuffer Do something with the raw pixels here CVPixelBufferUnlockBaseAddress pixelBuffer 0 You could then figure out the location..

AVAssetWritter does not work with audio

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

Error withType ERROR else CMTime pt CMSampleBufferGetPresentationTimeStamp sampleBuffer flipBuffer sampleBuffer pixelBuffer if bufferWriter adaptor appendPixelBuffer pixelBuffer withPresentationTime pt self delegateMessage @ Video Writing Error.. sampleBuffer flipBuffer sampleBuffer pixelBuffer if bufferWriter adaptor appendPixelBuffer pixelBuffer withPresentationTime pt self delegateMessage @ Video Writing Error withType ERROR @catch NSException e NSLog @ Video..

AVAssetWriter Woes

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

method was to use the recommended AVAssetWriterInputPixelBufferAdaptor and then pull pixel buffers from the adaptors pixelBufferPool with CVPixelBufferPoolCreatePixelBuffer. That also works on the simulator but fails on the device because the adaptor's.. nil retain CVPixelBufferPoolCreate kCFAllocatorSystemDefault NULL CFDictionaryRef bufferAttributes pixelBufferPool Create buffer pool NSMutableDictionary attributes attributes NSMutableDictionary dictionary int width 480 int height.. kCVPixelBufferHeightKey CVReturn theError CVPixelBufferPoolCreate kCFAllocatorDefault NULL CFDictionaryRef attributes pixelBufferPool NSParameterAssert writerInput NSParameterAssert videoWriter canAddInput writerInput videoWriter addInput writerInput..

iOS CVImageBuffer distorted from AVCaptureSessionDataOutput with AVCaptureSessionPresetPhoto

http://stackoverflow.com/questions/6540710/ios-cvimagebuffer-distorted-from-avcapturesessiondataoutput-with-avcapturesessio

didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection CVImageBufferRef pixelBuffer CMSampleBufferGetImageBuffer sampleBuffer self.delegate processNewCameraFrame pixelBuffer 6 Then the delegate processes.. connection CVImageBufferRef pixelBuffer CMSampleBufferGetImageBuffer sampleBuffer self.delegate processNewCameraFrame pixelBuffer 6 Then the delegate processes draws them void processNewCameraFrame CVImageBufferRef cameraFrame CVPixelBufferLockBaseAddress.. question This was a doozy. As Lio Ben Kereth pointed out the padding is 48 as you can see from the debugger gdb po pixelBuffer CVPixelBuffer 0x2934d0 width 852 height 640 bytesPerRow 3456 pixelFormat BGRA # 3456 852 4 48 OpenGL can compensate for..