Codec Notes for Microsoft Windows

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 10:11, 24 June 2007 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

codec means COmpressor/DECompressor:

a software routine that compresses the raw video ready for storage, and then decompresses it to display on your PC.

You may hear AVI described as a format – it isn’t. AVI is technically what’s known as a container or wrapper, just the same as Apple’s QuickTime.

video held inside AVI files can be compressed with different codecs


How to install/uninstall DLL and AX codec/filter files

1. Unarchive the package and use the files from Release folder if you're running Windows 9x/Me or Release Unicode if you're running Windows 2000/XP.

2. Copy DLL or AX files in system32 folder [ C:\WINDOWS\system32 ]

3. Click on Start > Run...

• To install the files, type: regsvr32 filename.dll or regsvr32 filename.ax
• To uninstall the files, use: regsvr32 -u filename.dll or regsvr32 -u filename.ax

Run dialog box



4. In the end, you should receive a message saying that your file was succesfully installed/uninstalled.

The file was succesfully installed



An easy way to register/unregister [install/uninstall] the files is to use one of these small tools:

• RadLight Filter Manager - can be used to list all registered codecs and to register or unregister codecs.
• DirectShow Filter Manager: helps to list, sort, find, add or remove DirectShow filters.
• RegShell - a handy utility that will help you avoid the inconvenience of running regsvr32 from the start menu all the time.
• Emsa DLL Register Tool - register dll/ocx filters, codecs... and get extended file informations.


Some of the more common filters

• "iviaudio.ax" - WinDVD Audio Decoder filter.
• "ivivideo.ax" - WinDVD Video Decoder filter.
• "claud.ax" - PowerDVD Audio Decoder filter.
• "clvsd.ax" - PowerDVD Video Decoder filter.
• "DSCinemAudioDecoder.dll" - CineMaster v4 Audio Decoder filter.
• "DSCinemVideoDecoder.dll" - CineMaster v4 Video Decoder filter.

Note: Sometimes you need to specify the fully qualified path name to files (i.e. c:\program files\intervideo\common\bin\iviaudio.ax)



How to (re)install Default Codecs in Windows XP/2000

1. Choose Start > Control Panel and click Add hardware, then click Next from Add Hardware Wizard. Click "Yes, I have already connected the hardware" then click Next button, again.

2. Choose Add a new hardware device at the bottom of the list and click Next. Select "Install the hardware that I manually select from a list (Advanced)", and click Next.

3. Select "Sound, video and game controllers" from "Common hardware types" list and click Next. Select "(Standard system devices)" from "Manufacturer" and click Have Disk... button.

4. Click Browse in the Install From Disk dialog box and open the folder C:\Windows\System32 Find mmdriver.inf file, select it and click Open then click OK in the Install From Disk dialog box. If you see a warning about logo compatibility, just click "Continue Anyway".

5. Now you should finally see a list of audio codecs.



Amongst the other items, you should find Microsoft ADPCM Audio Codec and IMA ADPCM Audio Codec. You need to install them one by one, so select either of these and click Next. This should re-install the codec (take care, you may need your Windows XP CD).

6. Reboot


- All default audio codecs are in the same list with Microsoft ADPCM Audio Codec and IMA ADPCM Audio Codec; just go to step 5 and select them.
- If you want to (re)install video codecs go to step 3, Select "(Standard system devices)" from "Manufacturer" and "Video Codecs" from "Model" then follow the instructions.


The following table lists the codecs included with Windows:

Manufacturer	Model
DSP Group	TrueSpeech Software Audio Codec
Intel	Indeo R3.1 Video Codec
Indeo R3.2 Video Codec
Microsoft Audio codecs	ADPCM Audio Codec
CCITT G.711 A-Law and u-Law Audio Codec
GSM 6.10 Audio Codec
IMA ADPCM Audio Codec
Microsoft Video codecs	RLE Video Codec
Video 1 Video Codec
SuperMatch	Cinepak Video Codec 


Codecs explained

