This guide follows the general outline of how to compile guliverkli written by Gabest, with the added benefit of going into the details that may be needed for individuals unfamiliar with the madness of guliverkli (as well as for newbie compilers). The most important part of of Gabest's outline is the order in which projects need to be compiled, which this guide follows to the letter. This guide has been tested on a clean system to ensure that nothing else is required. Once the source is setup you will have little to do again unless checking out new source, which hasn't been updated in a few months. You can find Gabest's basic instructions here.
- 1 Required Downloads
- 2 Source Checkout
- 3 Setting Up Visual Studio 2005
- 4 Patches
- 5 How To Apply a Patch
- 6 Alternative MPC branches
- 7 Basic VS2005 Tips
- April 2007 DirectX 9.0 SDK or latest DirectX SDK
- Windows Server 2003 R2 Platform SDK or latest Windows SDK (Web Install is used because you only need DirectShow)
- Windows Media Format SDKs (I have compiled all of guliverkli without the WMF SDK, but just to be on the safe side get 11)
- Visual Studio 2005 (using VS2003 is not recommended and there will be no guide for it)
- TortoiseSVN or your SVN client of choice
First you will need to checkout the latest guliverkli source. As of the writing of this guide the checkout was on 2006-07-17. TortoiseSVN makes source checkout, browsing SVN revisions, creating/applying patches or diffs, reverting changes, and keeping track of files that have been altered extremely simple. Which is why for all portions of this guide which involve any of the above operations, specific instructions will be shown through TortoiseSVN.
- Create a folder to checkout to. Ex. "C:\sources\guliverkli".
- Right click on or within the folder, you will see a new context menu for SVN Checkout above TortoiseSVN. Click it.
- The URL repository for guliverkli is:
- Be sure the checkout directory is correct.
- Under Revision you should have HEAD revision selected. This means you are getting the "head" of the tree structure. In a living tree what is the newest part? If required though you can also use TortoiseSVN's Show log feature to browse revision changes and select a specific one.
- Click Ok.
- Click Accept permanently for the certificate.
Sourceforge's SVN connects over SSL which requires this authentication. The entire checkout shouldn't take more then 5 minutes, 12.71 MB transferred total. If TortoiseSVN fails the checkout, you accidently got disconnected or something else, you can easily start the checkout again by right clicking and choosing the Update context menu. It will pick up where it left off.
Setting Up Visual Studio 2005DirectShow solution and project files in this 7z file. Simply extract it into the "Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow" folder. Now all of these SDKs need to be added to VS2005's environment variables.
- Start VS2005.
- Goto Tools->Options. Then look for VC++ Directories.
- In the top right there is a dropdown Show directories for:. In the dropdown select Include files.
- Click the New Line option and add the following directories:
- "Microsoft DirectX SDK (June 2006)\Include"
- "Microsoft Platform SDK for Windows Server 2003 R2\Include"
- Next in the dropdown select Library files. Now add these directories:
- "Microsoft DirectX SDK (June 2006)\Lib\x86"
- "Microsoft Platform SDK for Windows Server 2003 R2\Lib"
Now for the first real compile. The DirectShow baseclasses are the most fundamental part of compiling DirectShow filters. If this step is followed incorrectly, everything afterwards will most certainly fail.
- Goto File->Open->Project/Solution. Locate the baseclasses.sln solution file in the "Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses" folder.
- The Visual Studio Conversion Wizard will come up asking you to convert the file. Accept the conversion and finish it.
- In the Solution Explorer window (upper left), right click on the BaseClasses project and select Properties.
- Now in the upper left you will see a dropdown entitled Configuration. Select All Configurations and make the following two changes.
- Under Configuration Properties->General. Change Use of MFC to Use MFC in a Static Library.
- Under Librarian->General add winmm.lib in Additional Depedencies.
- Now under each configuration type individually (Debug, Debug Unicode, Release, Release Unicode) goto Librarian->General and change the output name to agree with the configuration type. (note that you must overwrite the name "strmbasd.lib" or "strmbase.lib" that is probably already there)
- strmbased.lib (Debug)
- strmbasedu.lib (Debug Unicode)
- STRMBASER.lib (Release)
- STRMBASERU.lib (Release Unicode)
You should be able to see the D is for Debug, RU for Release Unicode, etc. After applying those changes by pressing ok, go back into the Project's Properties window. Confirm that under C/C++->Code Generation the Runtime Library is set to Multi-threaded Debug (/MTd) for Debug/Debug Unicode, and Multi-threaded (/MT) for Release/Release Unicode. Changing the Use of MFC option should have already forced these to be correct, however this is just to double check, as it is a very important option that needs to be set correctly.
- Now right click the Solution 'baseclasses' and select Batch Build. Click Select All and Build.
Compiling all four shouldn't take too long. If you get any errors, review the above again. After they are complete you will see four folders in the "Baseclasses" folder for each configuration type. Copy the "strmbas*.lib" file from each folder and place them into a new folder called "Lib". The full path of which should now be "Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\Lib".
- Back in the VC++ Directories settings. Under Include files add:
- "Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses"
- Under Library files add:
- "Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\Lib"
With that out of the way all that is left is to compile guliverkli's initial dependencies. Then individual filters can be compiled, or all of them in order to compile MPC. The easiest way to do this is use the solutions Gabest has already made.
- Open mplayerc_vs2005.sln solution file located in "src\apps\mplayerc".
- Right click on Solution 'mplayerc_vs2005' and goto Configuration Manager. Select Release Unicode in the Active solution configuration dropdown (upper left). If you want to build both Release/Release Unicode at once you can use Batch Build again.
- Uncheck mplayerc so that it is not built. Click close.
- Goto Build->Build Solution. Sit back and relax, this will take much longer than the baseclasses.
Now to the meaty part of compiling guliverkli, the filters. We will have to modify some of the source at this point because we are building from the head, meaning much of the code may not be finalized. These changes thus should only be viewed as temporary until they are updated within the source. I have discovered only three things that require any changes: MP4Splitter, FLVSplitter, and DSMMuxer.
MP4Splitter is actually the easiest out of the three.
- First goto the "src\filters\parser\mp4splitter\AP4\Update\v0.6.3" folder.
- Extract "Bento4_0.6.3-001.7z" into the "src\filters\parser\mp4splitter" directory. Because the paths within the 7z start with \AP4\ they should correctly extract into the "src\filters\parser\mp4splitter\AP4" folder which is already there.
- Finally copy the "src\filters\parser\mp4splitter\AP4\Update\v0.6.3\Source" folder and overwrite any files in the "src\filters\parser\mp4splitter\AP4\Source" directory.
Gabest unfortunately made use of what is claimed to be stolen code. So he cannot publicly distribute it. This would be the libvp62 project which was on sourceforge for some time but taken down by On2. If you happen to have the vp62.cpp/h files you can make use of them in this project. Otherwise you will need to comment out the lines referring to them.
Use this patch to easily remove the vp62 lines.
Actually code needs to be changed within BaseMuxer because it is one of DSMMuxer's dependencies. These changes are specifically related to the new SSF code Gabest has recently been incorporating into his filters and MPC, which is probably not finished and the cause of why DSMMuxer will not compile as is.
Use this patch to easily remove the SSF code in basemuxer.
The Filters Reloaded
Now as for actually compiling the filters.
- Open filters_vs2005.sln solution file from "trunk\guliverkli\src\filters".
Once again you will get a warning about projects that could not be found. RadGtSplitter is apparently another project Gabest may have had to remove for legal reasons. Remove both projects from the solution. There are only three final changes to be made here. They only are specifically required if you plan to make a Release Unicode build of MP4Splitter, FLVSplitter, and/or DSMMuxer.
- Right click on one of the projects and goto Properties.
- Select Release Unicode in the Configuration dropdown.
- Goto Linker->Manifest File. Change Generate Manifest to No.
Follow the above for only MP4Splitter, FLVSplitter, and/or DSMMuxer if you plan to make a Release Unicode build. All other configurations require no changes.
Now any other filters can be compiled.
- Right click on Solution 'filters_vs2005' and goto Configuration Manager.
If you only want to compile MPC then you should select the Release Unicode lib configuration. To compile the external filters only, select Release Unicode. If you want to compile both use Batch Build once again.
Media Player Classic Revolutions
The last thing to compile. Requires one change to work. Use this patch to easily remove RadGtSplitter from the dependency section.
- Open mplayerc_vs2005.sln solution file located in "src\apps\mplayerc".
- Right click on Solution 'mplayerc_vs2005' and select Configuration Manager.
- Uncheck all the projects except for mplayerc. Make sure it is set to Release Unicode. Click close.
- Goto Build->Build Solution.
If you have been able to successfully compile everything else up to this point, VSFilter should cause no real issues.
- VSFilter_vs2005.sln located at "src\filters\transform\vsfilter".
Check patches area below.
- Clipping bug fixed in v2.37. Patch available for latest SVN checkout made by jfs.
- \fax and \fay parameters added by equinox.
Not really sure what this strange DLL does yet. But simple to compile.
- mpcinfo.sln located at "src\apps\mpcinfo".
Possible to build (by celtic_druid), still haven't figured out what to change though.
- VSRip.sln located at "src\apps\vsrip".
No idea what this app even does. VobSub converter of some sorts I guess? Cannot get it to successfully compile yet either. Can be compiled though (by celtic_druid).
- vsconv.sln located at "src\apps\vsconv".
Some sort of Matroska muxer taking ASF input I am guessing, also not really sure what it does. Cannot succesfully compile yet either, unless your name is (celtic_druid).
- asf2mkv.sln located at "src\apps\asf2mkv".
Specifically mentioned by Gabest that it will not compile. This app is used to edit timestamps of subtitles in the VobSub format.
- SubResync - Old version packaged with VobSub 2.23.
- VSFilter clipping bugfix - Solves this issue (by jfs)
- VSFilter fax/fay parameters - Adds parameters to ASS rendering (by equinox)
- MPEG2DecFilter Patch - What this patch does
- MPEG2DecFilter Patch - Fixes logic problem in decoding interlaced video (by Haali)
- MPEG2DecFilter Patch - Adds support for progressive MPEG2 in m2ts (by Haali)
- Libvp62 Patch - What this patch does
- RadGtSplitter Patch - What this patch does
- SSF Patch - What this patch does
- DirectShow Projects and Solutions - Only used with 2003 Platform SDK.
- DirectShow Source Fixes - No longer required with 2003 Platform SDK. Only for DirectX SDK Extras February 2005 package.
How To Apply a Patch
You should always view the patch/diff file you plan to apply in a text editor. Each file contains valuable information such as what revision the patch is meant to be applied to, and what files specifically will be patched. Know what you plan to patch beforehand! TortoiseSVN actually makes patching incredibly easy and almost completely newb-proof.
- Right click on the patch/diff file.
- Goto TortoiseSVN->Apply patch.
- At the Browse For Folder window you should try to select the folder which contains the files to be patched. Ex. with vp62-removal.patch point to the "src\filters\parser\flvsplitter" folder.
However if you really don't know where to point to TortoiseSVN is extremely smrt and can easily detect the correct folder. Selecting the guliverkli "src" folder will make it search through it and all of its subdirectories to locate the file to be patched, it will then ask to confirm if you want to patch the file it located. Also if the file you are patching has already been altered from the official revision, TortoiseSVN will regrab that revision and apply the patch to it, apply the patch to the version you have, and merge the output of the two. This means the file will be correctly patched even if you have a different revision or some of the code has been altered (none of which will be changed).
- Finally, right click in the small File patches window. Click Patch all.
After which point you can view the changes or simply close TortoiseMerge.
Alternative MPC branches
- Guliverkli2 - This project is based on the latest source code from the original Guliverkli project. The modifications that we have made include library updates, some tweaks and several bug fixes. We have also fixed all known security vulnerabilities.
- MPC - Homecinema - This project is based on the original Guliverkli project, and contains additionnal features and bugs fixes (see complete list on project Website).
Basic VS2005 Tips
- After you have completely finished building a project be sure use Clean Solution to remove temporary and output files (be sure to move them beforehand unless you want them erased). Will free up lots of space from the filters and mplayerc solutions.
- After having built a project once, always use the Rebuild Solution option. It assures to delete temporary files before a new build.
- Turn on the Error List. View->Other Windows->Error List. This can help a lot if you are stuck at compiling a certain project, you can see exactly which fatal errors are coming up. Possibly also viewing which line exactly is not working.