我知道如何从iOS sdk获取帧。 [如何使用AV Foundation将摄像机中的视频帧捕获为图像(http://developer.apple.com/library/ios/#qa/qa1702/_index.html)] 它是像素,我可以将它传输到JPEG。
我想传输视频的方式是这样的:
一台iOS设备A:
-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
使用现有技术编码h.264 - ffmpeg
使用TS流封装视频
运行http服务器,等待请求
其他iOS设备B:
所以我的问题是,我是否需要使用ffmpeg获取h.264流或者我可以从iOS API获取? 如果我使用ffmpeg编码为h.264(libx264),该怎么做,是否有任何示例代码或指南?
我已阅读帖子What's the best way of live streaming iphone camera to a media server? 这是一个非常好的讨论,但我想知道细节。