Windows does this by using pieces of software called codecs. The word codec means COmpressor/DECompressor: a software routine that compresses the raw video ready for storage, and then decompresses it to display on your PC. Before we tell you how video compression codecs work, we need to clear up a misconception. The native video format used by Windows is AVI. You may hear AVI described as a format – it isn’t. AVI is technically what’s known as a container or wrapper, just the same as Apple’s QuickTime.

A container is simply a conduit, if you like. In the case of AVI files, it’s a way to transport video and audio streams inside the same file. One AVI file could be different from the next, even though they may contain the same video and audio at the same resolution. The reason is simple: video held inside AVI files can be compressed with different codecs, something you can’t tell just by playing back the file.

While audio codecs are either lossy or lossless, video codecs are generally lossy. Video compressed with a lossy codec isn’t the same as the original footage, as information is discarded during compression to reduce the file size. The amount of data held in a high-res video file means it’s not practical to use lossless compression.

Frame and field

Broadly speaking, video codecs can be split into two types: frame-based and field-based or temporal codecs. Frame-based codecs such as Cinepak or Motion-JPEG work by examining and compressing each frame of video separately. With 25 frames per second in PAL video, frame-based codecs have two disadvantages: they can be slow, and the file sizes can be quite large.

A movie, of course, is simply a sequence of still images played back at a constant rate, creating the illusion of movement. With that in mind, it’s not hard to see that each frame or still will be much the same as the previous and the next, with minor differences where objects have moved. Why compress each frame individually, when most of them are essentially the same?

This is where field or temporal codecs come into play. A temporal codec watches how much a video stream changes over time. When a temporal codec compresses a stream, it stores the first frame in its entirety. The next frame is compared to this full frame, and any changes between the two are isolated. Next, the codec compresses only the changes between the first full frame and the next. Because this first frame is essential and holds info needed to decompress the subsequent frames, it’s known as a keyframe. When the codec spots a major difference such as when a movie changes to a different scene, it grabs and compresses another full keyframe.

As you can imagine, temporal codecs work at their most efficient when dealing with footage which doesn’t change much. The most well-known temporal codec is the MPEG standard. MPEG-2, the high-resolution revision of the original standard, is the codec used to pack entire blockbuster movies on to relatively small DVD discs.

Windows playback

When you play a video file which is held in a discrete format such as an MPG file, Windows knows what it is automatically and deals with the file with little fuss. Container formats like AVI are much more complex, since both video and audio streams could use one of a large number of compression codecs. First, Windows interrogates a specific portion of the AVI header which contains the FourCC code :– a four-digit code that’s used to identify the codec used in the stream.

Windows then compares this code to the video codecs you have on your PC and selects the correct playback codec. If you don’t have a codec installed which can play that particular FourCC code, you’re in trouble – Windows will refuse to play the file.

Finally, once the correct video and audio codecs have been established, Windows then passes the stream to the codec for decompression. The codec then passes the decompressed info back to the player program you’re using, whether it be Windows Media Player or a third-party application like Winamp. This modular nature means codecs can be used by any application to play video files without the programmer having to write their own decompression routines every time.

The codec riddle

With dozens of video codecs available to use, any AVI file you come across can be something of a gamble. Is your system equipped with the relevant codec to play both the video and audio stream correctly? If not you’ll soon know about it, when Windows complains that it doesn’t have the correct codec installed. If you need a particular codec, where do you find it?

Rather than installing every codec under the sun, there’s a simple solution to identifying which compression codecs a particular AVI file requires – a piece of software called GSpot. Available from www.headbands.com/gspot/ GSpot looks horrendously complex when you first launch it. It is, but for finding codec information it’s absolutely unparalleled.

Launch GSpot, then open your chosen AVI file. Once GSpot has scanned your system for installed codecs, it displays a ton of info about the contents of the file. What you need lies to the right of the screen under the Video section. The Stat section tells you if you have the required codec. If not, select View -> Codec Database -> Video and look for the FourCC code. GSpot will also tell you where to get the missing codec. Frank Charlton


Marvellous MPEG-4

