Thread: Avisynth+
View Single Post
Old 16th September 2013, 03:34   #12  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,416
If for no other reason, this certainly makes the sources dead simple to build for those of us used to cross-compiling.

Ah, what the heck. Build instructions suitable for copy-and-paste:



This guide assumes a familiarity with a more *nix-centric command line compilation methodology, because it's easier to provide direct instructions for this that can just be copy/pasted.

MSys and 7zip should already be installed, and the user should know what a phrase like 'adding the directory to the system PATH' means.




[AviSynth+ prerequisites]
Code:
r1576 is the last milestone version that can built on XP with VS2010.
Newer versions (which is what we care about) need at least VS2012.  XP
compatibility is still do-able by adjusting the toolset CMake uses.

Install CMake:
http://www.cmake.org/cmake/resources/software.html

Add CMake's directory to the system PATH manually if the installer won't.

Add 7zip to the PATH.  Make sure that MSys' root directory (the
one holding msys.bat) is also on the PATH.
[DirectShowSource Prerequisites]

DirectShowSource requires a couple of big pieces here that building the AviSynth+ core itself does not. It's not a requirement to build DirectShowSource, especially with the options of using either FFmpegSource2 or LSMASHSource, but the guide wouldn't be complete if I didn't cover it.

DirectShowSource requires strmbase.lib, the C++ Base Classes library, which for some reason isn't included in a standard install of Visual Studio. The source code for the library is provided with the Windows SDK, and requires the user to build it first.

Code:
Download the Windows SDK 7.1:
http://www.microsoft.com/en-US/download/details.aspx?Id=8442

Download the following ISO for x86:
GRMSDK_EN_DVD.iso

Verify against CRC32 or SHA1:
CRC#: 0xBD8F1237
SHA1: 0xCDE254E83677C34C8FD509D6B733C32002FE3572

For convenience, you can use Pismo File Mount (if you've already got it installed for AVFS)
to mount the ISO. Then just launch setup.exe and follow the wizard.

Install only the Samples, uncheck everything else. Intellisense stays checked, though.

Open VS2013 Express (or what is it, Community now?), and open the .sln file in the 7.1 SDK, at
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses

Allow VS2013 to convert the project, switch it over to Release, and Build.
That's it.  For pre-SSE2 CPUs, make sure you switch the ARCH to either IA32 or SSE rather
than leaving it disabled.  This is buried in the Properties dialog.
DirectShowSource also needs the DirectX SDK, so we'll grab that too.
Code:
Download the DirectX SDK (February 2010):
http://www.microsoft.com/en-us/download/details.aspx?id=10084

Only install the headers and libs from it. Uncheck everything else. Unlike the
strmbase.lib stuff, there's no post-install stuff required.
To make the AviSynth+ build instructions more concise, we'll set a couple of environment variables. Open up MSys' /etc/profile and copy the following two lines into it somewhere:
Code:
export STRMBASELIB="C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses/Release/strmbase.lib"
export DIRECTXSDK="C:/Program Files/Microsoft DirectX SDK (February 2010)/Include"
Thankfully, all of this setup only needs to be done once.


[Building AviSynth+]

Start the Visual Studio Command Prompt

You can use Visual Studio's stuff from MSys by launching MSys from the Visual Studio Command Prompt. So type 'msys' and hit Enter.

Download the AviSynth+ source:
Code:
git clone git://github.com/AviSynth/AviSynthPlus.git
mkdir avisynth_build
cd AviSynthPlus
Set up the packaging directory for later:
Code:
AVSDIRNAME=avisynth+_r$(git rev-list --count HEAD)-$(date --rfc-3339=date | sed 's/-//g')
mkdir ../$AVSDIRNAME
If DirectShowSource won't be built, comment out the reference to its subdirectory in plugins/CMakeLists.txt:
Code:
sed -i '4 s/^/#/' plugins/CMakeLists.txt
Now, build AviSynth+. We'll do this out-of-tree so it's easy to clean up afterward:
Code:
cd ../avisynth_build

For 32-bit:

cmake -G "Visual Studio 12 2013" -T "v120_xp" -DDSHOWSRC_BASECLASSES_LIB="$STRMBASELIB" -DDSHOWSRC_DX_INCLUDE_PATH="$DIRECTXSDK"
cmake --build . --config release
mv Output avsplus_x86
mv avsplus_x86 ../$AVSDIRNAME
rm -R *

For 64-bit (DirectShowSource isn't really worth the effort on 64-bit, and most 64-bit users won't be on XP Pro 64-bit):

cmake -G "Visual Studio 12 2013 Win64"
cmake --build . --config release
mv Output avsplus_x64
mv avsplus_x64 ../$AVSDIRNAME
rm -R *
cd ../
You can't build 32-bit and 64-bit at the same time.

If you decided not to build DirectShowSource, omit the -DDSHOWSRC_BASECLASSES_LIB and -DDSHOWSRC_DX_INCLUDE_PATH options from the (32-bit) cmake command above.

Packing the newly-built DLLs with 7zip:
Code:
7za a -mx9 $AVSDIRNAME.7z $AVSDIRNAME

Last edited by qyot27; 18th August 2015 at 04:47. Reason: Seriously, update these instructions
qyot27 is online now