流媒体

Facebook上的Streaming Media 推特上的Streaming Media LinkedIn上的Streaming Media
 

移动设备的实时交换和流媒体

The production studio in your pocket—also known as your smartphone or tablet—has a pretty good camera, 蜂窝数据或Wi-Fi连接, 甚至可能是外部麦克风输入和HDMI输出连接器. This article will describe two different categories of live streaming from mobile devices: self-contained streaming and multidevice synchronized streaming.

The production studio in your pocket—also known as your smartphone or tablet—has a pretty good camera, 蜂窝数据或Wi-Fi连接, 甚至可能是外部麦克风输入和HDMI输出连接器. 如果你仔细想想,这是非常了不起的, since you can use that one mobile device to shoot and record content, 在大屏幕上回放, 给所有来访的朋友留下深刻印象, 向他们展示你最近一次旅行的数字幻灯片.

But what if you want to stream that trip live so that the same friends get a chance to see your adventures as they happen? You can also do that without a cell connection, assuming you’re not in Timbuktu.

更好的是, 两者都可以, 直播你的动作场面, while simultaneously recording the content to your mobile device for later enhancements (or perhaps to cut out the bloopers reel). 这种方式, you can show a high-quality version to all your friends who drop by after your triumphant return from El Capitan, 亚速尔群岛, 甚至是密尔沃基.

所有这些情况真的都有可能发生吗? Absolutely, and this article will give you tidbits on how to handle all three.

在此, I’ll describe two different categories of live streaming from mobile devices: self-contained streaming and multidevice synchronized streaming.

从头说起

让我们从基本连接开始. 大多数移动设备, 特别是智能手机, 有手机数据包吗, 通常用首字母缩写来表示:3G, 4G, HSDPA, 或LTE. 一些平板电脑有蜂窝数据, 而几乎所有的手机都有无线上网功能, 通常被称为Wi-Fi.

Using Wi-Fi to livestream requires the local Wi-Fi access point (AP) to have a proper connection to the outside world. 可以使用一些直播工具在本地进行直播, 或围绕虚拟专用网(VPN), but what’s the fun in sharing your live stream with a dozen or a few hundred people when you can share it with the entire WWW population?

For self-contained streaming, there’s not much else beyond the basics of wireless connectivity. You will need to download an application and sign up for an account to livestream your adventures. Sometimes the two go hand-in-hand with a live-stream service provider that offers a basic live-streaming app for Android or iOS devices.

底层的流媒体技术因应用而异, but the basic three streaming formats for self-contained live-streaming apps are RTSP, RTMP, 或者更新的HLS.

RTSP is the original real-time streaming protocol, and it’s about as vanilla as they come. 这对持续的连接很有好处, 带宽波动不大的地方, 因此,它在移动应用程序中的使用几乎每周都在减少. The main advantage to live streaming an RTSP stream is that viewers using an RTSP player don’t need Flash or any special client configuration.

On the other hand, RTMP continues to be widely used for live-stream applications. RTMP is a bit more robust and has been widely adopted by major streaming platforms. 它还有一个额外的好处,可以在许多媒体服务器中使用. The latter is great if you’re planning to set up your own content distribution.

Our gaming readers probably know how to do in-device streaming from the desktop, 使用Twitch(以前是Justin)等服务.tv) to allow hundreds of thousands of viewers to follow their e-sports antics. Twitch使用RTMP作为流, 它还可以接收来自移动设备的数据流, although it does so from a smartphone’s camera rather than an in-device game. Chhopsky.电视提供了一个 优秀而简单的教程 关于如何将RTMP URL与Twitch密钥相结合.

Broadcast Me by Agilio; GoCoder (下面的图1), which also makes the Wowza Streaming Engine; and the open-source Red5 Pro, which was built as a fork to the open source Red5 Server media server; are examples of RTMP mobile live-streaming apps or software development kits (SDKs). Red5 Pro has an interesting feature that allows two-way chat as part of the live stream.

图1. Wowza GoCoder

HLS, 苹果的HTTP流媒体直播技术, 是否开始更多地用于移动直播, even though it adds a considerable lag as the video stream is segmented in to 2-second to 10-second portions and then encapsulated as MPEG-2 Transport Stream (M2TS) packets to be delivered by an HTTP server. Thousands of these segments, in the form of small files, make up a live stream.

而小文件服务不会增加太多的处理负载, 分割增加了时间和额外的处理能力. 因此, the use of HLS for live streaming from a self-contained mobile device may have a somewhat negative impact on battery life and additional processing.

还有一些工作要做. Part of the work comes from the lack of consistent HLS implementation in Android devices—not just on Android devices that stream live, 而是在那些接收直播的安卓设备上. JWPlayer的团队每年都会发布一个 HTML5的报告, give some excellent HLS stream examples for Android users to test their devices’ HLS compatibility.

“The easiest way to support HLS streams on Android or other non-iOS platforms is to offer a fallback RTSP stream,JWPlayer团队在一篇名为 Android的直播之痛. 还有一个很棒的o针对移动设备的HTTP直播的概述 发表在《百家乐软件》上.