While video formats and codecs come and go with the times, some become so useful that they take off in a big way. MPEG-4 is one such phenomenon. Broadly speaking, it’s a standard for extremely efficient yet good-looking video compression which goes way beyond what formats such as the DVD MPEG-2 standard can offer – in compression terms, at least.

MPEG-4 is a standard rather than a codec, though. There are actually a number of MPEG-4 compliant codecs available, including Microsoft’s own proprietary version. Without a doubt, the most well-known MPEG-4 codec is DivX. This is a codec with a chequered past. It emerged at the same time as Microsoft’s MPEG-4, but has found legitimacy with DivX Networks Inc.

Over the years, DivX has advanced a great deal and is now big business. Game developers use it on PCs and consoles, and some DVD players and portable devices exist which can play DivX files. Check out www.divx.com for more. Other popular codecs include Xvid (www.xvid.org), 3IVX (www.3ivx.com) and Nero Digital (www.ahead.de).




I wanted to get my movie and audio codecs installed automatically on my XPCD. I'd seen other methods, but I was only interested in the codecs and didn't want any of the other baggage that came with the likes of the official Divx program, I only use the codecs to view movies, not make or encode them, so I felt the extras were superfluous to my needs. None of my existing codec install EXE's had any silent switches and neither could the files be manually extracted.

I opted instead to reinstall them and track the files installed manually. Extremely easy as 99% went straight to the system32 directory. I then copied the files to a temp directory and set to work on creating my own personal codec installation, using an an old divx.inf I found, (and subsequentially butchered), on the net. I present it to everyone here for those of us who may want to squeeze just a little more free space out of our CD's or for those of us who simply want the functionality of the codecs without the salad dressing.

CODE
;       º Codecs.inf
;       º DivX 5.1.1
;       º Dolby AC3 (InterVideo)
;       º MP3 acm (FhG IIS)
;       º DivX WMA acm (DivX 4.1)
;       º Koepi's XviD 17/07/2003
;       º FFDShow Alpha 23/05/2003

[Version]
Signature = "$Windows NT$"
Class = MEDIA

[SourceDisksNames]
1="DivX & XviD Video & Audio codecs pack",, 0001

[Installable.Drivers]
divx = 1:divx.dll, "vidc.divx", "%DivX5%" , , ,
xvid = 1:xvid.dll, "vidc.xvid", "%xvid%" , , ,
ffdmplyr = 1:libmplayer.dll, "vidc.ffdmplyr", "%dmpr%" , , ,
ffdavcdc = 1:libavcodec.dll, "vidc.ffdavcdc", "%davc%" , , ,
l3radium = 1:l3codecp.acm, "msacm.l3radium", "%layer3a%" , , ,
divxa32 = 1:DivXa32.acm, "msacm.divxa32" , "%DivXWMA%" , , ,

[SourceDisksFiles]
divx.dll=1
xvid.dll=1
libmplayer.dll=1
libavcodec.dll=1
mp4fil32.dll=1
codecs.inf=1
divxdec.ax=1
xvid.ax=1
ffdshow.ax=1
iviaudio.ax=1
mpgaudio.ax=1
l3codecp.acm=1
DivXa32.acm=1 

[DefaultInstall]
CopyFiles=DIVX.Copy,DIVX.Copy.Inf
Addreg = DIVX.AddReg, DIVX.AddRegNT, DIVX.DoReg, AddDescriptions.NT
Updateinis = Updateini 

[Remove_Mpeg]
AddReg = DIVX.Unregister
DelReg = DIVX.DelReg, DelDescriptions.NT
Updateinis = Updateini.un
DelFiles =DIVX.Copy, DIVX.Copy.Inf 

[UpdateIni]
system.ini, drivers32,,"vidc.divx=divx.dll"
system.ini, drivers32,,"vidc.xvid=xvid.dll"
system.ini, drivers32,"vidc.ffdmplyr=libmplayer.dll"
system.ini, drivers32,"vidc.ffdavcdc=libavcodec.dll"
system.ini, drivers32,,"msacm.l3radium=l3codecp.acm"
system.ini, drivers32,,"msacm.divxa32=DivXa32.acm"

