Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Adobe Flash

Video with Adobe Flash CS4 Professional: Compression and Encoding Primer

Learn how to make the right decisions when it comes time to compress digital video and audio into Flash-compatible video files.
From the book

Even with fast, fancy computers and digital devices, digital video requires a lot of bits and bytes—there’s no way to avoid throwing away visual and audio information. Storage is limited, and network bandwidth is even more so. Compression is here to stay, so you need to know how to achieve the best results with the tools at your disposal. In this chapter, you’ll learn how to make the right decisions when it comes time to compress digital video and audio into Flash-compatible video files.

Distinguishing Source Files and Their Differences

Chapter 2, “Capturing and Processing Video,” talked about the various video acquisition formats and their quality differences. When video is converted to, or acquired in, a digital format, a codec is used to effectively analyze the information in the video image and store that information on the digital tape, drive, or disc acquisition media. The term codec stands for compression and decompression: The source image is compressed during acquisition or capture and is later decompressed during playback.

A wide variety of video and audio codecs are available. Some codecs are used for professional video editing and output for TV broadcast, whereas other codecs are designed for low bit rates—ideal for video delivered over slower networks such as the Internet or mobile phone networks. Video files don’t contain the codec used to create them; the operating system or video-player application must have the codec installed in order to play back the video file. Luckily, since Flash Player 6, at least one video codec has been built into the player engine—the video codecs used by Flash-compatible video aren’t downloaded as separate files like they are with other video platforms or players.

Ideal source file formats

Source video files, which are stored in a way specific to a codec, are commonly saved in Apple QuickTime (MOV files) and Microsoft Video for Windows (AVI files). You can also use the MPEG specification as a file format (MPEG or MPG files), especially for High Definition Video or DVD Video files.

Apple QuickTime (MOV)

The QuickTime format, introduced by Apple in 1991, is more than just a video format. It’s an entire multimedia architecture, supporting interactive sprite elements and text tracks along with audio and video. You can even add Flash movie tracks to QuickTime files! If you use a Macintosh, most video applications, including Apple Final Cut Pro and iMovie, use the QuickTime format for video captures. QuickTime is available for both Mac and Windows; it supports a wide range of video and audio codecs. The QuickTime format is popular for acquisition and delivery—many Web sites feature embedded QuickTime movies that use low bit rate video and audio codecs.

Microsoft Video for Windows (AVI)

Introduced in 1992, Microsoft’s primary video-acquisition format is Video for Windows (AVI files). Most Windows-based applications save video captures in this format. AVI files are strictly audio/video content—you won’t likely deploy AVI files on Web sites. You can play the AVI file format with QuickTime Player on both Mac and Windows, but some codecs used for the AVI format aren’t available in QuickTime. Adobe Premiere Pro uses the AVI file format on Windows as the native capture-file format.

MPEG

The MPEG file extension can be used on any video file that uses an MPEG video codec. Many MPEG video files are guised as AVI or MOV files. If you capture footage from an HDV camcorder, the source format is MPEG. Many other types of prosumer and professional video cameras, such as XDCAM and AVCHD camcorders, use MPEG as the transport container but may employ a different video codec than HDV. The MPEG format is also used for VOB files on DVD Video discs. Most MPEG filenames don’t indicate the version of the MPEG codec used by the video.

Ideal source video codecs

Now that you know the three primary source file formats, you can review the common video codecs you’ll find with high-quality video source files. These codecs are primarily acquisition video codecs and shouldn’t be used by video editors for final high-quality output files headed to a video encoder. For example, just because video material was shot on a DV camcorder does not mean you should output a DV file from your video-editing application—especially if you added other graphic elements, filter effects, or complex edits between scenes. Most acquisition video codecs are designed to capture and compress live action footage very well, but those codecs can’t compress other material (for example, title graphics, corporate logos, and so on) well at all. If possible, make sure you use a lossless video codec for export from your video-editing application.

DV codec

