h 264硬件编码/解码适用于IOS(IPhone/Ipad)?

Ast*_*hpi 9 iphone avfoundation h.264 ios

我已经使用AVFoundation框架在ios中完成了实时视频处理,这个链接的帮助.我测试过它工作正常.现在我想使用h264编码和解码[在绘制之前] .i尝试从AVCaptureSession获取h264编码数据,所以我在开始捕获之前在AVCaptureSession的视频设置中设置了AVVideoCodecH264.

NSDictionary*videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:value,key,AVVideoCodecH264,AVVideoCodecKey,nil]; [captureOutput setVideoSettings:videoSettings];

上面的代码不会对输出缓冲区产生任何变化,同样的缓冲区格式就像之前一样.如何完成我的要求?可能吗 ?如果是这样请帮助我开始,在ios中使用h264.

Dan*_*uke 1

无法直接访问编码的关键帧。您可能会在这里找到一些有见地的评论:https ://stackoverflow.com/questions/4399162/how-to-stream-live-video-from-iphone-to-a-media-server-like-wowza

一对AVVideoCodecH264, AVVideoCodecKey可以用作outputSettingsin中的参数

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];
Run Code Online (Sandbox Code Playgroud)