Video compression. Uncompressed video is extremely large, which makes it hard to store and move. In most cases we compress video to manage it. The amount of compression depends on the task at hand. Contents Some Helpful Concepts!1 Workflows!!!3 Chart of Codecs!!6 Some helpful concepts. Container Video Stream Audio Stream Bandwidth measures how much data can pass through a system in a given time. A hard drive can supply a lot of bandwidth, a broadband connection much less, and a phone line less again. Too big a signal will overwhelm the bandwidth of a device leading to stuttering or very slow downloads. Your aim is to use the right bandwidth for your needs. File size is a related problem. Storage media such as DVDs have limited space. Some older file formats are constrained - e.g. a video file on a FAT32 hard drive is limited to 4 Gigabytes. Media streams are held in a container, the actual file format read by the software. Containers include QuickTime (.mov), Audio Video Interleave (.avi) and Matroska (.mkv) Streams are compressed according to a recipe that codes and decodes the images. We use the word codec. The best known codec is.mp3 which is used to compress music. Codecs can be and not lose any data, but most are lossy and throw away data to make the file smaller. Some codecs are available in different containers - a DV capture can be stored as a.mov,.avi or a raw.dv file. Sometimes we use the same name for the container and the codec. MP4 can refer to both, as can HDV. So it!s important to understand which part of the file is being described. HDV MOV MKV MP4 HDV DV DIVX H264 HDV AIFF MP3 AAC Some examples: a raw HDV file, a QuickTime DV file, a DIVX file and a MP4 file. Page 1
Lossy and Lossless Some compression is. For example when you zip a file it keeps everything and brings it all back when you unzip it again. This is good, but won!t compress a file by much, perhaps less than half. Most codecs are lossy - you are actually losing parts of the picture. But some are visually - you are losing picture but only the parts that don!t matter very much. For example you might have a few slightly different blacks in a picture that can all be made the same colour of black. In QuickTime, Animation & PNG are. Lossless AVI codecs are Lagarith and Huff Y On the Mac, the ProRes codecs are visually. On PC use DNxHD or Cineform Colour Spaces While a computer monitor shows RGB, most video signals are encoded in a colour space called. In this space, Y is the brightness and UV is a colour wheel that ranges (roughly) between orange, green, cyan, and magenta. By combining the colours in a range we save bandwidth. U Most codecs use less resolution for the UV colour. This is like a black and white image with larger regions of colour. 444 means that every dot has a distinct colour. This is mainly used for film, graphics and archives. means that colour (chroma) has half the vertical and half the horizontal resolution of the brightness (luma). This is "broadcast quality! and also used in most JPEG images. V 411 means that colour (chroma) has 1/4 the vertical and 1/4 the horizontal resolution of the brightness (luma). This is used for NTSC DV. You will see these numbers in the names of codecs e.g. ProRes. PAL DV actually uses, by swapping the U and V over lines. HDV is for both PAL & NTSC. Because the human eye has less cells for colour than brightness, we usually don!t notice the colour resolution. But it can show up in some colour and keying tasks. Converting a video file to a less compressed format will not add more fidelity. It can however preserve the existing fidelity. Page 2
Device Colour Management Each printer, screen, projector etc. has a limited ability to reproduce colour. To provide a similar image on different devices we calibrate their image to boost colours that are less efficient and reduce colours that are more efficient. This calibration is stored as a profile. Some video codecs like ProRes include a profile that records how they were made. High definition video uses Req. 709. Web graphics use srgb. Printed graphics use Adobe1998. If you view calibrated video on a screen that doesn!t match the profile it can look wrong. Use Display Settings to change the profile on the monitor. Aspect Ratio Another way we compress video is to use rectangular pixels for horizontal resolution. DV is anamorphic. It uses 720 pixels to cover 768 spaces in width, or 1024 in widescreen mode. HDV is also anamorphic - it uses 1440 pixels stretched over the width that 1920 square pixels would cover. Because of this you need to make sure you view the image in the right aspect ratio - a circle should look like a circle on the screen. Delivery formats When you are ready to supply your work to an end viewer - such as a file to be placed in a drop box - you should use a delivery format. This is a combination of a container and a codec that make a highly compressed file with small bandwidth but an acceptable loss. "Acceptable! depends on the circumstances. For a website such as YouTube the compression is very obvious, but no one minds too much. A file that will be screened in a theatre would need to be much better quality, but can still be quite small. Delivery formats are not designed to be taken back into production - a YouTube video makes very poor source for further work. Don!t store your unfinished work in any of these forms! The best current choice for delivery format is MP4 - specifically a codec called H.264 which gives good results in very small bandwidths. MP4 is a recipe that is used by many companies. Unfortunately MP4 is a complex recipe and so the quality of the codec will vary across software. This is covered in more detail below. Workflows To store unfinished video work you should either keep it in the format in which it was first created (for example keep DV footage as DV) or use a visually or format to avoid generation loss. If you keep the files in the capture format you lose quality only when transitions or effects are applied. Final Cut always converts AVCHD footage to visually ProRes format. It!s important that your timeline matches the format you wish to edit. Use Easy Set Up to match the footage or allow Final Cut to change your sequence settings on import. You can change the sequence settings to adopt a different compression scheme. Page 3
HDV Capture the footage to Final Cut using Log and Capture. Rough edit the footage and then: * If there are only cuts with minimal effects/transitions - export as Current Settings. You!ll lose some quality only at those points. Your file is now HDV in a QuickTime container. * If you!re using many effects and transitions then change the sequence to use ProRes codec. This is an intermediate which can be reworked many times. It!s much larger than HDV. DV If you have shot footage on a DV camera, capture the footage to Final Cut using Easy Setup for PAL DV (check for anamorphic footage). Edit the footage and then in most cases export as Current Settings. DV is extremely robust, but may show loss after 5 or more re-encodes. AVCHD Transfer AVHCD footage to Final Cut using Log and Transfer. The footage will be converted to ProRes (unless you specify Apple Intermediate Codec) and a ProRes timeline created. Graphics Most animators save as still images first, before creating a video. That helps with reworking small errors in the render. Graphics created in Maya etc. should usually be kept in format until the very last delivery. Animation codec at full quality is a good choice here. In many cases the new ProRes 4444 codec will be acceptable as a visually solution. Remember that ProRes holds a profile so your colours may shift when viewing footage on the wrong profile. Both codecs preserve the alpha channel or transparency of the footage. Other channels such as Z-plane are not stored. PC <--> Mac QuickTime on the PC can read/save DV, Animation, JPEG2000 and PNG formats. It can view ProRes but not write. You can also install and use AVID codecs on both. Final Cut can use AVID DNxHD, but will not provide the same acceleration as available with ProRes. Because DHxHD and ProRes are only visually, you!ll lose some quality when moving between them. Delivery You need to know the expected format of the delivery medium. For example UNSWTV, YouTube and the Annual Screen all expect video sized 1280 by 720 pixels (720p). For the Screening, ProRes is needed to master a Blu-Ray disc. Output ProRes. For YouTube or UNSWTV you can use any codec that will keep the file size below the maximum upload. These services automatically convert to h264. Page 4
For your own video hosting you might need to make h264 Once you have selected to export a MP4 (the container) and H.264 (the video codec) with AAC (the audio codec), match the Image Size to the expected screen size. The Data Rate is the most important control of quality and can be anywhere up to the bandwidth of the device being used. Here the bandwidth is 15,000 kilobits per second - more than most Internet connections but usable for disc playback. This file will be about 18Mb in size. In Video Options you can use 1 pass (fast) or 2 passes (slower). 2 passes gives the computer a chance to plan a compression strategy and will result in higher quality, but will double the time taken. Page 5
Chart of Codecs Name Lossy CS Notes PC? Animation No @ 100 RGB Very large files. Excellent for animation storage but high bandwidth can stutter in playback. Lowering quality will cause blocks of colour. Apple Intermediate Codec Intermediate supplied with imovie and Final Cut Express. Designed to hold the signal from a HDV video capture. Good quality for general use when ProRes is not available. Pixlet Yes Old format, don t use. Recommended for editing captures from any high definition camera. 8 bit. Play only (HQ) Same, but with 10 bits of colour resolution. That is more than most cameras provide and will not always make a difference. Use this for specific compositing. (LT) Same, but with a reduced bandwidth. Design for use on laptops in the field. (Proxy) Yes Use only as a placeholder for higher quality footage. Replace the Proxy with full ProRes for the final output. 4444 RGBA or A Very high quality near quality, but smaller than uncompressed. Excellent for motion graphics and high end archive. Uses 12 bits. Has Alpha. Apple VC H.263 Very Don t use. Avid 1:1x No 10 bit uncompressed. Use Apple s version except when needing to transfer to/ from PC. Avid DNxHD A 4 An open-source equivalent to ProRes. Can be downloaded for Mac/PC. Has Alpha. 10 or 8 bit. Avid DV Yes Don t use, use DV-PAL. Avid DV100 Yes Don t use. Avid Meridien Compressed Avid Meridien Uncompressed Yes No Don t use. Don t use. Avid Packed RGBA An equivalent to Animation. DV - PAL Yes DV - NTSC Yes 411 DVCPRO Yes H.264 Very Use for all DV editing. Do not use NTSC in Australia. Use for all DVCPRO editing. An excellent delivery format. Used by AVCHD and DSLR cameras at high bandwidth. Generally not good for editing, should be converted first. Page 6
Name Lossy CS Notes PC? HDV Yes The codec used by HDV cameras. If you are just trimming the footage from a HDV camera, choosing this will output it unchanged. JPEG 2000 Yes RGBA? Can be at full quality, otherwise it will reduce colour resolution as quality is lowered. MPEG IMX Yes Specific to a camera type. MPEG - 4 Yes Less complex than H.264, used for devices such as mobile phones. None No RGBA No compression at all! Huge files, huge bandwidth. Photo JPEG Yes Lossless at full quality otherwise it reduces colour resolution. PNG No RGBA Lossless. Complex codec is slow to play, use for archive only. Uncompressed 10 bit Uncompressed 8 bit No Lossless at full quality. 10 bit is appropriate for high bandwidth sources (not most cameras). No Lossless at full quality. Smaller than None, but still very large. XDCAM Yes Specific to a camera type. AVI Codecs on PC suitable for production (most are third party) Name Lossy CS Notes Mac? DivX, XviD Yes 411 Do not use. This is a delivery format only and inferior to H.264 Perian Cineform Included in older versions of Vegas, also available for purchase. Highly sophisticated intermediate. DV Yes H.264 Yes 411 Use for all DV editing. An excellent delivery format. Used by AVCHD and DSLR cameras at high bandwidth. Most PC editing software can edit this directly, but you should transcode to avoid generation loss. Huff No RGBA Lossless, with about 2x compression. Fastest codec. Perian Lagarith No RGBA Lossless, with about 2x compression. Slightly better compression. Some software (Vegas 9) can have issues with it. MJPEG Yes Many versions are available, including in FFdshow. Can be used for SD editing where DV was not used. MSU Lossless No RGBA Very slow. Smallest uncompressed files. Uncompressed No RGBA Very large, slow. VP3, VP8 Yes 411 Do not use. This is a delivery format only. Page 7
A note about "codec packs#. Many websites offer large bundles of PC codecs taken from many sources. Avoid these, as they often mix old and incompatible codecs, mostly for viewing downloaded movies. The only useful "pack! is FFDshow, which is compiled version of the open source ffmpeg library. FIRST VERSION 2010 TOM ELLARD COLLEGE OF FINE ARTS Page 8