我用AVFoundation框架在ios上做了实时视频处理,此链接.i帮助下测试了它是否正常工作。现在我想使用h264编码和decodingBefore .i,尝试从AVCaptureSession获取h264编码的数据,所以在开始捕获之前,我已经在AVCaptureSession的视频设置中设置了AVVideoCodecH264。
videoSettings = NSDictionary dictionaryWithObjectsAndKeys:value,key,AVVideoCodecH264,AVVideoCodecKey,nil;captureOutput set录象设置:视频设置;
上面的代码不会对输出缓冲区产生任何变化,相同的缓冲区格式会像以前一样。如何完成我的要求?有可能吗?如果是,请帮助我开始,h264在ios。
发布于 2012-04-02 20:04:07
无法直接访问编码的关键帧。您可能会在这里找到一些有洞察力的评论:https://stackoverflow.com/questions/4399162/how-to-stream-live-video-from-iphone-to-a-media-server-like-wowza
中的AVVideoCodecH264, AVVideoCodecKey可用作outputSettings中的参数。
NSError *error = nil;
NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey, nil];
AVAssetWriterInput *assetWriterInput = [[AVAssetWriterInput alloc]
initWithMediaType:AVMediaTypeVideo
outputSettings:outputSettings];
AVAssetWriter *assetWriter = [[AVAssetWriter alloc] initWithURL:fileURL
fileType:AVFileTypeMPEG4
error:&error];
if (!error && [assetWriter canAddInput:assetWriterInput])
[assetWriter addInput:assetWriterInput];https://stackoverflow.com/questions/8968072
复制相似问题