2012-04-06 82 views
3

我已經下載了ffmpeg lib文件,並將其編譯爲armv7。我在我的項目中成功添加了ffmpeg庫文件。我能夠使用AVFoundation獲得iPhone攝像頭的實況流。iPhone攝像頭直播蒸汽

現在的問題是我將如何將iPhone攝像頭流輸出轉換爲ffmpeg解碼輸入?檢查我的代碼

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { 


CMBlockBufferRef bufferData = CMSampleBufferGetDataBuffer(sampleBuffer); 
size_t lengthAtOffset; 
size_t totalLength; char* data; 

如果(CMBlockBufferGetDataPointer(bufferData,0,& lengthAtOffset,& totalLength,&數據)=諾爾!){ 的NSLog(@ 「錯誤!」); } }

請建議我其中的ffmpeg IIb的功能是用於解碼和如何將我把CMBlockBufferRef作爲其輸入?

感謝

回答

0

您可以使用OPenTok視頻直播straming

https://github.com/opentok/opentok-ios-sdk

+0

先生看到了這個問題,這是pravi(Nikhil的朋友)http://stackoverflow.com/questions/11986313/http-即時串流換iphone和 - 爲什麼 - 我們使用-M3U8文件 – 2012-08-17 07:53:09