[UpdateIni.un]
system.ini, drivers32,"vidc.divx=*",
system.ini, drivers32,"vidc.xvid=*",
system.ini, drivers32,"vidc.ffdmplyr=*",
system.ini, drivers32,"vidc.ffdavcdc=*",
system.ini, drivers32,"msacm.l3radium=*",
system.ini, drivers32,"msacm.divxa32=*",

[DIVX.Copy]
divx.dll
divxdec.ax
xvid.dll
xvid.ax
libmplayer.dll
libavcodec.dll
ffdshow.ax
mp4fil32.dll
iviaudio.ax
mpgaudio.ax
l3codecp.acm
DivXa32.acm

[DIVX.Copy.Inf]
codecs.inf 

[DIVX.AddRegNT]
; UnInstall
HKLM,"%UnInstallPath%","DisplayName",0,"%UninstallDispName%"
HKLM,"%UnInstallPath%","UninstallString",0,"%11%\rundll32.exe setupapi.dll,InstallHinfSection Remove_Mpeg_NT 132 %17%\%InfFile%" 

[DIVX.AddReg]
; DivX5
HKLM,"%MediaRes%\icm\vidc.divx","Description",0,"%DivX5%"
HKLM,"%MediaRes%\icm\vidc.divx","Driver",0,"divx.dll"
HKLM,"%MediaRes%\icm\vidc.divx","FriendlyName",0,"%DivX5%"
; XviD
HKLM,"%MediaRes%\icm\vidc.xvid","Description",0,"%XviD%"
HKLM,"%MediaRes%\icm\vidc.xvid","Driver",0,"xvid.dll"
HKLM,"%MediaRes%\icm\vidc.xvid","FriendlyName",0,"%XviD%"
; FFDShow Audio/Video dll
HKLM,"%MediaRes%\icm\vidc.ffdavcdc","Description",0,"%davc%"
HKLM,"%MediaRes%\icm\vidc.ffdavcdc","Driver",0,"libavcodec.dll"
HKLM,"%MediaRes%\icm\vidc.ffdavcdc","FriendlyName",0,"%davc%"
; FFDShow Mplayer dll
HKLM,"%MediaRes%\icm\vidc.ffdmplyr","Description",0,"%dmpr%"
HKLM,"%MediaRes%\icm\vidc.ffdmplyr","Driver",0,"libmplayer.dll"
HKLM,"%MediaRes%\icm\vidc.ffdmplyr","FriendlyName",0,"%dmpr%"
; Layer3
HKLM,"%MediaRes%\acm\msacm.l3radium","Description",0,"%layer3a%"
HKLM,"%MediaRes%\acm\msacm.l3radium","Driver",0,"l3codecp.acm"
HKLM,"%MediaRes%\acm\msacm.l3radium","FriendlyName",0,"%layer3a%"
; WMA
HKLM,"%MediaRes%\acm\msacm.divxa32","Description",0,"%DivXWMA%"
HKLM,"%MediaRes%\acm\msacm.divxa32","Driver",0,"DivXa32.acm"
HKLM,"%MediaRes%\acm\msacm.divxa32","FriendlyName",0,"%DivXWMA%"
HKLM,"%WMAReg%","Name",0,"%DivXWMA%"
HKLM,"%WMAReg%","Version",0,"4.1"
HKLM,"%WMAReg%","Company",0,"DivX"


[DivX.DelReg]
HKLM,"%MediaRes%\icm\vidc.divx"
HKLM,"%MediaRes%\icm\vidc.xvid"
HKLM,"%MediaRes%\icm\vidc.ffdmplyr"
HKLM,"%MediaRes%\icm\vidc.ffdavcdc"
HKLM,"%MediaRes%\acm\msacm.l3radium"
HKLM,"%MediaRes%\acm\msacm.divxa32"
HKLM,"%WMAReg%"
HKLM,"%UnInstallPath%"

