Asalready mentioned the MPEG-4 Standard defines its own Container Format:MP4 (other container formats not covered by the Standard are forexample AVI, OGM, Matroska aso...), which allows not only the storageof audio and video content but also of animated/interactive content(also known as BIFS), as defined in MPEG-4 Systems, as needed forDVD-like Menus for example (MP4 has now been moved from ISO 14496-1 toits own ISO 14496-14)
Interactivity/Animation
without getting into technical details the MPEG-4 Systems Standarddefines a broad range of powerfull tools which allow all sorts ofanimations (similar to what we know from flash) or interactivity (forexample as known from DVD Menus...)
These animations/interactivity can be done in both 2D and 3D
To check out some nice samples of what MPEG-4 Systems can provide have a look here
Note that to playback systems files you also of course need a systemsdecoder/player, where the most popular ones for Systems 2D content are GPAC's Osmo4 (supports now 3D too) or EnvivioTV - for Systems 3D also have a look here
Interoperability
the MP4 container is a very important part of the MPEG-4 Standard, asif you want to reach 100% interoperability between different MPEG-4 A/Vimplemenatations there is no way around using a standardised containertoo
on the contrary still the most popular container format is AVI, alsofor MPEG-4 video content, and the AVI container is also the majorreason when it comes to incompatibilities between exisiting MPEG-4stuff (ie on hardware players)
further documentation
If you want to read more about the MP4 container have a look at the MP4 FAQ in the New A/V Container forum
some documentation on MP4 is available from here and here
A FAQ especially about MPEG-4 Systems is available from the Motion Picture Experts Group (MPEG)
also if you are interested in the described interactive content also have a look at this document from the GPAC project
A draft of the MPEG-4 Systems Specs can be downloaded here
The Specs for the ISO base media file format (14496-12), on which MP4 is based on, can be found here
ISO 14496-2 (Video) - Advanced Simple Profile (ASP)TheMPEG-4 Standard defines a broad range of video coding tools. The atmmost widely used ones are defined under ISO 14496-2, thats why thispart of the Standard is also often called MPEG-4 "Part 2", but i willcall it from now on MPEG-4 ASP as described below
MPEG-4 Part 2 Profiles
As already mentioned the MPEG-4 Standard aims at multiple applications.Of course for different usages also different coding tools are needed(ie if you want to stream video content at very low bitrates you willuse different tools as if you want to make a dvd backup copy at mediumor high bitrates)
to cover all these different needs the MPEG-4 Standard defines a lot ofdifferent Profiles and Levels. each profile/level is aninteroperability/conformance point, ensuring that all products,following a specific profile/level, even if from different vendors, canwork together.
these profiles/levels standardise not only what encoding tools can beused but also define for example the allowed bitrate-range,image-sizes, frame-rates aso...
For an overview on available MPEG-4 profiles have a look here
Advanced Simple Profile (ASP)
When it comes to DVD Backups the Advanced Simple Profile @ Level 5 (ASP@L5) is the one to follow
It allows frame sizes up to 720x576, frame-rates up to 30fps and offersadvanced coding tools like B-Frames (B-VOPS), QuarterPixel MotionEstimation (QPEL), Global Motion Compensation (GMC) and MPEG/CustomQuantization, in contrary to the the Simple Profile, which also onlyallows a max. frame size of 352x288 and 15fps for example
the most important Advanced Simple Profile tools (not available in Simple Profile) are:
B-Frames/B-VOPS/Bi-directional encoding/prediction:
In contrary to I-Frames/Keyframes (which include the entire image anddont depend on other frames) or P-Frames (which include only thechanged parts of the image from the previous I- or P-Frame), B-Framesare constructed using data from the previous and next I- or P-Frame.B-Frames can be compressed much more than other frame types, whichoverall should help quality and compressibility.
Quarter Pixel Motion Search Precision (QPEL):
basically most MPEG-4 codecs by default detect motion between two frames down to half a pixel (HalfPel)
Now with QuarterPel you can detect motion that is only a quarter of a pixel per frame, effectively doubling precision!
practically this means that you will get a much sharper image withQPEL, try it and you will love it (that's my opinion of course javascript:window.open(this.src);" style="CURSOR: pointer" onload="return imgzoom(this,550)"> )
Global Motion Compensation (GMC):
GMC detects if there is an amount of motion big parts of the frame havein common. If thats the case GMC kicks in, using a single motion vectorfor all similar parts of the frame instead of multiple ones.
practically this helps saving bits when panning, zoom or rotationoccurs (depending on how good the GMC implementation is/offeredwarppoints), bits which than can be used somewhere else, for examplewhere they bring more sharpness.
MPEG/Custom Quantization:
While with MPEG-4 Simple Profile you can only use the h.263 quantization type, the ASP also allows you to use custom ones
While the h.263 type will bring you a softer image (good for 1CDencodes), the default MPEG matrix is better for higher bitrates,preserving more details
a popular custom matrix is for example hvs_good, also nice for lower bitrates, but there are also many more
Adaptive Quantization:
When encoding with a Variable Bitrate (eg in 2pass) each frame can getcompressed with a different quant (the higher the quant the smaller thesize/bitrate of the frame). What frame gets what quant (eg compresshigh motion more) is decided by the "Rate Control".
With Adaptive Quantisation (also available in Simple Profile) the quantcan additionally also differ inside each frame (eg high motion/darkparts of the frame get a higher quant/compressed more, faces get alower quant than background, aso...)
basically MPEG-4 ASP became popular with the famous DivX5 Codec, whichname is also often used to describe content following ASP@L5 (likepeople name all sorts of Cola, even Pepsi, as "Coca-Cola"), but itsimportant to realise that there also exist other MPEG-4 ASP codecswhich are not more or less compatible to MPEG-4 as DivX5:
available MPEG-4 ASP Codecs
ASP codecs are available atm from XviD (binary), DivX5, DivX4/OpenDivX, ffmpeg/ffvfw/ffdshow, 3ivx, Nero Digital, Skal, Quicktime, mpegable, Envivio, Sorenson and many more...
doom9's quality comparisons: 1 2
(note that DivX3.11 aka MS MPEG-4, RV9, VP6 and WMV9 are not MPEG-4 compliant!)
XviD
maybe one of the most advanced MPEG-4 ASP codecs, highly tuned for DVDBackups and offering a very broad range of encoding tools (includingmore than 1 B-Frames, QPEL, GMC (3 warppoints), h.263/MPEG/CustomQuants, Adaptive Quants, Trellis and much more)
XviD is open source (GPL) and THE codec of the Doom9 community, where it also has its own XviD Forum, where the XviD developers are also often around (as i am sure you know already )
For more infos about XviD visit the official Homepage XviD.org, read crusty's FAQ and of course the XviD Forum on doom9
DivX5
maybe the most popular and most widely used MPEG-4 ASP Codec, mainlyliving from its name tough. It offers less MPEG-4 ASP features (up to 2B-Frames, h.263/MPEG Quant, a weak GMC (1 warppoint), QPEL) and somepeople claim also less quality than XviD
still its THE codec in the business world and the codec which made MPEG-4 ASP popular
For more infos about DivX5 visit the official Homepage DivX.com and the DivX Forum on doom9
ffmpeg
ffmpeg (aka libavcodec/format) is surely THE implementation of MPEG-4when it comes to completeness. ffmpeg is offering as good as all toolsimaginable (eg error resilience) and is opensource (LGPL)
still when it comes to encoding it often stands in the shadows of XviD,but it provides good quality and is a very important implementationmany other projects are heavily based on (for example the famous mplayer or ffdshow use it)
For more infos about ffmpeg visit the official Homepage ffmpeg.org and the New A/V Formats - Codecs forum on doom9
3ivx
tough one of the oldest MPEG-4 codecs around (the devs claim even olderthan DivX5), 3ivx became popular in the last months. 3ivx' video codecoffers h.263/MPEG Quants, Adaptive Quant., 4MV (but not B-Frames, GMCand QPEL) and was the first to set a PAR
3ivx does not only offer Video Encoding but is an allroundimplementation of the MPEG-4 Standard including also AAC encoding(FAAC) and maybe one of the best MP4 container tools available
For more infos about 3ivx visit the official Homepage 3ivx.com and the New A/V Formats - Codecs/Containers forum on doom9 (where you can also find some of the devs sometimes)
Nero Digital
the MPEG-4 ASP codec from nero is maybe the youngest one, but nero is very ambitious in becoming very popular
atm their codec is only available inside Nero Recode2(together with a good AAC encoders (HE-AAC, Multichannel...)). NDoffers only 1 B-Frame, GMC (3 warppoints), QPEL, h.263/MPEG/CustomQuants, Adaptive Quant. (Psy High) and is one of the fastest codecsaround
For more infos about NeroDigital visit the official Homepage NeroDigital.com and the New A/V Formats - Codecs forum on doom9 (where you can also find some of the devs sometimes)
MPEG-4 ASP on Hardware - DivX/NeroDigital Certification / Private MPEG-4 Profiles
Some first generation hardware decoder chips werent able to handleimportant tools the ASP offers (ie QPEL and GMC). Today's chips aremore powerful and support for example QPEL and 1 Warppoint GMC already(none supports 3WP GMC till now)
For being able to support also players, which uses even the oldestchip, DivXNetworks and Nero created something which can be calledprivate MPEG-4 Profiles, namely the DXN Home Theater Profile (DXN HTP)and the ND Standard Profile (ND StP). Every player who is able as aminimum to handle the DXN HTP and ND StP (next to other stuff) can geta Certification from DivXNetworks and/or Nero
When encoding following the HTP/StP for example you cant use QPEL orGMC and use only 1 B-Frame. therefore basically the HTP/StP are atradeoff between quality and usability with old hardware decoder chips
of course these private certifications also help DivXNetworks and Nero to establish their brand-names even more
still the correct expression for what we need a player to support is MPEG-4 ASP@L5,if a player is offering this you should be able to play your encodesfollowing MPEG-4 ASP (no matter what encoder was used) without problems
further documentation
If you want to read more about MPEG-4 Video you can have a look at the page of MPEG Industry Forum, providing an overview of available Resources and Tutorials/Papers
The Specs for the Amendment1 to 14496-2 can be found here
Also important to mention is the Site of the Moving Picture Experts Group (MPEG), offering a FAQ especially about MPEG-4 Video or an overview of the MPEG-4 Standard (including many Infos on MPEG-4 Video too)
also if you simply search for "MPEG-4" on google you will find more than a lot of usefull sites too
ISO 14496-3 (Audio) - Advanced Audio Coding (AAC)
The MPEG-4 Standard defines maybe one of best audio formats available at the moment: AAC (Advanced Audio Coding)
AAC is able to include 48 full-bandwidth (up to 96 kHz) audio channelsin one stream plus 15 low frequency enhancement (LFE, limited to 120Hz) channels, up to 15 data streams and much more
AAC Profiles
Like with MPEG-4 Video, AAC comes in different Profiles, from which theLow Complexity (LC AAC) Profile (aka MAIN @ Level 2) is the one mostwidely used in the consumer market (for example in Apple's very populariTunes music store)
other profiles are for example the Long Term Prediction Profile (LTP), Scalable Sampling Rate (SSR) or Low Delay (LD)
quality comparison of LC AAC with other good formats @ 128kbps (thanks to rjamorim):
note that lame (the best mp3 codec available) and vorbis provide in their latest versions much better quality (as you can see here)
also note that the wma codec used in this test is wma9 pro, which is atotally different and better quality providing codec than the standardwma9 codec (which is the one used in music stores and cd players) andto which its not backwards compatible
when it comes to low bitrates and multichannel encoding AAC offers theHigh Efficiency extension (HE AAC), making it one of the best formatsin the low bitrate range too:
quality comparison of HE AAC with other popular formats @ 64kbps (thanks to rjamorim):
note that QT is the LC AAC codec offered in Quicktime, He is the HE AAC codec offered in Nero
when it comes to very low bitrates also the Parametric Stereo extension(PS AAC), which uses HE AAC at the same time too, has to be mentioned(Nero is working on an implementation). How it does compared to othercodecs at 32kbps can be seen here
available AAC Codecs
AAC codecs are available atm from Quicktime/iTunes, Nero (offers HE AAC), FAAC (binary), Psytel, Compaact!, Winamp5, Real (offers HE AAC), NCTU, wkwai and Sorenson
rjamorim's quality comparisons: 1 2
further documentation
If you want to read more about the AAC Audio Format have a look at the AAC FAQ in the Audio Encoding forum or at the audiocoding.com wiki
A FAQ especially about MPEG-4 Audio is available from the Motion Picture Experts Group (MPEG)
Drafts of the MPEG-4 AAC Specs can be downloaded here, here and here
also the 3GPP Specs Homepage offers interesting links regarding AAC (Specs TS 26.401 - TS 26.411) including SBR (HE AAC), source code aso...
ISO 14496-10 (Video) - Advanced Video Coding (AVC)WithAVC/H.264 the MPEG-4 Standard defines one of the newest and also one ofthe technically best available, state-of-the-art Video Coding Formats
The AVC/H.264 Video Coding Standard was together finalized andidentically specified in 2003 by two Groups, the MPEG (Moving PicturesExperts Group) from ISO and the VCEG (Video Coding Experts Group) fromITU (International Telecommunication Union), a suborganisation of theUnited Nations (UNO), which also standardised the H.263 format (mainlyused in video conference software now)
The AVC/H.264 Standard itself was developed by the Joint Video Team (JVT), which included experts from both MPEG and VCEG
Looking from the MPEG side the standard is called MPEG-4 Part 10 (ISO14496-10), looking from the ITU side, it is called H.264 (the ITUdocument number), by which the format is widely known already
As "official" title for the new standard Advanced Video Coding (AVC)was chosen by MPEG - as video counterpart to the Advanced Audio Coding(AAC) audio format
AVC/H.264 Profiles
AVC/H.264 defines four different Profiles: Baseline, Main, Extended andHigh Profile (which themselves are also again subdivided into Levels):
- Baseline Profile offers I/P-Frames, supports progressive and CAVLC only
- Main Profile offers I/P/B-Frames, supports progressive and interlaced, and offers CAVLC or CABAC
- Extended Profile offers I/P/B/SP/SI-Frames, supports progressive and CAVLC only
- High Profile (aka FRExt) adds to Main Profile: 8x8 intra prediction, custom quants, lossless video coding, more yuv formats (4:4:4...)
Only the future will tell which Profile and which Tools will be the onemost usable for DVD Backups, but i assume it will be the Main and/orHigh Profile with maybe the following tools (also check out the tooldescription of MPEG-ASP as all, except GMC, are available in AVC too):
CAVLC/CABAC:
AVC/H.264 defines two, more advanced tools for entropy coding of thebitstream syntax (macroblock-type, motionvectors + reference-index...)than MPEG-4 ASP: Context-Adaptive Variable Length Coding (CAVLC) andContext-Adaptive Binary Arithmetic Coding (CABAC)
CABAC, compared to CAVLC (aka UVLC) which is the default method inAVC/H.264, is a more powerful compression method, being said to bringdown the bitrate additonally by about 10-15% (especially on highbitrates). CABAC (as CAVLC) is a lossless method and therefore willnever hurt the quality, but will slow down encoding and decoding.
Loop/Deblocking Filter:
in contrary to prefiltering (for example via avisynth, done on theinput), or postprocessing/filtering (via the decoder, done on the finaloutput), LoopFiltering is applied during the encoding process on everysingle frame, after it got encoded, but before it gets used asreference for the following frames. This helps avoiding blockingartifacts, especially on low bitrates, but will slow down encoding anddecoding
Variable Block Sizes/Macroblock Partitions:
in contrary to MPEG-4 ASP (where, only with Inter4V/4MV, the BlockSizes can varry between 16x16 and 8x8 pixels), AVC/H.264 offers forMotion Search Precision the division of a macroblock down to 4x4 pixels(including steps like 8x4...). The Block Size is adaptive/variable, agood encoder will be smart enough to decide which one is the mostefficient Block Size in every specific macroblock
Multiple Reference Frames:
in contrary to MPEG-4 ASP (which only allows using the frame before theactual frame as reference), AVC/H.264 offers choosing from multipleones for inter motion search, which means the codec can decide whetherhe wants to simply refer to the previous frame (like in ASP) or even toa frame before that. Because of that (eg a P-Frame can refer to a framebefore the latest I-Frame) a new frametype had to be introduced:IDR-Frames, which are I-Frames before which no following frame isallowed to refer to. Allowing multiple reference frames will slow downencoding and decoding and cutting will be only possible at IDR-Frames
Weighted Prediction:
With Weigthed Prediction there can be weights applied to a referenceframe (eg you can scale (brightness-wise) a previous picture). Thishelps especially whenever there are fades, where the subsequent pictureis very similar to the previous one except that it is darker. WP willnot help with cross-fades (eg a fade from one scene to another)
Rate Distortion Optimisation (RDO):
RDO allows the encoder to make the most efficient coding decisionswhenever it has to choose between different choices (for example whenit comes to inter/intra decisions, motion search...)
RDO is not a tool defined by the AVC/H.264 specs, but it's a newdecision making approach which was first introduced by the H.264reference software. Other codecs can also make use of RDO, like XviD'sVHQ Mode enables RDO already for example
An overview of AVC/H.264 compared to other popular video coding format has been kindly set up by akupenguin:
available AVC/H.264 Codecs
AVC/H.264 implementations are available atm already from x264 (binary), Nero, mpegable, MainConcept, Sorenson, Moonlight, CyberLink, VSS, Envivio, Hdot264 (binary), DSPR, JM (reference software) (binary), ffmpeg, Philips
(announced codecs: Skal, Apple, Sony)
Encoders
- x264: opensource (GPL) encoder (Source), available as VFW codec: sex264 or ffdshow, as commandline: mencoder (GUI) and inside the Handbrake tool (available for Linux, MacOS and BeOS)
x264 supports 2pass, CABAC, Loop, multiple B-Frames, multiple Reference Frames, 4x4 P-Frame Blocksizes, 8x8 B-Frame Blocksizes
- NeroDigital AVC: useable in Nero Recode2, outputs .mp4
ND AVC supports 2pass, CABAC, (adaptive) Loop, multiple B-Frames,mulitple Reference Frames, weighted prediction, 8x8 P-Frame Blocksizes,16x16 B-Frame Blocksizes, Adaptive Quant. (Psy High)
- mpegable: available as free VFW Encoder (not based on the reference), doesnt handle YV12
mpegable supports 1pass (fixed quants) uses P-Frames only, 8x8 P-Frame Blocksizes, CAVLC only, Loop
- MainConcept: available in a free unlimited preview encoder app. (adds a watermark), outputs .mpg (TS output is buggy)
MainConcept supports 1pass (CBR/VBR), P-Frame Reordering, CABAC, Loop, 1 B-Frame, Multiple Ref, 4x4 P-Frame Sizes and RDO
- Sorenson: useable in Sorenson Squeeze 4, outputs .mp4,
Sorenson supports 2pass and B-Frames (seems to use the MainConcept AVC implementation (decoder?))
- Moonlight: useable in Moonlight's OneClick Compressor and CyberLink's PowerEncoder, outputs .mpg
Moonlight supports 1pass (VBR/CBR/Fixed Quants), CABAC, Loop, 2 B-Frames, 8x8 P-Frame Sizes, Adapt. Quant, PAR, Interlacing
- JM:The AVC Reference Software offers in Version 9.3 already Main and HighProfile: B/SP-Frames, CABAC, Loop Filter, 4x4 Blocksizes, multipleReference Frames, Adaptive Quant, Error Resilience, RDO, LosslessCoding, Custom Quants, Rate Control aso...
- Hdot264:opensource (GPL) VFW version of the reference software by doom9 membercharact3r, still based on a very old version of the reference (JM 4.0c)
- VSS: free preview VFW Encoder (limited to 5 days), based on the reference encoder
- Envivio: useable in 4Coder, outputs .mp4
Decoders
- ffmpeg: opensource (LGPL), used already for example in ffdshow (VFW and DShow decoder), mplayer and VideoLAN
ffmpeg supports B-Frames, CABAC, Loop, Weighted Prediction...
- VSS: free preview VFW Decoder (limited to 5 days) and an unlimited DShow Decoder
VSS DShow supports .avi (with VSSH and H264 fourcc), CABAC, Loop, B-Frames
- NeroDigital AVC: DShow Decoder and .mp4 Parser coming with Recode2
ND AVC supports B-Frames, CABAC, Loop, Weighted Prediction...
- Moonlight: offers a free DShow AVC decoder (adds a watermark) together with Parsers handling AVC as .mpg, .mp4 and .264
- mpegable: free VFW decoder (usable also in DShow), supports .avi (with DAVC fourcc)
- MainConcept: the preview offers a free DShow AVC decoder (adds a watermark) and a Parser handling AVC as .mpg and .264
- Envivio: not freely available AVC DShow decoder called EnvivioTV, handling AVC in .mp4 (since 2.0, current version: 2-1-181)
- Philips: DShow AVC decoder freely available in the AVC Alliance player (handles raw AVC only)
- Pegasus: not really compliant DShow AVC decoder available here
Sample content
small MPEG-4 ASP vs. AVC comparison @ 460kbps:
MPEG-4 ASP (XviD 1.0 RC2 - h.263, QPEL, VHQ4, ChromaMotion, Trellis, 2 B-Frames, other settings on default):
current issues with AVC/H.264
If you sniff throught the available AVC implementations you will surely find out soon that there are some issues:
- interoperability: most implementations support different container formats atm:
.mp4: which is the container of AVC defined in the MPEG-4 Standard (ISO14496-15) and supported by Nero, Sorenson, Envivio and Moonlight atm
.mpg: which is the container of AVC defined in the MPEG-2 Standard (ISO13818-1, AMD3) and supported by Mainconcept and Moonlight atm (alsoBlu-ray's BD-ROM will use it)
.avi: using AVC-in-AVI is nowhere standardized and therefore already causes incompatibilies. The limitations of AVI and VFW,together with the necessary hacks caused by these two formats, hinderthe full implementation of all possible features AVC offers (and mighteven prevent it as some things, like advanced AVC frame coding orders,are simply not possible in AVI and VFW) and therefore harm the possiblequality or at least the speed of the development, the interoperabilityand therefore also the competition. AVI is currently supported by VSS,x264 (both mencoder and vfw) and mpegable
.264/.h264: the raw bitstream as output by the reference encoder forexample (x264 in mencoder can output it too, mp4creator can demux from.mp4 to raw too)
- speed: some current encoder implementations are pretty slow (mostly the commercial previews)
still x264 and NeroDigital's AVC encoder seems to offer already a nicespeed and quality. But this doesnt change the fact that AVC is a veryadvanced video coding format and therefore encoding on old CPU's can bevery time consuming
MPEG-4 AVC/H.264 on Hardware - HD-DVD/Blu-ray
Two organisations (the DVD Forum and the Blu-ray Disc Association) arecurrently working on the successor of the popular DVD format, whichwill support so called High Definition content (larger picture sizesthan current DVD): HD-DVD and BD-ROM
As reported here the DVD Forum already made the decision that MPEG-4 AVC/H.264 will be used as mandatory video codec for HD-DVD
Also the Blu-ray Disc Association has announced the inclusion of MPEG-4 AVC/H.264 as can be read here
It is therefore very likely that AVC/H.264 will be THE upcoming videoformat, which will be widely used and supported, like it is the casewith MPEG-2 (used in DVD) today
further documentation
If you want to read more about the MPEG-4 AVC/H.264 Format have a look here for a detailed overview about the Format (also covering the technical side)
For some more summarized infos look here or here
The AVC Verification Test Results can be found here or here (html)
The whole specs of AVC/H.264 can be downloaded here (Draft from the 7-14 March 2003)
Technical Info about Blu-ray is available here