简体   繁体   English

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

[英]h 264 Hardware encoding /decoding For IOS(IPhone/Ipad)?

i have done Real time video processing in ios using AVFoundation framework , help of this link .i have tested it is working fine. 我已经使用AVFoundation框架在ios中完成了实时视频处理, 这个链接的帮助。我测试过它工作正常。 now i want to use h264 encoding and decoding[Before draw] .i try to get h264 encoded data from AVCaptureSession ,so i have set AVVideoCodecH264 in AVCaptureSession's videosetting,before Start capturing . 现在我想使用h264编码和解码[在绘制之前] .i尝试从AVCaptureSession获取h264编码数据,所以我在开始捕获之前在AVCaptureSession的视频设置中设置了AVVideoCodecH264。

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

above code doesn't produce any change in output buffer,same buffer format get as like before. 上面的代码不会对输出缓冲区产生任何变化,同样的缓冲区格式就像之前一样。 how to accomplish my requirement ? 如何完成我的要求? is it possible ? 可能吗 ? if so Please Help me to getting started ,h264 in ios. 如果是这样请帮助我开始,在ios中使用h264。

There's no direct access to encoded keyframes. 无法直接访问已编码的关键帧。 You may found some insightful comments about that here: https://stackoverflow.com/questions/4399162/how-to-stream-live-video-from-iphone-to-a-media-server-like-wowza 您可以在此处找到一些有见地的评论: https//stackoverflow.com/questions/4399162/how-to-stream-live-video-from-iphone-to-a-media-server-like-wowza

A pair AVVideoCodecH264, AVVideoCodecKey may be used as parameters in outputSettings in 一对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];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM