cloud2

Video Streaming On Linux: Getting Started

With the increases in bandwidth available to everyone, rich media services, and available information via the internet, video streaming is going to explode. You might think you see streaming everywhere now, but in realty video streaming is still in its infancy. There are many options for video streaming such as YouTube (yes, they have live streaming), Livestream, Ustream, and I’m sure there are a few others. However, some of those are expensive and others we just don’t want to use because of their branding. So what is the solution? Wowza! Seriously, the name is Wowza and we just happen to know a few experts that are going to help teach you to get started streaming with Wowza.

What You Need

The first thing you need is a video camera. You can have multiple cameras but that’s a tutorial for another day. Today, we are going to start with a single AirCam Ubiquity camera. It is powered by Cat5e (Power over Ethernet). There are many ways you could use live video streaming but I’m going to use it to watch clouds in the sky. Yes, clouds (not what you had in mind when you heard “cloud streaming” huh?) Many churches, schools, and other similar institutions use live video streaming to broadcast events, well, live and online.

The second thing you need is a Linux machine to run this on. You don’t have one? DON’T WORRY! The great thing about Wowza (and something we’ve built here) is that you can fire up Wowza servers on Amazon Web Services. The software is already installed, and you just have to configure it. Our home-grown open source software will also allow you to schedule events, times, and streams, all from a GUI web-based interface. This series will feature tutorials on setting up with Amazon EC2, some tips and tricks from THE expert Ian Beyer as well as configuring Wowza on your home server (or office server) for you to watch clouds too, aren’t you lucky!

If you already have a Linux server you are wanting to put this on, then what you will need is a copy of Wowza media server.  You can download a developer/evaluation edition or you can purchase it for a mere $40 from http://wowza.com.

What Is Covered

It’s simple, we are going to teach you to stream live video from Linux servers. Ian Beyer will chime in with tips and tricks, and even do some writing about enterprise level switches for enterprise level organizations. But to start, we are going to keep it simple; we are going to stream clouds to the internet!

We’ll also show you the open source project, how to install it, where it’s located, and mostly how to contribute.

Let’s Get Started

OK, So you’re convinced this is what you need to do. Let’s get started! First thing you want to do is order your video camera. What I picked was a nice IP camera from Ubiquiti Networks called AirCam. It was $100 and can be found on newegg. The camera is built to be mounted outdoors (cloud watching remember?) and it’s an H.264/RTSP capable camera. THAT IS MPORTANT! H.264 is a standardized video compression algorithm that provides the broadest playback support across the myriad devices out there. In order to use this camera with Wowza, it also needs to send that stream via RTSP (Real-Time Streaming Protocol). There are a lot of cameras out there that use proprietary streaming methods, and they won’t work in this setup.

ubiquiti aircam
ubiquiti aircam

This camera can be controlled by software installed on your computer. But we don’t want to stream just to our computer. We want to stream the clouds to thousands of people over the internet. That’s where Wowza media server comes in. It takes your video and distributes it so anybody from an internet connected device can watch the same exact clouds!

cam1
AirCam Assembled

Sidebar: What is H.264?

In order to send video over the network, it has to be broken down into bits just like anything else. The problem you run into is that video is a series of images (called frames), typically at a rate of 30 per second. That much data adds up pretty quickly, especially once you start getting into high-definition resolutions like the AirCam’s 720p. An uncompressed 720p video feed can exceed 200Mbps, and an uncompressed Full HD 1080p stream can push 3Gbps. That’s not going to work over the internet unless you have Google Fiber, and that’s just one stream.

In order to get around this problem, a bunch of smart geeks from the Motion Picture Experts Group (known as MPEG) and the International Telecommunications Union (known as ITU) got together and figured out that on most video feeds, only a small part of the image changes from one frame to the next, and that If you only send what changes between frames, you can cut the bitrate WAY down. But first you have to send a complete frame so the playback device knows what to start from. Since someone could be tuning into the stream at any given time, you have to send that initial frame periodically (which also helps the playback keep track of where it is. These are called Key Frames and are typically sent out every few seconds in a stream. In between those key frames are frames that have only the parts of the image that have changed since the last frame and since the key frame (there are also predictive frames that attempt to guess at what’s going to change in the next frame).

This coding methodology allows you to cut a stream down to about 1% of the uncompressed bitrate, which is a lot more Internet-friendly. Officially, H.264 is known as MPEG-4 Part 10, or AVC (Advanced Video Coding). Because it’s such an efficient algorithm, device manufacturers have widely embraced it and embedded decoder hardware into graphics processors and mobile chipsets.

But H.264 is not enough – this year, Ultra-HD devices are starting to hit the market, and in order to stream these resolutions (which have four to sixteen times as many pixels per frame as full 1080 HD), a better codec was needed. The geeks got together and started working on the next-generation codec in 2002 and it was finalized and approved in January 2013. Unsurprisingly, it is called H.265 (or MPEG-H Part 2) and known as HEVC (High Efficiency Video Coding). This codec is a few years out from being widely supported in consumer space, but when it is, it will be able to cut the bitrate of 720p and 1080p streams in half.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *