Setting up AviSynth under Wine on OS X 10.9 Mavericks

For discussion on Mac software and video editing on Mac computers.

Setting up AviSynth under Wine on OS X 10.9 Mavericks

Postby Qyot27 » Sun Mar 23, 2014 9:56 am

??.or How I Learned to Stop Worrying and Love the Terminal



Upgrade to OS X 10.9 (Mavericks) if you haven't already. The short version: go to the App Store and look at the Updates section. OS X 10.9 Mavericks should be one of the listed upgrades. The only reason it may not be is because your Mac is way too old.

Xcode Command Line Tools (for OS X Mavericks, March 2014) from Apple Developer site:
1) Go to https://developer.apple.com/downloads/index.action (Log in with your Apple ID)
2) Select Command Line Tools (OS X Mavericks) for Xcode - March 2014 and download the .dmg file.
3) Install the package.

Install Homebrew (http://brew.sh/):
1) Open a Terminal by going to Spotlight, and typing in 'Terminal'
2) Copy and paste the following into the Terminal and press Enter:
Code: Select all
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"


Install Wine:
Code: Select all
brew install wine
wine regedit


Use Winetricks to download some extra stuff:
Code: Select all
winetricks corefonts vcrun6 vcrun2010


The corefonts install will ask you questions. Answer yes or OK to everything (may require using the arrow keys or tab key to select the answer)?

Install 7zip:
Code: Select all
brew install p7zip


Bookmark Wine's C: drive in Finder:
1) With Finder open, press Shift+Command+G
2) Type in ~/.wine/drive_c and press Enter.
3) You should see two directories: Program Files and windows - this lets you know you're in the right folder.
4) Use Finder's bookmarks to place a shortcut in the left pane. This makes dealing with Wine much easier.


Install AviSynth 2.6a5:
1) Open a Terminal and copy/paste the following to download AviSynth 2.6 alpha 5:
Code: Select all
curl -Lo AviSynth_130918.exe "http://downloads.sourceforge.net/project/avisynth2/AviSynth_Alpha_Releases/AVS%202.6.0%20Alpha%205%20%5B130918%5D/AviSynth_130918.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Favisynth2%2Ffiles%2FAviSynth_Alpha_Releases%2FAVS%25202.6.0%2520Alpha%25205%2520%255B130918%255D%2F&ts=1395576811&use_mirror=hivelocity"

2) Run the installer:
Code: Select all
wine AviSynth_130918.exe


We're not going to stay with 2.6a5, because there's a better alternative: AviSynth+ (http://avs-plus.net)? Unfortunately, the installer (and the zip) provided can't be used with Wine because the official binaries weren't compiled with Visual Studio 2010 (this matters, because Wine currently doesn't like binaries that were built on newer versions of Visual Studio; eventually this will get fixed, but it hasn't yet)? For that reason, I've compiled AviSynth+ r1576 with Visual Studio 2010:
avisynth+_r1576.zip

Extract the zip file, and then copy or move AviSynth.dll and DevIL.dll to wine's windows\system32 folder. You can safely let it overwrite the 2.6a5 versions it finds there. Put the rest of the .dlls in wine's Program Files\AviSynth 2.5\plugins folder (DirectShowSource is the only one that it'll conflict with; you can let it overwrite, you can't use DirectShowSource under Wine anyway)?


The AMVapp stuff:
Not everything in the AMVapp is necessary here. The only ones you really need to pay attention to are:
AVSPluginPack.exe
HuffyuvSetup.exe

The rest are either not relevant, or in need of updating.

DGMPGDec 1.5.8:
A newer build of DGMPGDec that's optimized for SSE is available from http://hank315.nl:
1) Download DGMPGDec 1.5.8 (SSE):
Code: Select all
curl -o dgmpgdec158_sse.zip http://hank315.nl/files/DGdecode/dgmpgdec158_SSE.zip

2) Extract the zip with 7zip:
Code: Select all
7z x dgmpgdec158_sse.zip

3) Move the dgmpgdec158 folder to Wine's C:\Program Files area.
4) Move the DGDecode.dll from inside dgmpgdec158 to Wine's C:\Program Files\AviSynth 2.5\plugins folder.

