Linux 服务器上的 HTTP 直播

发布于 2024-10-31 10:56:02 字数 641 浏览 0 评论 0原文

我发现很难找到这方面的一些结论性信息。我在数据中心有一台使用 Debian 5.0 的专用服务器。我有一个使用 JAVA EE (Glassfish 2.1) 后端的 iPhone/iPad 应用程序,我正在将视频实现到该应用程序中。这包括直播,并且视频长度超过 10 分钟,我需要 HTTP 直播。

最好的开源/免费解决方案是什么?这只是一个试点项目,所以我不想订阅任何付费服务。目前我还没有准备好直播流媒体,因此可以灵活地适应任何系统(服务器或客户端)。

我遇到了:

  • Darwin (但不确定该项目是否有效,因为没有太多信息)
  • Red5 (但无法确定这是否允许轻松实现 HTTP 直播流)
  • FFMPEG

关于视频,我理想情况下例如将 720p 版本上传到服务器(适用于 iPad),然后自动转换(在请求时即时转换或在文件上传时准备)转换为 iPhone/iTouch 和低带宽所需的格式。对于直播,我希望能够在大约 30 秒内将内容传输到服务器中。

我并没有设想高要求(例如大量同时请求,如果是这样(例如实时事件),一个流应该能够使用 HTTP 实时流处理,它只需要编码和分段一次)。

在不久的将来,Android 也可能成为应用程序的一部分。

任何提示/教程/建议/建议将不胜感激。

I find it hard to find some conclusive information on this. I have a dedicated server in a datacenter with Debian 5.0. I have an iPhone/iPad app which uses a JAVA EE (Glassfish 2.1) backend, and I am in the process of implementing video into the App. This includes live streaming and video's are longer than 10 minutes I need HTTP Live Streaming.

What is the best open-source/free solution to implement? This is only a pilot project, so I don't want to subscribe to any paid service. I have currently nothing in place yet for the live streaming, so am flexible to adapt any system (server or client side).

I came across:

  • Darwin (but am not sure that project is alive, as there is not a lot of info)
  • Red5 (but cannot find conclusive if this would allow an easy implementation of HTTP live streaming)
  • FFMPEG

Regarding the video's, I would ideally like to upload a 720p version to the server (for iPad) and then convert automatic (either on the fly when requested or prepared when the file is uploaded) to the required formats for iPhone/iTouch and low bandwidth. For live streaming I would like to be able to provide the content in about 30 seconds from it streaming into the server.

I am not envisaging high demands (e.g. a lot of simultaneous requests, and if so (e.g. live event) on one stream which should be able to be dealt with using HTTP-live streaming, it only needs encoding and segmenting once).

In the )not so near) future android will probably be made part of the App as well.

Any hints/tutorial/suggestions/advice would be really appreciated.

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

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

发布评论

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

评论(5

套路撩心 2024-11-07 10:56:02

Wowza 非常适合 iOS(以及 Flash)直播,

但它不是免费的。

Wowza is pretty good for live streaming to iOS (as well as flash)

It isn't free though.

小嗲 2024-11-07 10:56:02

VLC的最新开发版本支持HTTP直播。
您必须从源代码构建,因为不久前它已添加到 git 存储库中。

http://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_for_the_iPhone

Latest development version of VLC supports HTTP live streaming.
You'll have to build from source as this has been added to the git repository not so long ago.

http://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_for_the_iPhone

静赏你的温柔 2024-11-07 10:56:02

我现在使用 Xuggler 框架,它是基于 Java 的。似乎完全符合我正在寻找的工作,尽管没有可用的分段等构建。相反,我现在尝试自己编写一个,同时与我的系统完全集成

I am now using the Xuggler framework, which is Java based. Seems to do exactly the job I am looking for, although no build in segmented etc. is available. Instead I try now to write one myself which at the same time integrates exactly with my system

情域 2024-11-07 10:56:02

参考Apple的http直播文档和最佳实践。

https://developer.apple.com/streaming/

这应该是一个很好的开始点。

Refer to Apple's http live streaming document and best practices.

https://developer.apple.com/streaming/

This should be a good point to get started.

辞取 2024-11-07 10:56:02

直播视频的来源是什么? iPhone 仅支持播放带有 aac 音频的 H.264 基线配置文件级别 3 或 mpeg-4 视频。 iPhone 本身会按照这些规范对视频进行编码,但大多数其他编码器不会(包括许多 Android 手机)。如果您的视频未按照此规范进行编码,您首先必须进行转码。 FFMpeg(带有 libx264)可以很好地做到这一点。然后您需要生成动态 .m3u8 播放列表文件。 Wowza 会开箱即用地为您执行此操作,并将接受来自 FFmpeg 的 rtmp 流(但不是免费的)。我不相信 red5 支持 Apple http 流。有一些声称是免费的服务器,但我从未使用过它们。看看 http://erlyvideo.org/。否则,您可以相当简单地自己完成。 FFmpeg 将输出 mpeg-ts 流。那么,播放列表生成器需要做的就是将其切割成 188 字节对齐的块,并返回包含最后 n 个的播放列表。您甚至可以使用 http 字节偏移模块使播放列表引用单个文件。阅读 Apple 的 http 流媒体文档,网址为 https://developer.apple.com/streaming/

What is the source of the live video? The iPhone only supports playback of H.264 baseline profile level 3 or mpeg-4 video with aac audio. The iPhone itself encodes video to these specs, but most other encoders don't (including many Android phones). If your video is not encoded to this spec, you'll first have to transcode. FFMpeg (with libx264) will do this nicely. Then you'll need to generate the dynamic .m3u8 playlist file. Wowza will do this for you out of the box, and will accept an rtmp stream from FFmpeg (but is not free). I don't believe that red5 supports Apple http streaming. There are free servers that claim to, but I've never used them. Take a look at http://erlyvideo.org/. Otherwise, you can do it yourself fairly simply. FFmpeg will output an mpeg-ts stream. All that the playlist generator needs to do, then, is cut this into 188-byte-aligned chunks, and return a playlist containing the last n. You can even use an http byte offset module to make the playlist reference a single file. Read Apple's http streaming docs at https://developer.apple.com/streaming/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文