Media Delivery Notes
Including fundamental concepts involved in digital video.
To learn from these notes, you should do research on many of the terms you may not understand. Wikipedia and other references are great for research, particularly in teachnical areas such as this. Wikipedia is almost always accurate, but as always, you should attempt to verify information found on Wikipedia. (As you should with any information source.) Also, use good searching skills to dig up other informative sources. The information here was developerd out of notes from a series of lectures presented by Joe Crawford. Thus, this information is not always "complete" since the notes were missing a few bit of information. The information here is still be quite useful, and this page is being continually improved so that it is more complete and polished.Concepts To Understand In Digital Media
Several concepts important to understanding digital video and audio are listed here. Make sure you understand each of these:
- Color bit depth:
- How many bits are used to represent the color of a pixel. Usually this is 24. 8 bits for each red, green, and blue.
- Resolution - true meaning comes from science and deals with being able to distinguish individual objects. We usually use it to mean the number of pixels in an image.
-
Resolution is the number of pixels in an image.
- pixels resolution (number of pixels in the image) is the number of pixels in width multiplied by the number of pixels in height. A 4 megapixel camera, for example, refers to a camera that takes images containing 4,000,000 pixels. If it took square pictures and had square pixels in those pictures, the images width would be 2000 pixels, and its height would be 2000 pixels, because 2000 times 2000 is 4 million.
-
Resolution height and width are the number of pixel wide and tall that the footage/image is. For example,
-
A common resolution given as height and width in pixels would be: 1920x1080
- Sometime, resolution is defined by DPI (meaning dots per inch). This is usually done for print. In this case, you can know the total number of pixels by multiplying the dpi by the number of inches tall the picture is, and then multiplying that result by the number of pixels wide the image is. For video editing, the DPI is not terribly important. Most software will ignore the dpi.
-
- Image aspect/pixel aspect
-
2 kinds of aspect ratio: image(device) aspect and pixle aspect ( very different!)
-
Image aspect (also called device aspect) ratio:
-
The image aspect ratio is the width of the content divided by the height of the content, as measured by the viewer.
Most modern HD content has an image aspect ratio of 16/9 (1.777777)
the old standard definition ntsc ratio was 4/3
-
to get the image aspect (and device aspect) ratio number, divide the resolution width by the height (this only works when pixel aspect is 1)
-
-
Pixel Ratio:
-
defines the shape of every pixel (ratio number is width devided by height)
-
Its a good practice to keep your pixel aspect at 1 until the end exporting of video. Even your “master reel” should be perfect quality and a pixel aspect of 1. Then only make different pixel aspects if you have to go to a format that requires it. (Such as DVDs)
-
when making a new image in photoshop the advance settings can be used to determine the pixel aspect ratio.
-
your demo reel master will end up being 16:9 pixel ratio of 1, probaly at 1280 x 720 (or 1920 x 1080 for full HD)
-
-
- Fields
- Some systems show fields per second rather than frames per second. There are two fields for every frame. These are called "interlaced". Its important to remember that each field represents a different moment in time. For 30 frames per second, there are 60 fields per second. Its kind of like there are half frames at (0.5, 1.5, 2.5, etc)
-
A field is made of rows of pixels across the screen. Usually every odd row of pixels is one field and every even row is another. One “field” is essentially half a frame (or half a picture) made up of every second row.
-
you will almost never have to deal with field options unless its for tv. Even for DVDs we can avoid using field if we save progressive footage onto the DVD.
-
field dominace is which field come first often this is referred to as upper or lower field dominance. If you are using equipment that uses fields (“interlaced”) then make sure you check the stats of the device.. Refer further to field dominance on the internet as it can be complicated.
-
Frame rate is how many images are shown per second. Here are some common frame rates:
-
movies on DVD 23.976
-
film 24 (often digital film is called 24p, meaning 24 progressive+complete frames per second.)
- 24p fps- This is the best frame rate since its the most standard!
-
tv (NTSC) 29.97
-
tv in europe PAL 25
-
- Container Format - The type of file
- The container format is the file format. It is all the data (video/audio/subtiles) combined and organized into a file that meets a certain standard. Every type of container format has its own standard.
- The container format itself has no major complex compression itself, it just holds streams of data. Codecs (described below) are used to compress the data inside of the container.
- Common Container formats
- avi (Old and obsolete. Very limited and should be avoided.)
- webm (The new standard, highly recommended for use on the web.)
- mp4 (Commonly used standard, but subject to patents, so it isn't always free to use.)
- mov (Apple's quicktime container format; may be subject to patents and restrictions, and thus not free to use.)
- mkv (Matroska format, and excellent format on which webm is based)
- wmv, asp
- mpeg ts
- mpeg ps
- ogg
- ogm
- flv (Used to be used for most flash video. Webm or H264 should be used now instead.)
- mp3 (Note that there is also a mp3 codec, which is often placed in simple mp3 container format files with the mp3 extension)
- Codec - a means of compressing data, and then decompressing it later.
- There are seperate codecs for video and audio
- Codecs fall into two main catagories, lossy and lossless. (Codecs can also be uncompressed.)
- Lossy codecs make file size much smaller, but loose quality. The final result doesn't look identical to the input
- Lossless codecs never loose quality, but can make the file size a little bit smaller. The final result looks identical to the input.
- Lossless video codecs
- FFV1 (Recommended for excellent filesize)
- PNG (Recommended when working with Adobe products.)
- Huffyuv
- Lagarith
- H264 in lossless mode
- Uncompressed
- Lossless audio codecs
- FLAC (Recommended for excellent filesize)
- Apple lossless (Recommended when working with Adobe products.)
- Uncompressed
- Lossless video codecs
- Stream
- A stream is a bunch of data of the same type. A video stream is the sequence of images ( streams can be any other type of data as well ex audio, subtitle, alternate video stream, comentaries .....)
- Data in a stream is compressed using a codec, as described in the section above. Difference types of data use different codecs.
- A video stream contains video compressed with video codec
- example of a lossless stream: video compressed with the png codec
- example of a lossy stream: video compressed with the h264 codec
- An audio stream is audio compressed with an audio codec
- examples lossless: flac, aac lossless, uncompressed
- examples lossy: mp3, wma, ogg, aac (dvd, itunes/ipod), mpeg layer 2
- A container format can contain many different streams. For example, it might have multiple audio streams to support multiple languages. Each alternate language could be in a separate audio stream.
- Other Streams
- Could be anything, but is usually uncompressed subtitles. What other types of streams are allowed depends on what the container format supports.
- The bitrate of a stream is how much data it contain per second of content. Common internet video rates for example are around 400kbs. Note that since the bitrate is in bits, not bytes, you must divede it by 8 if you want to know the byterate. (Most webbrowsers etc measure download speed in byterate, not bitrate)
- DVD maximum bitrate is 9.8 mbit/s ( to be more forgiving to imperfect DVD player, you should use around 8.5)
How To Keep High Quality
The golden rule is: Avoid resampling Changing any of the following are all examples of resampling:
- Image size
- Codec (although lossless to lossless may maintain perfect quality if the color spaces are the same)
- Color space
- Footage Speed
- Frame rate
- Fields (except for 3:2 pulldown based conversiong, or any conversion known to be lossless)
- Temporal changes, (footage speed, frame rate, fields) are often the most damaging, even when you are using lossless codecs. If you always work at 24fps (or a multiple, such as 48fps or 96fps) then you can avoid temporal resampling.
Thus, don't change the above things while working with your footage. From rendering, all the way to your master reel, avoid resampling. There will of course likely be times when you can't avoid it, but if you minimize resampling, you will maximize quality. Field and temporal (frame rate) resampling, destroys video the most ...except for 3:2 pulldown based stuff. (Or anywhere else with a known formula.) The also applies to sound. Resampling sound a lot degrades data. If you know you will have to resample, create your source material at a higher than normal resolution. (At least twice whatever the resolution your plan to publish in.) Work at high bit depths/resolutions / sample rates etc, using lossless compression or no compression. This way you won't loose significant quality while you work. If you know you will need to do temporal resampling, (change frame rate or retime video) use a very high frame rate for you initial footage.
Final Output Formats
Common types of output formats: Formats for DVD, in page website video, downloadable video, and lossless/archival video. ****media-delivery-note-a**** (This list must be replaced on this site since it was destroyed in the transition out of concrete5.)
Common Video Standards
(This is just a list. To find out more about a particular standard, see Wikipedia)
- Video broadcast standards
- NTSC - Old standard of North america
- Frame rate is 29.97
- Image aspect is 4:3 or 1.333333333333
- Resolution not officially defined for horizontal pixels. Common resolutions for digital NTSC video:
- 640x480 at pixel aspect of 1 (looses a bit of quality but uses squre pixels)
- 720x486 at pixel aspect 0.9 (maximizes quality but uses problematic non square pixels)
- PAL- Old standard for Europe
- ATSC- New Hi Def standard for North America- http://en.wikipedia.org/wiki/ATSC_Standards
- NTSC - Old standard of North america
- Recording / Storage Media
- VHS
- SuperVHS
- Beta / BetaMax / Digital Beta
- DVD (differences in -R +R -RW +RW RAM)
- Compact Flash, SD, Mirco, MemoryStick, etc - with or without USB mass storage device - Its really good to have these on you so you can show potential employers you run into.
- Since compact flash usually just stores files, this isn't really a "standard". Often, these files will, and should, be encoded for some standard, such as full HD
- Archival, computer file standards (Note: There are literally millions of possible variations for computer based file formats. The following are standards that are common and known to work well.)
- Full HD (HD 1080p)
- Video
- 1920 x 1080 24fps Pixel Aspect=1 Image Aspect = 16/9 Fields=Progressive (No fields)
- Audio
- Sample rate: 48khz Bit depth: 16 bit
- Video
- HD 720p
- The same as above, but using a resolution of 1280 x 720 instead of 1920 x 1080
- Full HD (HD 1080p)
Video For DVDs
A lot of students create poor quality DVD from very good quality source material. This will happen if the conversion to DVD format is not done correctly. If you create the DVD according to the specs here you will get the best possible quality. In order to create a DVD the HD content described above must be processed and put into the correct format. Adobe encore can be used , as can many other DVD authoring programs. Always create your DVD last, after completely finishing your production at its best quality, as a "Master Reel". Always create your Master Reel first, and then create the DVD from the Master Reel. The process of converting the production into DVD format is called transcoding. The format to create transcoded to for the DVD is as follows:
- Frame rate: 23.976
- Resolution: 720×480
- Image Aspect Ratio: 16:9 or 1.7777777
- Pixel Aspect Ratio: 1.21212121
- Fields: None (or No Fields or Progressive)
- Video codec: Mpeg2 video (Your DVD making software may not even give you a choice, if it's proper software, it will create Mpeg2 video.)
- Video bitrate: 8 megabits per second
- Audio codec: PCM or dolby digital
- Audio bitrate: 1 megabit per second
- video and audio bitrates combined together equal around 9 megabits per second
You can also include additonal content (such as computer files) in the DVD rom section of the video DVD.
Rendering From 2D or 3D Animation Or Compositing Software
When rendering from software, for best quality and efficient file sizes, you should render to image sequences in certain formats. For regular images, use PNG format. 24 bit for regular "true color" color quality (32 bits with alpha) 0r 48 bit for extra high color quality (64 bit with alpha). Remember that 24 bits per pixel is the same as 8 bits per channel and 48 bits per pixel is the same as 16bits per channel. If you need HDRI level quality, render to OpenEXR, and use PIZ compression which is lossless. (32bits per channel is recommended for best quality with OpenExr, but 16bit floating point can be used if you need to save space.) You can then use other software (ie Adobe Premiere or FFMPEG) to assemble the image sequence into a video file.
Notes On Using Adobe Products
For best quality and compatibility use this format for your master reel:
- 1920x1080y ( or 1280x 720 if you don't have the computing power and storage to use full HD)
- 16:9 image aspect ratio (or 1.77777777777777)
- 24 frames per second
- Progressive (no fields, not interlaced)
- Square pixels (pixel aspect is 1)
- Container Format: MOV
- Video Codec: PNG
- Video bitdepth: 24 or 32 bits per pixel.
- Sometimes you will have to use an option that says something similar to," render at maximum bit depth". If you see that, check it, turn it on!
- Whenever you see something related to bit depth or color depth, always turn it to at least 24 bits per pixel, or 32 bits per pixel if you need an alpha channel. In some menus instead of saying 24 or 32 it will say Millions of colors or i if you want an alpha channel)
- Audio Codec: Apple Lossless (or uncompressed)
- Audio bit depth: 16 bits per sample
- Audio sample rate: 48 khz (48000 samples per second)
Encoding To MP4 From Premiere:
- Use File > Export > Media
- Choose h264 as the export type (change the option beside "Format:")
- You may need to choose a flexible preset, since some presets lock certain controls so they can't be changed. "hdtv 720p high quality" seems to work well. The "apple tv" preset is known is cause problems.
- Use most of the same settings that you would use for the master reel (resolution, pixel aspect etc)
- (Note, change the profile and level first!)
- Profile: High
- Level: 5.1
- TV Standard: NTSC
- Width: 1280
- Height: 720
- Fields: Progressive
- Aspect Ratio: Square (this is actually pixel ratio)
- Bitrate:
- Bitrate Encode: VBR, 2 Pass (this gives much better quality)
- Target Bitrate: 60Mbps
- Maximum Bitrate: 80Mbps
- For Lower Quality Versions:
- Profile Level 3.1 is the lowest that will allow 1280×720 video.
You can use smaller bitrates for smaller file size. These sizes above are huge, and should result in excellent quality. Most of the time your bitrate numbers can be lower.
Encoding To DVD Using Encore
If you are using encore CS4, you can import your master reel and properly set the encoding by doing the following:
- Iin the project tab. Right Click > Import As > Timeline...
- A timeline as well as an asset will now be shown in the project tab. Find the asset. Under DVD Transcode status, it should say "untranscoded".
- Place the mouse over the asset. Right Click > Transcode settings
- A new window will appear.
- Click the button that says Edit Quality Presets...
- Change the following settings. (If you can't see all the settings you might have to open them by clicking the button that looks like a circle with two down arrows in it.)
- In the main window
- Format: Mpeg2-DVD
- Preset Progressive High quality 7Mb VBR 2 pass
- In the video tab
- Frame rate: 23.976
- Pixel Aspect Ratio: Widescreen 16:9 (1.212)
- Minimum Bitrate [Mps]: 6
- Target Bitrate [Mps]: 7
- Maximum Bitrate [Mps]: 8
- (Note: The bitrate settings can be a bit different, but these ones are known to work well.)
- In the audio tab
- Bitrate [kps]: 256
- (Note: The bitrate setting can be a bit different, but this one is known to work well.)
- Bitrate [kps]: 256
- In the main window
- Now, back up near the top where it says preset, push the "Save Preset" icon. (It is two left from the trash can icon.)
- Call it: HD to DVD
- Click the OK button at the bottom of the window.
- Now it should be back at the Trancode settings window.
- Set the following option. DVD Transcoding > Quality Preset > HD to DVD
- Click the OK button
- Provided that your input file is correct, this should ensure output quality for the DVD you create.
Working With After Effects
A lot of students use after Effects and ruin their footage because they accidentally resample the footage. Make sure you have After Effects setup correctly if you are using it. If using After Effects use "Interpret Footage": Premultiplied - Matted on color "black" (Sssuming your footage came from a program that renders to premultiplied alpha, such as 3dsmax or Maya) Make sure frame rate is 24 frames per second (assuming your source footage is 24fps Creating a Master Reel In After Effects
- Add your composition to the render queue.
- In the render settings, goto Output Module.
- Set it to "lossless". Then, set it to custom. A box will appear with options.
- Change format to "Quicktime Movie". A new window will appear with
- Quicktime settings.
- beside "compression type" choose "png"
- Change the frame rate to whatever you want.
- For color, use "millions of colors" for 24bit or "millions of colors+"
- for 32bit (out with alpha)
- Does that work? Let me know. It might be slightly different for your
- version of after effects.
- Editing Mode: Desktop (or Custom)
- Timebase: 24 frames per second
- Frame size: 1280 x 720
- Pixel Aspect Ratio: Square pixels (1.0)
- Fields: No fields (progressive scan)
- Preview file format: Microsoft AVI
- Codec: Uncompressed UYVY 422 8bit (this doesn’t matter to much, but you may as well set it this way to give yourself decent previews.)
How To Fix Quicktime H264 Gamma, Color Levels, and Washed Out Colors
Quicktime has a bug when showing most h264 video, and it artificially brightens and washes out the color.
If you have encoded h264 video, into either a mov or a mp4 container format, you will likely have encountered this issue.
In order to really understand the problem, you can try watching your animation in several different player applications. In some other software, the colors will actually be fine. Unfortunately, some other software, such as VLC, will show the same problems.
The problem comes from particular settings that probably shouldn’t even exist, and the fact that these settings are generally not correct.
In order to apply the solution below, you need to have Quicktime Pro. (In my opinion: I’m pretty sure that Apple causes this problem on purpose so that you have to buy Quicktime Pro in order to fix the problem. They are a bunch of assholes at Apple.)
Solution:
You can correct the problem in mov files by doing the following:
Open your video in Quicktime pro.
From the menu, choose: Window > Show Movie Properties
In the window that appears, choose “Video Track”, and then click the tab that says “Visual Settings”
In the bottom left you will see several options. Use the transparency dropdown and change the transparency to “Blend”, then set the slider to 100.
Use the same transparency dropdown again and set it to “straight alpha”.
Close the window.
Watch your movie, the color levels should now look correct.
Resave your video. You can save right over the old version, or save to a new filename using the same format.