Be Your Own Compression Consultant

So. You’ve decided to add video to your website. Now it’s time to configure the streams.You’re either working with your own streaming server, or using an online video platform (OVP) that lets you configure your streams, so now you’re trying to figure out the best resolution, data rate and H.264 encoding parameters for your file or files.

You could call me, spend a few hundred dollars to get the best answer, or you can tackle the job yourself. Even if you end up calling me in the long run, following the procedures here will knock a bunch off my fee since you’ll be doing most of the grunt work.

So, let’s get started, shall we?

1.  Identify your target platform or platforms.

We could spend a bunch of time going back and forth about the wonders of Silverlight and HTML5, but for the vast majority of users in 2011, the most relevant target platform on the computer is Flash.

 

PLATFORMS.png

Once you choose Flash, if you use the H.264 codec (and you should), there are multiple server-based alternatives that allow you to distribute a single stream (or streams) to both the Flash Player and iOS devices. For more on these alternatives in a live scenario (they work similarly for on-demand distribution) click here. In addition, the latest version of the Adobe Flash Media Server can do the same thing.

If you decide to support both Flash and iOS devices, you have to identify the specific iOS devices that you want to serve, and configure your streams accordingly. I deal with that issue extensively in Chapter 6 of my book, Video Compression for Flash, Apple Devices and HTML5, but if you’re in a hurry, download the PDF from this article and you'll find this chart a few pages in.

idevices.png

H.264-related playback capabilities of Apple iDevices.

The color coding shows that there are three classes of devices. As you would expect, older devices are limited to lower resolution video at a lower data rate and lower H.264 profile. Depending upon your target audience, you need to choose which classes of devices you want to serve and configure your video streams accordingly. 

Typically, you don’t have to perform similar configuration triage when creating streams for Flash playback since you’re more constrained by the deliverability of a stream than a computer’s ability to play it back. That is, a 1080p file encoded at 40 Mbps might overwhelm a five-year-old computer running Flash, but you can’t deliver 40 Mbps in real time anyway. Most streaming sites peak at 720p video at maybe 3-4 mbps, which will play fine even on older computers running Flash.

So, you should exit from this step with an objective list like this:

  • I want to play on computers and compatible devices running Flash
  • I want to play on all generations of iPhones/iPod touch/iPads, but not the oldest iPods that can only play 320x240 H.264 video

2. Single or adaptive streams?

As I write this in 2011, most of my clients are considering adaptive streaming, usually to both Flash and iDevices. Briefly, adaptive streaming technologies create multiple streams at different resolutions and data rates and send the optimal stream to each playback device, with the ability to change streams should conditions like bandwidth or high CPU utilization warrant a change. For more on adaptive streaming, check out my book (chapter 7) or this introductory article.

In most distribution scenarios, the cost of adaptive streaming is minimal and the value is very significant. For example, because you’re producing a low-resolution, low-bitrate stream for viewers on slow connections, you can also produce a high-resolution, high-bitrate stream for viewers with powerful computers on fast connections. If you were producing a single stream only, you’d have to choose a middle-of-the-road stream that wouldn’t please anyone.

Akamai adaptive.png

An adaptive streaming topology, courtesy Inlet Technologies, now part of Cisco.

Pretty much all of the server-based technologies discussed above for delivering to Flash and iDevices can stream adaptively as well as single streams. So even if you weren't thinking about adaptive streaming before you read this article, it's something you should definitely consider and perhaps factor into your plans.

3. Configure your streams.

If you do choose adaptive streaming, you’ve got some decisions to make, like the number of streams and their configuration. Yeah, there’s a chapter in the book on that as well, but if you’re in a hurry, you can find some of the information here. The really short answer is that entertainment sites tend to use more streams than news, educational or corporate sites. This is particularly so with subscription sites, like Major League Baseball, which used 11 streams last time I looked. In contrast, most news, educational and corporate sites are in the 3-5 range.

In addition, stream count should relate to the resolution of the original source footage. If SD, you probably don’t need more than 3 streams. If HD, and you’re distributing at least one HD stream, you can definitely produce in the 5-7 range.

In terms of resolution, if you’re working with 4:3 SD source, you probably should go 640x480, 480x360 and perhaps 320x240. If working with HD source, and need four streams, I’d say 720p, 848x480, 640x360 and 480x270.

