从 iPhone 传输视频

发布于 2024-09-13 05:46:10 字数 194 浏览 1 评论 0原文

我可以从 iPhone 的相机中获取单独的帧。我需要的是一种将它们与声音打包以便流式传输到服务器的方法。收到文件后发送它们并不是什么大问题。我遇到问题的是流媒体文件的生成。我一直在尝试让 FFMpeg 工作,但运气不佳。

有人对我如何实现这一目标有任何想法吗?我想要一个已知的工作 API 或有关使 FFMpeg 在 iPhone 应用程序中正确编译的说明。

I can get individual frames from the iPhone's cameras just fine. what I need is a way to package them up with sound for streaming to the server. Sending the files once I have them isn't much of an issue. Its the generation of the files for streaming that I am having problems with. I've been trying to get FFMpeg to work without much luck.

Anyone have any ideas on how I can pull this off? I would like a known working API or instructions on getting FFMpeg to compile properly in an iPhone app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的黑色迷你裙 2024-09-20 05:46:10

您可以将录音分成长度为 10 秒的单独文件,然后分别发送。如果您使用 AVCaptureSession 的 beginConfiguration 和 commitConfiguration 方法来批量更改输出,则不应在文件之间丢弃任何帧。与逐帧上传相比,这有很多优点:

  • 文件可以直接用于 HTTP 直播,无需任何服务器端处理。
  • 如果连接足够快,数据传输之间的间隙允许天线休眠,从而节省电池寿命。
  • 相反,如果连接很慢,因此上传比记录慢,则管理一组文件的延迟上传比管理字节流容易得多。

You could divide your recording to separate files with a length of say, 10sec, then send them separately. If you use AVCaptureSession's beginConfiguration and commitConfiguration methods to batch your output change you shouldn't drop any frames between the files. This has many advantages over frame by frame upload:

  • The files can be directly used for HTTP live streaming without any server side processing.
  • The gap between data transfers allow the antennas to sleep in between if the connection is fast enough, saving battery life.
  • Conversely, if the connection is slow so upload is slower than recording, managing delayed upload of a set of files is much easier than a stream of bytes.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文