The DV codec is used by MiniDV and DVCAM camcorders to capture digital video. The DV codec has a constant (fixed) data rate of 25 Mbps for video and 5 Mbps for audio. The audio data rate can be split over four 12-bit channels or two 16-bit channels.

The DV codec has several software versions, usually specific to each vendor. The Apple DV codec was initially one of the more popular versions used in nonlinear video editing, but many video professionals prefer the Avid DV codec to other versions. The Microsoft DV codec is used by most Windows video applications to capture DV footage.

Modern computers can play DV content without any proprietary equipment or software. Most video encoders handle DV footage well.

DVCPro, DVCPro HD, and AVC-Intra codecs

Panasonic introduced the DVCPro codec for standard-definition video in 1995. DVCPro equipment can play DV tapes, but not vice versa. A DVCPro recording uses twice as much tape as an equivalent DV recording. Although DVCPro equipment isn’t as popular as DV equipment, the newer DVCPro HD format (also called DV100) can record high-definition video at a variety of frame sizes and frame rates. DVCPro HD is considered a higher-quality HD video source than HDV sources; it can achieve data rates as fast as 100 Mbps. The most recent Panasonic video codec is the AVC-Intra codec, which utilizes the same AVC/H.264 compression technology discussed later in this chapter. Panasonic’s AVC-Intra can use either 50 or 100 Mbps video bit rates, and it captures amazing 10-bit color resolution. Most digital video cameras capture only 8-bit color resolution.

One of the reasons professional video editors prefer DVCPro HD source files over other HD formats is that the DVCPro HD codec is an intraframe codec. An intraframe codec does not use temporal compression—every frame in a DVCPro HD clip is a keyframe. You’ll learn more about these concepts later in this chapter.

Unfortunately, the DVCPro HD codec isn’t distributed with all video-editing or video player software. The easiest way to capture and edit DVCPro HD content is to use Final Cut Pro HD 5.0 (or newer) on a Mac.

MPEG codecs

One of the most confusing video codecs is the MPEG codec, mainly because there are so many varieties. The most popular in use today is the MPEG-2 codec, used by DVD Video discs, digital cable, and digital satellite broadcasts, as well as high-definition TV (HDTV) broadcasts. Many standards are evolving around the more complex MPEG-4 specification, including AVC/H.264 video.

Most MPEG video data is multiplexed, which means the video track is tightly interleaved with the audio track, making it more time-intensive (and problematic) for many video-encoding utilities. The process of separating MPEG video from a sync audio track is known as demuxing. If you’ve ever tried to reencode an MPEG file to another format and lost the audio track, it’s likely that the encoder couldn’t demux the audio track from the video track.

Many video encoders use QuickTime as the underlying video architecture to help convert source files into Flash-compatible video format. If you have MPEG-2 footage (including HDV footage), you may need the QuickTime MPEG-2 Playback component. You can buy this component from Apple’s site at http://www.apple.com/quicktime/mpeg2. The MPEG-2 codec doesn’t ship with either the standard or professional version of QuickTime Player.

