Video Format, Codecs, Filters, Graphs and Container Files
Playing and manipulating videos in Media Center (MC) or WMP requires that certain DirectShow filters are installed and these do not always get included as standard. I have found a lot of conflicting advice and descriptions so I thought I would document what I have learnt.Video is stored in many different formats and files. The base format of video typically for TV tuner hardware or DVDs is MPEG-2 and High Definition (HD) tends to be MPEG-4; a Microsoft format is WMV3. The raw video is then compressed using a Codec (Compressor/Decompressor) and some well known compression formats are Divx and Xvid. Divx and Xvid are codecs for MPEG-4. Audio is stored in a number of ways as well, such as MPEG1 Layer-3 (MP3), MPEG2 Audio or AC3. The video and audio is then stored in a container file, along with meta-data like title and duration. Container files have extensions such as AVI, WMV, MPG, MOV, DVR-MS etc. AVI files can contain several streams in various formats, including Xvid, MPEG-2, MP3 and AC3 so just seeing an AVI extension doesn’t reveal the internal format. Recorded TV in MC is stored in a DVR-MS file which is like an AVI with un-compressed MPEG-2 video. The DVR-MS file is encrypted so that copy protection may be applied.MC, WMP and other video software use Microsoft DirectShow to render the audio and video. DirectShow uses a “Filter Graph” to process a file and this is a set of filters linked together. Typically to play a video, a filter reads the file and passes it to a splitter to split audio and video; the video is then decompressed by a codec and the audio is converted via an audio filter; both streams are then rendered by respective filters. A tool from Microsoft called GraphEdit can be used to view, manipulate and activate filter graphs.
The main codec that was required for MCE was for MPEG-2 and I used CyberLink PowerDVD SE which came as PowerPacks and worked fine. Sometimes CyberLink PowerDVD 7.2 or Nvidia PureVideo is recommended for VMC but Vista includes an MPEG-2 decoder from Microsoft. I have found that I have needed to install an AC3 audio filter (AC3 Filter from http://www.free-codecs.com) to process certain DVR-MS files for some Australian TV channels. FFDShow is open source software that provides a number of useful codecs and filters.
Typically software to play videos will automatically select codecs but a tool called DecCheck from Microsoft will set the MPEG-2 codec for MCE and there is an alternative tool for VMC called VMCD.
Generally my advice is to install the minimum of codecs and filters that you can get away with. I hope that this note gives an introduction to this topic and I hope to post more specific information about codecs in future blogs.
This entry was posted
on Wednesday, February 20th, 2008 at 2:00 pm and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.