【问题标题】:h 264 Hardware encoding /decoding For IOS(IPhone/Ipad)?h 264 IOS(iPhone/Ipad)的硬件编码/解码?
【发布时间】:2012-02-16 14:12:55
【问题描述】:

我已经使用 AVFoundation 框架在 ios 中完成了实时视频处理, this link.i 的帮助已经测试它工作正常。现在我想使用 h264 编码和解码[Before draw]。我尝试从 AVCaptureSession 获取 h264 编码数据,所以我在 AVCaptureSession 的视频设置中设置了 AVVideoCodecH264,然后开始捕获。

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

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

【问题讨论】:

  • 正在寻找 armv7 设备...
  • @Asta:丹尼尔给出的答案对你有用吗?如果没有,那么您最终是如何解决这个问题的?

标签: iphone ios avfoundation h.264


【解决方案1】:

无法直接访问编码的关键帧。您可以在这里找到一些有见地的 cmets: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];

【讨论】:

    猜你喜欢
    • 2014-10-01
    • 2014-09-08
    • 1970-01-01
    • 1970-01-01
    • 2012-10-20
    • 2012-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多