Skip to content Skip to navigation

Video Encoding: Techniques and Standards

Almost everyone in attendance is tasked with encoding video - Mostly Flash, some QT, couple WM
Episode is software used for encoding - allows the creation of all these video formats
Pre-processing is the first step in the process - de-interlace, resize, crop, add watermark, etc. - this can add time to processing, but is very important in preparing video for encoding.
Encoding (or transcoding in this example) is the process of compressing the video using a specific algorithm, or codec.

Understand the specifics of your ingest format:
Sony HDV is reverse engineered to use convention MiniDV tapes. It's actually MPEG-2. It encodes on the fly, so 25 mbit/sec, so same as std def 720x480. Need to have the playback codecs to play this! So this is a transcode. Start with highest quality source. Give the encoder as much info as possible, and let it discern how to use that, and throw out what it doesn't need.

QT inspector will list format details. 1440x1080 stretched with trickery to 1920x1080. MediaInfo Mac, PC, Linux provides indepth info on video & audio streams as well as MediaInfo on SourceForge - both of these tools are free :)

Standard data rates for encoded video delivered via the web:
800 kbits is what most users can receive.
used to be 300 kbits
sweet spot or having enough without buffering issues, 800 kbits is practical, some at home with Comcast can receive 1200 kbits.
Brent: iTunes 320, YouTube 1.2 and YouTube re-encodes it.

Streaming vs progressive downloads. YouTube - a lot of people consider this a standard. Maybe have a higher encoding for various platforms, like a 52" screen with a set top box.

Forrest is using 500 kbps. Flash is a wrapper with several codecs. Sept 2008 Flash Player 9 supported H.264. So could deliver to multiple platforms. New WMP can handle H.264.

Episode demo... It ships with some templates & presets. Or start with something a little bigger & better and tweak down.

KEEPVID Bookmarklet, - allows you to grab a video off youtube for analysis.

H.264 better video quality but more processor intensive, than MPEG-4 (easier for older or legacy machines). MacBook Air couldn't keep up! Video takes full advantage of processor for encoding and decoding. MPEG-4 worked fine on the original MacBook Air.

Handbrake default FLVs of 300 or 800 (big size difference). Processor in the iPhone is a lot difference. There are specific ranges in, say, set top boxes. iPod presets seem to work well with Instant Handbrake (Joseph).

Variable Bit Rate vs Constant Bit Rate - Streaming is better with constant. Progressive download will work better with variable.

Keyframes and delta frames (diff from last frame) - spatial compression (common background objects, etc.) vs temporal compression (frame to frame). Keyframe distance - if shot in 29.97, encode in 29.97, too. Could encode at 15. At least one keyframe every 10 seconds is the rule of thumb.

Transitions, i.e. dissolve where every pixel changes, can be inefficient.

QT Pro automatic keyframes is good. Too many keyframes can degrade the quality and make the video look blocky.

PAL is 25fps.

NTSC is interlaced. Need to de-interlace before publishing content to the web. Most of this can be accomplished but it varies across SW and HW packages. Various algorithms to strip out this stuff.

Now HDV cameras shoot in progressive or 1080p vs 1080i interlaced. So, shoot progressive whenever possible to avoid the combing effect of interlacing, especially if shooting for the web.

Resizing - what sizes are we using now?
320x240 was old standard. YouTube is moving to VGA. iTunes is VGA (lot of talking heads).

YouTube can scale video up in the brower, like 640

Aspect ratio - 16:9 or 4x3 -- make sure this is true through to delivery
720x480 ---> 640x480 - so squishing the video, so allow to distort. Use None(distort).

1920 downscaling to 480 - pre-processing using Lowpass for large downscales (downscales first, before encoding) -- this will provide much better quality, otherwise scaling can be really poor, and output as well.

Can add watermark, too.

Software doesn't convert from 29fps to 24fps very well. Compress with optical flow works well. Otherwise shoot at 24fps.

Audio - mono or stereo. As MP3, a 64kbps stereo file is really two 32kbit monos. Unless true stereo needed, better to use mono. Use setting appropriate for your purpose. Sometimes stereo can reverb in headphones if not balanced well. Hence, easier to use mono.

44.1K vs 48K sampling. AAC is part of H.264 spec. Advanced Audio Codec (AAC).

Data rate, size, frame rate.

Data rate and frame size - bits per pixel 320x240 and data rate inkbits - Gordian Knot 0.094 Bits/pixel*Frame -- target is 0.1 for the web.

Too many keyframes will look jumpy.

Episode can export settings as an XML document, to re-use elsewhere.

Next meeting: Telestream Wirecast - multiple HDV sources on the fly. Only have the Mac Pro from Apple for 30 days, so we'll see you soon. We'll need additional HDV cameras.