[英]Hardware accelerated h.264 decoding to texture, overlay or similar in iOS
[英]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.