If you have a DVD Video disc to encode into a Flash-compatible video format, you may need to demux the audio and video tracks of the MPEG files (stored as VOB files on DVD Video discs) before you take the footage into a video encoder. Many DVD Video discs use difficult audio codecs, such as AC3 audio encoding, which might be problematic for your video-encoding software. Several tools are available to transcode MPEG files to another video format before you bring it into a video encoder:

  • MPEG Streamclip: This free QuickTime-enabled utility, created by Squared 5 (http://www.squared5.com), enables you to convert MPEG files into other video formats. As mentioned earlier, if you plan to use MPEG-2 footage with QuickTime, you need the QuickTime MPEG-2 Playback component installed on your system.
  • DVDxDV: This Mac OS X trialware utility enables you convert an entire DVD Video disc to QuickTime file formats. If you need to transcode more than a short section of video from a DVD Video disc into Flash-compatible video, DVDxDV can reduce the work of splicing several MPEG2 files together. Visit the Web site at http://www.dvdxdv.com.
  • Cinematize 2: This Mac OS X and Windows utility can also convert an entire DVD Video disc to QuickTime file formats. For more information, go to http://www.miraizon.com.

Motion JPEG (M-JPEG) codecs

Before the advent of the digital video cameras, many analog capture devices connected to the computer used Motion JPEG (M-JPEG) codecs to capture analog video footage. M-JPEG codecs have been available in QuickTime since version 2.5. If you have source footage in this codec, you shouldn’t have a problem converting it to video.

Hardware-specific codecs

Many high-end professional video solutions use hardware codecs, which means that any video file using the codec must be played on a system with the hardware installed. To convert a hardware codec source file to video, you must run the video encoder on the same system or transcode the source file to an intermediate format.

Apple HD codecs

Apple has several high-quality codecs available for compressing HD source material. The latest, Apple ProRes 422, can be used to encode video from Macintosh computers running Final Cut Pro 6 (or Final Cut Studio 2) or newer. In August 2008, Apple added the Apple ProRes 422 codec to standard QuickTime installations, including Windows. You can also download a decoder utility from this location:

http://support.apple.com/downloads/Apple_ProRes_QuickTime_Decoder_1_0_for_Mac

On the Macintosh, you can also use the Apple Intermediate codec, which can encode high-quality HD video. This codec is not as good as the Apple ProRes 422 codec, but if you don’t have Final Cut Pro, the Apple Intermediate codec is the next best codec to edit and output your HD footage.

Lossless video codecs

As much as the phrase lossless video codec might sound like a contradiction, some video codecs can compress video data without throwing away visual information. Just like ZIP file compression doesn’t lose data during compression, a lossless video codec simply stores the pixel values of the video frame without losing any information that was already present. Several lossless video codecs are on the market. Here are my preferred lossless codecs compatible with QuickTime:

  • Animation: This long-time favorite codec of Adobe After Effects CS4 compositors is automatically included with all QuickTime installations on both Windows and Mac computers and offers excellent compression without loss of quality if you use the Best Quality setting during export. When I converted a sample 60-second DVCPro HD 720p clip at 29.97 fps to the same specifications with the Animation codec, the file size jumped from 545.2 MB to 3.81 GB—seven times bigger!
  • BitJazz SheerVideo: This codec, available for purchase at http://www.bitjazz.com, can achieve lossless compression at a fraction of the file size needed by the Animation codec. The same sample clip referenced for the Animation codec compressed to 956.4 MB, less than twice the size of the original clip. This codec, though, requires much more processing power for both encoding and decoding the video clip. The codec is available in two versions: a free decoding codec and a licensed encoding codec.
  • Uncompressed 8-bit and Uncompressed 10-bit: As their names imply, these codecs don’t actually compress the video data at all, and they produce large file sizes as a result. The 8-bit version supports standard bit depths for YUV video; each channel has 8 bits, or 256 levels. The 10-bit version supports 1,024 levels per channel. Most video that’s destined for online distribution won’t benefit from a 10-bit color channel, but if you need to edit your source video in the broadest color space, use the Uncompressed 10-bit codec. The same sample DVCPro HD clip cited earlier created file sizes of 3.1 GB and 4.18 GB with the Uncompressed 8-bit and Uncompressed 10-bit codecs, respectively.

Ideal source audio format

Just as important to the overall quality of a video clip, the audio codec(s) used during acquisition and editing can affect the final compressed output destined for playback on the Flash platform. When it comes to seeking out the best-quality source file, make sure you’re using uncompressed audio. Luckily, most high-quality video cameras record audio without any compression. This type of encoding is usually referred to as Linear Pulse Code Modulation (LPCM). Examples of digital video formats that use uncompressed audio include DV, HDCAM, XDCAM, DVCPro, DVCPro HD, and some implementations of AVCHD.

If your digital video acquisition format uses an MPEG-based or Dolby AC-3 audio codec to reduce overall bit rate and storage requirements, make sure your video-editing software is not recompressing final edited output. All post-production work should use uncompressed audio.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020