Xvid 1.3.2:
1) Open a Terminal and copy/paste the following:
Code: Select all
curl -Lo xvid_132.zip http://www.xvidvideo.ru/component/docman/doc_download/6746-xvid-codec-132-x86-generic-with-installer.html

2) Extract the zip with 7zip:
Code: Select all
7z x xvid_132.zip

3) Install with Wine:
Code: Select all
wine Xvid.1.3.2-x86.exe


VirtualDub 1.10.4:
1) Download VirtualDub 1.10.4:
Code: Select all
curl -Lo VirtualDub_1.10.4.zip "http://downloads.sourceforge.net/project/virtualdub/virtualdub-win/1.10.4.35491/VirtualDub-1.10.4.zip?r=http%3A%2F%2Fvirtualdub.sourceforge.net%2F&ts=1395576449&use_mirror=softlayer-ams"

2) Extract the zip with 7zip:
Code: Select all
7z x VirtualDub_1.10.4.zip -oVirtualDub

(no, that's not a typo; there is no space between -o and VirtualDub)
3) Move the VirtualDub folder to Wine's C:\Program Files area

UT Video 13.3.1:
1) Download Ut Video 13.3.1:
Code: Select all
curl -Lo utvideo-13.3.1-win.exe http://umezawa.dyndns.info/archive/utvideo/utvideo-13.3.1-win.exe

2) Install with Wine:
Code: Select all
wine utvideo-13.3.1-win.exe


While you're at it, may as well download the Mac version too:
Code: Select all
curl -Lo utvideo-13.3.1-macosx.zip http://umezawa.dyndns.info/archive/utvideo/utvideo-13.3.1-macosx.zip

and use the typical Mac install routine here.

Lagarith 1.3.27:
1) Download Lagarith 1.3.27:
Code: Select all
curl -Lo LagarithSetup_1327.exe http://lags.leetcode.net/LagarithSetup_1327.exe

2) Install with Wine:
Code: Select all
wine LagarithSetup_1327.exe



A few plugins from the plugin pack that need updating:
FFmpegSource2:
1) Latest build of the C-plugin*: http://www.mediafire.com/?mvgx2dfp1xam1nh
2) Extract the zip, and move ffms2.dll, FFMS2.avsi, and ffmsindex.exe into Wine's C:\Program Files\AviSynth 2.5\plugins (allow it to replace them)

*I update the C-plugin builds more frequently than the offical builds are, which is the only reason I'm pointing to that particular build.
The official releases are available from https://github.com/FFMS/ffms2/releases

LSMASHSource (not in the original plugin pack):
1) Wine-compatible build: http://www.mediafire.com/?ek2a8rtkbk5c3cn
2) Extract with 7zip:
Code: Select all
7z x LSMASHSource_r714-msvc2010.7z

3) Move LSMASHSource.dll into Wine's C:\Program Files\AviSynth 2.5\plugins

flash3kyuu_deband 1.5.1 (not in the original plugin pack):
1) Download flash3kyuu_deband 1.5.1:
Code: Select all
curl -Lo flash3kyuu_deband_1.5.1_x86.7z http://nmm.me/ff

2) Extract with 7zip:
Code: Select all
7z x flash3kyuu_deband_1.5.1_x86.7z -of3kdb-1.5.1

3) Move flash3kyuu_deband.dll to Wine's C:\Program Files\AviSynth 2.5\plugins

mt_masktools26.dll
1) Delete mt_masktools.dll from Wine's C:\Program Files\AviSynth 2.5\plugins
2) Wine compatible build: http://www.mediafire.com/?haaj2hs5ax5p8ad
3) Extract zip with 7zip:
Code: Select all
7z x mt_masktools-26_20130825.zip

4) Move mt_masktools-26.dll into Wine's C:\Program Files\AviSynth 2.5\plugins


Extra utilities that can help:

x264:
1) Download x264 r2409 (with included patches):
Code: Select all
curl -Lo x264_rev2409_tMod.7z http://tmod.nmm-hd.org/x264/x264_rev2409_tMod.7z

2) Extract with 7zip:
Code: Select all
7z x x264_rev2409_tMod.7z -ox264-tmod

3) Go into x264-tmod, and in the FFmpeg folder, create a new folder with the name x264
4) To make it easier, rename x264_32_tMod-8bit-all.exe to x264.exe, and x264_32_tMod-10bit-all.exe to x264-10bit.exe. Don't touch the '64' files.
5) Move only x264.exe and x264-10bit.exe into the newly-created x264 folder.
6) Move the newly-created x264 folder into Wine's C:\Program Files

