Producing H.264 Video for Flash: An Overview

As a producer of video on the web, you know that you're judged by the quality of your video. In this regard, many producers are considering converting from the venerable On2 VP6 codec to H.264. H.264 offers better visual quality than VP6, and the AAC audio codec offers much better quality than the MP3 codec paired with VP6. Starting with Adobe Flash Player 9 Update 3, you could play back files encoded in H.264/AAC formats. As of September 2008, the penetration of H.264/AAC-compatible players exceeded 89% in all Internet-connected PCs. No wonder they're switching over.

This article first discusses the issues involved in such a changeover, including the potential requirement for royalties. I then describe the H.264-specific encoding parameters offered by most encoding programs. Finally, I cover how you can produce H.264 video with Adobe Media Encoder CS4 and Adobe Flash Media Encoding Server 3.5.

What is H.264?

H.264 is a video compression standard known as MPEG-4 Part 10, or MPEG-4 AVC (for "advanced video coding"). It's a joint standard promulgated by the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG).

H.264's audio sidekick is AAC (advanced audio coding), which is designated MPEG-4 Part 3. Both H.264 and AAC are technically MPEG-4 codecs—though it's more accurate to call them by their specific names—and compatible bitstreams should conform to the requirements of Part 14 of the MPEG-4 spec.

According to Part 14, MPEG-4 files containing both audio and video, including those with H.264/AAC, should use the .mp4 extension, while audio-only files should use .m4a and video-only files should use .m4v. Different vendors have adopted a range of extensions that are recognized by their proprietary players, such as Apple with .m4p for files using FairPlay Digital Rights Management and .m4r for iPhone ringtones. (Mobile phones use the .3gp and .3g2 extensions, though I don't discuss producing for mobile phones in this article.)

Like MPEG-2, H.264 uses three types of frames, meaning that each group of pictures (GOP) is comprised of I-, B-, and P-frames, with I-frames like the DCT-based compression used in DV and B- and P-frames referencing redundancies in other frames to increase compression. I'll cover much more on this later in this article.

Like most video coding standards, H.264 actually standardizes only the "central decoder...such that every decoder conforming to the standard will produce similar output when given an encoded bitstream that conforms to the constraints of the standard," according to Overview of the H.264/AVC Video Coding Standard published in IEEE Transactions on Circuits and Systems for Video Technology (ITCSVT). Basically, this means that there's no standardized H.264 encoder. In fact, H.264 encoding vendors can utilize a range of different techniques to optimize video quality, so long as the bitstream plays on the target player. This is one of the key reasons that H.264 encoding interfaces vary so significantly among the various tools.

Will there be royalties?

If you stream H.264 encoded video after December 31, 2010, there may be an associated royalty obligation. As yet, however, it's undefined and uncertain. Here's an overview of what's known about royalties to date.

Briefly, H.264 was developed by a group of patent holders now represented by the MPEG Licensing Suthoring, or MPEG-LA for short. According to the Summary of AVC/H.264 License Terms (PDF, 34K) you can download from the MPEG-LA site, there are three classes of video producers subject to a potential royalty obligation.

If you're in the first two classes, and are either distributing via pay-per-view or subscription, you may already owe MPEG-LA royalties. The third group, which is clearly the largest, is for free Internet broadcast. Here, there will be no royalties until December 31, 2010 (source: AVC/H.264 License Agreement). After that, "the royalty shall be no more than the economic equivalent of royalties payable during the same time for free television."

According to their website, MPEG-LA must disclose licensing terms at least one year before they become due, or no later than December 31, 2009. Until then, we're unfortunately in the dark as to which uses of H.264 video will incur royalties, and the extent of these charges. For more information on H.264-related royalties, check out my article, The Future's So Bright: H.264 Year in Review, at StreamingMedia.com.

H.264 and Flash Player

As I mentioned, Adobe added H.264 playback support to Adobe Flash Player 9 Update 3 back in 2007. The apparent goal was to support the widest possible variation of files containing H.264 encoded video, and Flash Player should play.mp4, .m4v, .m4a, .mov, and .3gp files, H.264 files using the .flv extension, as well as files using the newer extensions that were released along with Flash Player 9 (see Table 1).

File Extension FTYP MIME Type Description
.f4v 'F4V ' video/mp4 Video for Flash Player
.f4p 'F4P ' video/mp4 Protected media for Flash Player
.f4a 'F4A ' audio/mp4 Audio for Flash Player
.f4b 'F4B ' audio/mp4 Audio book for Flash Player

Table 1. File extensions for H.264 files produced for Flash Player playback

I'll describe profiles and levels in the next section. For now, understand that Flash Player supports the Baseline, Main, High, and High 10 H.264 profiles with no levels excluded. Accordingly, when you're producing H.264 video for Flash Player, you're free to choose the most advanced profile supported by the encoding tool, which is typically the High profile. On the audio side, Flash Player can play AAC Main, AAC Low Complexity, and AAC SBR (spectral band replication), which is otherwise known as High-Efficiency-AAC, or HE-AAC.


Comments (4)

Per olsen
Said this on 1-26-2011 At 07:01 am

confusion about H.264

Flash is at container format, normaly compressed using VP6/spark/H.264

wicki says that MPEG4 AVC/ H.264 is "the same" http://en.wikipedia.org/wiki/H.264

question; You use H.264 codec for F4V file, what is your reason for this, wouldent MPEG4 AVC give better quality for same bitrate ?, and suported for same versions of flash player.

im using an AVCHD camera, shoot in HD, cut and save as avchd (codec) in MPEG4 AVC file, this quality is much better, on the net,  than when i save in flash. i think this is becaurce i keep same format, through the proces.

Best regards

Per Olsen Denmark

Said this on 1-26-2011 At 06:12 pm

Per:

>>Flash is at container format, normaly compressed using VP6/spark/H.264.

Correct.

>>wicki says that MPEG4 AVC/ H.264 is "the same" http://en.wikipedia.org/wiki/H.264

Correct.

>>question; You use H.264 codec for F4V file, what is your reason for this, wouldent MPEG4 AVC give better quality for same bitrate ?, and suported for same versions of flash player.

They're the same - H.264 is the same as MPEG4 AVC.

>>im using an AVCHD camera, shoot in HD, cut and save as avchd (codec) in MPEG4 AVC file, this quality is much better, on the net,  than when i save in flash. i think this is becaurce i keep same format, through the proces.

Not sure what you're asking here, sorry. Please:

- when you say "save as avchd (codec) in MPEG4 AVC file" what are the parameters? (resolution, frame rate, data rate).

- When you say ""i save in flash," again, what are the parameters?

Let me know and maybe I can be more useful.

Jan

Said this on 6-22-2011 At 09:20 pm

Hello Jan.

I want to thank you for all your great infromation and tutorials you host here.

They are great!

Specially this one, you made me clear my mind in a lots of things about h264.

I'm actually encoding a file right now (I use Rhozet Carbon Coder 3 which uses the same h264 enconder as Adobe) Everybit of the guide helped :D

Thanks a lot for that.

You'll see me around here, at least, reading stuff.

Greetings from Argentina

 

Sincerely,

Cristian.

 

Said this on 6-22-2011 At 09:31 pm
Cristian:

Wow, thanks for taking the time to write. Carbon Coder is a great tool for H.264, you should get very good results.

I'm glad that you're finding the site useful.

Thanks again.

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: