什么是最好的方式来实时流媒体服务器的iPhone相机? [英] What's the best way of live streaming iphone camera to a media server?

查看:212
本文介绍了什么是最好的方式来实时流媒体服务器的iPhone相机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个哪些技术最适合将iPhone视频摄像头数据传输到计算机?可以从iPhone摄像头获取压缩数据,但正如我在AVFoundation参考资料中阅读的那样,您只能获得未压缩的数据。 p>

所以问题是:



1)如何从iPhone的相机获取压缩帧和音频?

2)使用ffmpeg的API对未压缩的帧进行编码是否足够实时流式传输?



任何帮助都将非常感谢。



谢谢。

解决方案

你最有可能已经知道...


1)如何从iPhone的相机获取压缩帧和音频?


你不能这样做。 AVFoundation API已经阻止了这一点。我甚至尝试命名管道,还有一些其他鬼祟的unix foo。没有这样的运气。你别无选择,只能把它写入文件。在您的链接的帖子中,用户建议设置回调以提供编码帧。据我所知,这是不可能的H.264流。捕获代理将提供以特定像素格式编码的图像。 2)使用ffmpeg的API对未压缩的帧进行编码是足够快的,用于实时流式传输?


是的。但是,您必须使用libx264才能使您进入GPL区域。这与应用商店不完全兼容。



为提高效率,我建议使用AVFoundation和AVAssetWriter。


According to this What Techniques Are Best To Live Stream iPhone Video Camera Data To a Computer? is possible to get compressed data from iphone camera, but as I've been reading in the AVFoundation reference you only get uncompressed data.

So the questions are:

1) How to get compressed frames and audio from iPhone's camera?

2) Encoding uncompressed frames with ffmpeg's API is fast enough for real-time streaming?

Any help will be really appreciated.

Thanks.

解决方案

You most likely already know....

1) How to get compressed frames and audio from iPhone's camera?

You can not do this. The AVFoundation API has prevented this from every angle. I even tried named pipes, and some other sneaky unix foo. No such luck. You have no choice but to write it to file. In your linked post a user suggest setting up the callback to deliver encoded frames. As far as I am aware this is not possible for H.264 streams. The capture delegate will deliver images encoded in a specific pixel format. It is the Movie Writers and AVAssetWriter that do the encoding.

2) Encoding uncompressed frames with ffmpeg's API is fast enough for real-time streaming?

Yes it is. However, you will have to use libx264 which gets you into GPL territory. That is not exactly compatible with the app store.

I would suggest using AVFoundation and AVAssetWriter for efficiency reasons.

这篇关于什么是最好的方式来实时流媒体服务器的iPhone相机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