mpv:
1) Download mpv:
Code: Select all
curl -Lo mpv-i686-latest.7z http://mpv.srsfckn.biz/mpv-i686-latest.7z

2) Extract with 7zip:
Code: Select all
7z x mpv-i686-latest.7z -ompv-player

3) Move the mpv-player folder to Wine's C:\Program Files


Set Wine's PATH. This makes it easy to launch one of several of these programs without needing to lurk around in the Finder.
1) Open a Terminal and copy/paste the following:
Code: Select all
wine regedit

2) In the left pane, there are collapsible folders. Expand HKEY_CURRENT_USER and click on the Environment folder.
3) In the right pane, there will be an item named PATH. Double-click on it to bring up a dialog.
4) Add the following information to the END of the Value data box. Copy/paste for ease of use:
Code: Select all
;C:\Program Files\AviSynth 2.5\plugins;C:\Program Files\dgmpgdec158;C:\Program Files\VirtualDub;C:\Program Files\x264;C:\Program Files\mpv-player

Click OK and exit regedit.

Now, if you don't have the Finder open, you can still launch the program you need by opening the Terminal and doing the following:
Code: Select all
wine virtualdub

Which will launch VirtualDub. Speaking of which, we need to adjust something in VirtualDub's preferences.

With VirtualDub open, go to the Options menu and select the Preferences option. The Preferences dialog will show up.

Where it says 'Output color depth', choose '24-bit (True Color)' from the drop-down menu. Then select 'Display' from the list on the left.

You need to uncheck the 'Use DirectX for display panes' option. If you accidentally leave that checked, VirtualDub will crash when you try to open files.

Now that that's done, click 'Save', and then 'OK'? You can exit VirtualDub now.


To test that everything is setup correctly, let's test a script. With the Terminal open, issue the following command:
Code: Select all
echo Version>test.avs

This outputs a script with a single line, that uses the Version() function to make AviSynth report its version information.

Now, open VirtualDub:
Code: Select all
wine virtualdub


And use the 'Open Video File' option in the File menu to select the script you just created (remember, Wine sees your regular OSX filesystem as the Z: drive, so to find the script you probably need to navigate to Z:\Users\[your-username] and then to whatever folder you created the script in)? If everything worked, it should now be displaying the script, which is just AviSynth's version info. Since I instructed you to replace 2.6a5's dlls with the ones from AviSynth+, that information should read:
Code: Select all
AviSynth+ 0.1 (r1576, x86)
© 2000-2013 Ben Rudiak-Gould, et al.
http://avisynth.nl
© 2013 AviSynth+ Project
http://avs-plus.net







Other stuff:
There technically is a native port of AviSynth that runs on OS X and Linux: this is AvxSynth? However, there's only a handful (like, only 4 or 5) plugins that were ever ported and made to work with AvxSynth, so it's not as useful as running AviSynth itself under Wine. I mention it, because x264 and FFmpeg support using AvxSynth as the AviSynth script reader for native OSX and Linux builds (x264 enables it automatically, FFmpeg requires the user to pass --enable-avisynth to FFmpeg's configure script)? Another benefit of this is that if the user builds FFmpeg with --enable-avisynth, and then builds a native version of mpv using that FFmpeg build, then mpv can preview scripts (and because it's not running under Wine, mpv using AvxSynth to watch a script isn't sluggish)? I'll probably cover this in another post.

Of course, AvxSynth has an expiration date. The reason is that it's not based on AviSynth 2.6; it's based on 2.5.8 (this means a lot here, like not being able to use the YV24 colorspace)? And much more importantly, AviSynth+ has cross-platform support on its roadmap - which means that the second that avsplus is able to be built and used successfully on Linux and OSX, AvxSynth will be instantly deprecated and the support in x264 and FFmpeg will be changed to look for and use avsplus on these operating systems.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
User avatar
Qyot27
Surreptitious fluffy bunny
 
Joined: 30 Aug 2002
Location: St. Pete, FL
Status: Creepin' between the bullfrogs

Return to Mac Software

Who is online

Users browsing this forum: No registered users and 1 guest