[DIVX.DoReg]
HKLM,"%RunOnce%","%Reg_% DivX 5.0 Filter",,"%11%\regsvr32.exe /s %11%\divxdec.ax"
HKLM,"%RunOnce%","%Reg_% XviD Filter ...",,"%11%\regsvr32.exe /s %11%\xvid.ax"
HKLM,"%RunOnce%","%Reg_% AC3 codec (intervideo)",,"%11%\regsvr32.exe /s %11%\iviaudio.ax"
HKLM,"%RunOnce%","%Reg_% AC3 codec (mpegvideo)",,"%11%\regsvr32.exe /s %11%\mpgaudio.ax"
HKLM,"%RunOnce%","%Reg_% FFDShow Alpha",,"%11%\regsvr32.exe /s %11%\ffdshow.ax"

[DIVX.Unregister]
HKLM,"%RunOnce%","%UnReg_% DivX 5.0 Filter",,"%11%\regsvr32.exe /s /u %11%\divxdec.ax"
HKLM,"%RunOnce%","%UnReg_% XviD Filter ...",,"%11%\regsvr32.exe /s /u %11%\xvid.ax"
HKLM,"%RunOnce%","%UnReg_% AC3 codec (intervideo)",,"%11%\regsvr32.exe /s /u %11%\iviaudio.ax"
HKLM,"%RunOnce%","%UnReg_% AC3 codec (mpegvideo)",,"%11%\regsvr32.exe /s /u %11%\mpgaudio.ax"
HKLM,"%RunOnce%","%UnReg_% FFDShow Alpha",,"%11%\regsvr32.exe /s /u %11%\ffdshow.ax"

[AddDescriptions.NT]
HKLM,"%DrvDescNT%","divx.dll",0,"%DivX5%"
HKLM,"%DrvDescNT%","xvid.dll",0,"%XviD%"
HKLM,"%DrvDescNT%","libmplayer.dll",0,"%dmpr%"
HKLM,"%DrvDescNT%","libavcodec.dll",0,"%davc%"
HKLM,"%DrvDescNT%","l3codecp.acm",0,"%layer3a%"
HKLM,"%DrvDescNT%","DivXa32.acm",0,"%DivXWMA%"
HKLM,"%Drv32NT%","msacm.divxa32",0,"DivXa32.acm"

[DelDescriptions.NT]
HKLM,"%DrvDescNT%","divx.dll"
HKLM,"%DrvDescNT%","xvid.dll"
HKLM,"%DrvDescNT%","libmplayer.dll"
HKLM,"%DrvDescNT%","libavcodec.dll"
HKLM,"%DrvDescNT%","l3codecp.acm"
HKLM,"%DrvDescNT%","DivXa32.acm"
HKLM,"%Drv32NT%","msacm.divxa32"

[DestinationDirs]
DefaultDestDir = 11
DIVX.Copy = 11
DIVX.Copy.Inf = 17

[Strings]
Reg_="Registering"
UnReg_="Unregistering"
MediaRes="SYSTEM\CurrentControlSet\Control\MediaResources"
RunOnce="Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup"
DrvDescNT="SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc"
Drv32NT="SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers32"
WMAReg="SOFTWARE\DivXWMA"
davc="FFDShow Audio/Video Dll"
DivXWMA="DivX WMA Audio Codec"
layer3a="Fraunhofer IIS MPEG Layer-3 Codec (Pro Radium)"
XviD="XviD MPEG-4 Video Codec"
DivX5="DivX 5.0.5 Pro Corporate Edition"
dmpr="FFDShow Mplayer Dll"
InfFile="codecs.inf"
UninstallDispName="DivX & Xvid Video/Audio Codecs"
UnInstallPath="Software\Microsoft\Windows\CurrentVersion\Uninstall\Codecs"
MediaClassName="Media Devices"
mfgname="Project Codecs"


I'm not a very knowledgeable person and I made this INF using only a little common sense. I'll be honest and say that had I not had the framework of a divx.inf to work from, I might not have even attempted to do this. The whole process looks bewildering to say the least.


The free version of DivX 5.xx contains spyware,