Wednesday, January 7, 2009

How to Install Codecs Without Executables on Wine

So I got AviSynth and VirtualDub working through Wine on Ubuntu. Xvid and x264 had nice little EXE's to click on for installation, and they worked. But what about those pesky ones like Lagarith and HuffYUV that only have INF files? Fear not; there's still a way to do it.

From the zip file, you need the DLL file for the codec. Let's work on Lagarith. Its file is appropriately named lagarith.dll. You need to put it in the Windows\System32 folder. Actually this is linux so I should say windows/system32, with a forward slash. To open the folder, click Applications > Wine > Browse C:\ Drive. Then go to windows/system32. Drag lagarith.dll into that folder. Now you need to open an empty file in that folder. Right click, then click Create Document > Empty File. Open it with gedit and paste this inside:


[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc]

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers32]

Now you need to fill in the blanks for your codec. One of them is the fourcc for the codec. A fourcc is a four character code that tells the decoder which codec to use in order to play the video. You will need to look it up. Googling lagarith fourcc should give you the answer: lags. Fill it all in so it looks like this:

Save the REG in gedit.
Make sure you've filled in the blanks properly, and save the file as YourCodec.reg – in this case that's lagarith.reg. Again, make sure you've filled in the blanks properly because now we're going to put this in the registry. I don't know everything about Window's (or Wine's) registry, but I do know it's not something you want to screw up. Go back to the system32 folder in the File Browser. Click Go > Location, or click Ctrl-L. Copy that location with Ctrl-C.

The path of your system32 directory.
Now open a Terminal window (Applications > Accessories > Terminal). Type cd, then a space, then paste the location by right clicking, then click Paste. The line should read:

cd /home/yourusername/.wine/drive_c/windows/system32

Press enter. Now you type regedit, then a space, then the name of the REG file you created. For lagarith, it should be:

regedit lagarith.reg

The codec should now be installed. To verify it, open up VirtualDub. Click Video > Compression. Lagarith should now be on the list. Lather, rinse, and repeat for your other favorite codecs. Just be sure you properly enter the information in the REG file.

Lagarith is now on the list.

1 comment:

Mark Gallaher said...

Hey, thanl you for sharing. I'll try your tip. By the way, if you have missing dll-files problems I have great solution. Just download missing one file here