I don’t mean to breeze over this topic; there are some important decisions here. For example, if your website uses different display windows for the video, you should consider configuring a stream or streams for each display size. In addition, many producers of SD content use the same resolution for all streams and simply vary the data rate and frame rate. So read the reference materials, give these issues some thought and move on to the next step.

To help frame the discussion, let's get some numbers down on the page. Here are the streams I recommended for a recent overseas client.

table 1-t.png

These decisions are a great first step, but we have a long way to go. To continue, click over to the next page.


Attachments

Comments (7)

Sharon Hanson
Said this on 9-26-2011 At 09:38 am

What education track have you taken to get you to this level of knowledge?  Sometimes I feel I need to know and others times my management tells me I don't need to know this and I am wasting my time.  As an instructional designer working in this technology, I can adjust the software capturing rate and the size of my screen captures, so I think I should have some knowledge, but how do I get educated in this area?  If you can tell me your education/training, maybe I can help myself know how to recommend another person for the team.  Thank you.

Said this on 9-26-2011 At 11:11 am

Sharon:

Thanks for your note. Unfortunately, I'm no help as I'm totally self taught. I worked at a video compression company back in 1991-1993, and then started my own company to evaluate video and still image compression technologies in 1994.

Since then, I've done a mix of production, writing and training, which all help crystallize your thinking on the various subjects. So, I've kind of been living it for 20 years.

I'm flattered that you asked.

:-)

Jan

Tom Skinner
Said this on 10-25-2013 At 05:21 am

Hi Sharon;

You can find some training out there but like Jan said, he's self taught as most of us are.  Digital video is FM (Freaky Magic) that really has to be "accepted" and then move on, spend too much time on one area and you lose focus of the big picture.  Check out Snell and Wilcox, Textronix and Harmonic (Divicom) to get some white papers to get you started.  I'm an expert in the field and am self taught as well having started in the 80's on DCT (Discrete Cosign Transform) which was the beginning of MPEG.  Good luck!  You can do it just like we did.  Keep Googling (lol);  Tom  

jono
Said this on 1-11-2012 At 06:26 pm

I'm wondering if you know the reason as to why files encoded with CBR vary from their expected file size?  My limited knowledge of CBR is that it should produce exactly the number of bits of data per second that the encoder is set to.  Thanks.

Said this on 1-11-2012 At 09:32 pm
Hey Jono:

Good question. In my experience, different encoders produce different levels of consistency in their constant bitrate encoding. Not sure why. In addition, different encoders differ respecting their ability to achieve certain target bitrates. For example, if you set the video data rate at 500 kbps, some encoders may deliver 520 kbps. You can fix the latter problem by setting the target at 480 kbps to get 500, but you can't fix the first.

So, if you really need to hit your targets and an encoder that produces true CBR, get familiar with these two tools and do your own testing.

http://www.streaminglearningcenter.com/articles/vi...

Hope this helps. Thanks for coming by and posting a question.

Jan
Tom
Said this on 6-27-2012 At 06:52 pm

Sorry hitwrong key.

Second reason for blocking videos,

Bandwidth

Each school has a T1, which has a max of 1.44 mbps for all bandwidth traffic.

 

If I I follow what you have said, taking an sample speed of 500 kbps transfer rate, if I had 3 teachers trying to do a video streaming at the same time that would use 1,500 kbps. OOPs, I have already exceeded the total bandwidth available, and now my video starts buffering and being displayed in a jerky fashion. Also, all other traffic on my network is fighting to find a second to get in and transmit out to the internet! Am I right in my understanding, or am I missing something? I know that not all video is transmitted at that rate, but from what I have read, that seems to be a good middle point.  This also seems to be supported from what happens to my DSL connection at home when more than one member of my family tries to stream. or when I try to watch ESPN3 football games.

 

Again, thanks for the information in your article and following comments.

 

Tom

 

Said this on 7-5-2012 At 07:20 am
Can't argue with your math, Tom. My home DSL is 10 mbps downstream, and the average in the states is over 3 mbps. But T-1 is 1.44 so three streams would swamp it.

Jan
Post a Comment
* Your Name:
* Your Email:
(not publicly displayed)
Reply Notification:
Approval Notification:
Website:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image:
* Message: