I'm trying to write a mp4 using AVFoundation and AVAssetWriter.
I'm configuring my compression as follows:
NSDictionary* compressionSettings = @{ AVVideoAverageBitRateKey : @(1048576),
AVVideoMaxKeyFrameIntervalKey : @(12),
AVVideoProfileLevelKey : AVVideoProfileLevelH264HighAutoLevel,
(NSString*)kVTCompressionPropertyKey_AllowFrameReordering : @(NO),
(NSString*)kVTCompressionPropertyKey_H264EntropyMode : (NSString*)kVTH264EntropyMode_CAVLC
};
AVAssetWriterInput* videoInput = [[AVAssetWriterInput alloc] initWithMediaType:AVMediaTypeVideo outputSettings:outputSettings];
While this is working great - when I analyze the file it tells me, that the entropy is using 2 reference frames, where I need only one.
None of the keys that are available in AVVideoSettings.h or VTVideoCompressionProperties.h seem to do the trick.
Is there a way to configure the AVAssetWriterInput in such a way, that the H.264 stream will only use 1 reference frame?