Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same problem, and I think it is possibly because you have not configured your <code>AVAssetWriterInput</code> correctly. My pool started working after I had done this. In particular, the pool would not give me pixel buffers unless I had provided data in <code>AVVideoCompressionPropertiesKey</code>. First, create and fully configure the <code>AVAssetWriter</code> ( Look in <code>/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoSettings.h</code> for keys &amp; values for <code>outputSettings</code> and <code>compressionSettings</code>):</p> <pre><code>NSError * err = 0; AVAssetWriter * outputWriter = [AVAssetWriter assetWriterWithURL: [NSURL fileURLWithPath:outputPath] fileType: AVFileTypeAppleM4V error: &amp; err]; NSMutableDictionary * outputSettings = [[NSMutableDictionary alloc] init]; [outputSettings setObject: AVVideoCodecH264 forKey: AVVideoCodecKey]; [outputSettings setObject: [NSNumber numberWithInt: width_] forKey: AVVideoWidthKey]; [outputSettings setObject: [NSNumber numberWithInt: height_] forKey: AVVideoHeightKey]; NSMutableDictionary * compressionProperties = [[NSMutableDictionary alloc] init]; [compressionProperties setObject: [NSNumber numberWithInt: 1000000] forKey: AVVideoAverageBitRateKey]; [compressionProperties setObject: [NSNumber numberWithInt: 16] forKey: AVVideoMaxKeyFrameIntervalKey]; [compressionProperties setObject: AVVideoProfileLevelH264Main31 forKey: AVVideoProfileLevelKey]; [outputSettings setObject: compressionProperties forKey: AVVideoCompressionPropertiesKey]; AVAssetWriterInput * writerInput = [AVAssetWriterInput assetWriterInputWithMediaType: AVMediaTypeVideo outputSettings: outputSettings]; [compressionProperties release]; [outputSettings release]; </code></pre> <p>Create the pixel buffer adaptor:</p> <pre><code>NSMutableDictionary * pixBufSettings = [[NSMutableDictionary alloc] init]; [pixBufSettings setObject: [NSNumber numberWithInt: kCVPixelFormatType_32BGRA] forKey: (NSString *) kCVPixelBufferPixelFormatTypeKey]; [pixBufSettings setObject: [NSNumber numberWithInt: width_] forKey: (NSString *) kCVPixelBufferWidthKey]; [pixBufSettings setObject: [NSNumber numberWithInt: height_] forKey: (NSString *) kCVPixelBufferHeightKey]; AVAssetWriterInputPixelBufferAdaptor * outputPBA = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput: outputInput sourcePixelBufferAttributes: nil]; </code></pre> <p>Then retrieve pixel buffers from its pool using:</p> <pre><code>CVReturn res = CVPixelBufferPoolCreatePixelBuffer (NULL , [outputPBA pixelBufferPool] , &amp; outputFrame); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload