Live-Switching and Streaming From Mobile Devices
The production studio in your pocket—also known as your smartphone or tablet—has a pretty good camera, cellular data or Wi-Fi connectivity, and maybe even external microphone input and HDMI output connectors. 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, cellular data or Wi-Fi connectivity, and maybe even external microphone input and HDMI output connectors. It’s pretty remarkable if you think about it, since you can use that one mobile device to shoot and record content, play it back on a large screen, and impress all your friends who drop by, showing them a digital slideshow of your latest trip.
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.
Better yet, you could do both, streaming your action scenes live, while simultaneously recording the content to your mobile device for later enhancements (or perhaps to cut out the bloopers reel). That way, you can show a high-quality version to all your friends who drop by after your triumphant return from El Capitan, the Azores, or even Milwaukee.
Are all those scenarios really possible? Absolutely, and this article will give you tidbits on how to handle all three.
Herein, I’ll describe two different categories of live streaming from mobile devices: self-contained streaming and multidevice synchronized streaming.
Begin at the Beginning
Let’s start with basic connectivity. Most mobile devices, especially smartphones, have a cellular data package, often designated by an acronym: 3G, 4G, HSDPA, or LTE. Some tablets have cellular data, while almost all have wireless internet capabilities, most commonly known as Wi-Fi.
Using Wi-Fi to livestream requires the local Wi-Fi access point (AP) to have a proper connection to the outside world. It’s possible to use some live-streaming tools to broadcast locally, or around a virtual private network (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.
The underlying streaming technology varies from app to app, but the basic three streaming formats for self-contained live-streaming apps are RTSP, RTMP, or the newer HLS.
RTSP is the original real-time streaming protocol, and it’s about as vanilla as they come. It’s good for constant connections, where the bandwidth doesn’t widely fluctuate, so its use in mobile applications is lessening almost by the week. 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. It also has the added benefit of being used in many media servers. 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, using a service such as Twitch (formerly Justin.tv) to allow hundreds of thousands of viewers to follow their e-sports antics. Twitch uses RTMP for its streams, and it can receive streams from mobile devices too, although it does so from a smartphone’s camera rather than an in-device game. Chhopsky.tv offers an excellent and simple tutorial on how to combine an RTMP URL with a Twitch key.
Broadcast Me by Agilio; GoCoder (Figure 1, below) by Wowza, 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.
Figure 1. Wowza GoCoder
HLS, Apple’s HTTP live-streaming technology, is beginning to be used more in mobile live streaming, 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.
While the small-file serving doesn’t add much processing load, the segmentation adds time and additional processing power. Therefore, 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.
There’s still a bit of work to do as well. Part of the work comes from the lack of consistent HLS implementation in Android devices—not just on Android devices that stream live, but on those Android devices that receive live streams. The team at JWPlayer, which annually publishes an HTML5 report, 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,” notes the JWPlayer team in a blog post called The Pain of Live Streaming in Android. There’s also an excellent overview of HTTP live streaming for mobile devices in the International Research Journal of Engineering and Technology.