簡體   English   中英

h 264硬件編碼/解碼適用於IOS(IPhone / Ipad)?

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

我已經使用AVFoundation框架在ios中完成了實時視頻處理, 這個鏈接的幫助。我測試過它工作正常。 現在我想使用h264編碼和解碼[在繪制之前] .i嘗試從AVCaptureSession獲取h264編碼數據,所以我在開始捕獲之前在AVCaptureSession的視頻設置中設置了AVVideoCodecH264。

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

上面的代碼不會對輸出緩沖區產生任何變化,同樣的緩沖區格式就像之前一樣。 如何完成我的要求? 可能嗎 ? 如果是這樣請幫助我開始,在ios中使用h264。

無法直接訪問已編碼的關鍵幀。 您可以在此處找到一些有見地的評論: 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];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM