Wednesday, October 31, 2018

Tutorial - Installing 64-bit and 32-bit AVISynth+, QTGMC, and FFMPEG side by side

Hey folks - just wanted to let you know that this tutorial is now officially outdated.  I'm leaving it up here are for up historical interest, but here's a link to a post that I will maintain from this point forward with the current instructions for setting up AVISynth and QTGMC:



============================================



So, it turns out I made a mistake. I assumed that QTGMC still didn't work properly in 64-bit AVISynth, even though it had been over a year since I looked into it.

Not only does it work, it actually gives a 10%-20% speed boost during rendering.

However, there is one particular hitch that holds it back a bit: AvsPMod 64-bit throws up error messages when you use the video preview function. It's not a deal-breaker, but it's annoying. Hopefully, a newer version will come out soon. In the meantime, in the interest of both correcting my error and of finally putting the setup tutorial videos to rest, I'm going to show how to install and run the 32 and 64-bit versions of AVISynth+, QTGMC and FFMPEG side by side.


BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Always check your files before submitting/uploading them.

Virus scan everything you download. It's not a 100% guarantee that you'll avoid getting a malware infection, but it's a lot better than not checking at all.

You have been warned. 

Also, this tutorial is for Windows 10. Most of the steps work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.


Here's the video version of the tutorial:



Also, I will be rushing through some of the initial steps for 32-bit AVISynth+, so if you'd like a little more depth, check out my original tutorial first, or check out my video version of that tutorial:





BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Virus scanning all files is strongly encouraged, but not a 100% guarantee of safety.

You have been warned. 

If you're on a deadline (and using Premiere Pro, After Effects, or Final Cut Pro) probably your best best is to use a paid plugin like FieldsKit. And no, they aren't paying me to say that.

Also, this tutorial is for Windows 10. Most of the steps work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.





First of all, AVISynth+ installs both the 32-bit and 64-bit versions by default. You can grab it from here:

https://github.com/pinterf/AviSynthPlus/releases

Then, we'll need to get all the filters (plugins) needed:

FFMPEGSource

11/6/2018 Update: looks like Jiangmin antivirus is currently flagging FFMpegSource with a warning on VirusTotal. Given that no other antivirus engines have spotted anything, I'm cautiously calling this a false positive, especially because one of the top search results for Jiangmin on Google is a post about the problems with reporting false positives to them.

QTGMC

Don't forget to get all the "Core Plugins", along with 32-bit FFTW3 library as well.


If you need to sharpen the image, I recommend LimitedSharpen (Technically "LimitedSharpenFaster")

With all the AVISynth filters and scripts grabbed, it's time to get the supporting software:

AvsPMod

This is like an IDE for AVISynth scripts, and is pretty much essential IMO. Be sure to grab both the 32-bit and 64-bit versions.

FFMPEG

Update: since Zeranoe has shut down, I will be recommending compiling 32-bit FFMPEG from source using https://github.com/m-ab-s/media-autobuild_suite . Since this tutorial is getting a little long in the tooth any ways, I'll just leave this here as a placeholder until I create a newer and better version. You can get the 64-bit version here: https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.zip 

7-zip

If you don't have 7-zip already installed, you won't be able to open many of the downloaded archives. The version you get here doesn't matter, so maybe just do the 64-bit one.

After virus scanning everything, install:

7-zip (if needed)
AVISynth+

Just follow the default options in both cases. Then, go to the 32-bit plugins directory for AVISynth+. On my system, this is:

C:\Program Files(x86)\AVISynth+\plugins+\

Extract all .dll and .avsi files to the plugins directory from all plugins EXCEPT the fftw-3*.dll archive. If there's a choice between an x86 and an x64 version, use the x86 version. If there's a choice between AVX, AVX2 and a version without either, you'll need to know what instruction sets your processor supports. CPU-Z can tell you this if you're not sure.

Once that's done, do the same with the 64-bit versions of the plugins, except copy those to the "plugins64+" folder.

Now, open the fftw-3*.dll archive, then (as noted on the QTGMC page) extract the libfftw3f-3.dll file. Make a copy of it and rename it as "FFTW3.dll". Place the files "libfftw3f-3.dll" and "FFTW3.dll" in the SysWow64 folder.

Extract the 32-bit AvsPMod archive to wherever you want to run it from, and then extract the 64-bit version to a different directory. If you want to associate .avs files with AvsPMod, I would generally recommend doing so with the 32-bit version, but if you work primarily in 64-bit, then you should probably use that version.

Now, for the tricky part: setting up both the 32 and 64-bit versions of FFMPEG to run from any directory on your computer. We're going to do this with batch files. Also, kudos to Jon Hall's tutorial blog post on FFMPEG setup (currently defunct) for showing me basically how to do this.

First, open the 32-bit FFMPEG archive, then open the long-named folder within.

Create a folder somewhere on your system called "ffmpeg32". Personally, I put it in Program Files (x86).

Copy the "bin" and other folders from the opened FFMPEG archive to your ffmpeg32 folder.

Create a new text file, then rename it to "ffmpeg32.bat".

Right-click on the batch file and select "edit".

Write some version of the following into the notepad window:

@ECHO OFF
"C:\Program Files (x86)\ffmpeg32\bin\ffmpeg.exe" %*
Adjust the path as needed depending on where you installed 32-bit FFMPEG. Save, close batch file. Keep the explorer window showing the contents of your ffmpeg32 folder open.

Do the above steps for the 64-bit version of FFMPEG, except change the folder name to "ffmpeg64" and the batch file name to "ffmpeg64.bat". In the batch file, put some version of the following:

@ECHO OFF
"C:\Program Files\ffmpeg64\bin\ffmpeg.exe" %*
As you can see, I put ffmpeg64 in Program Files, but again, you can put it wherever you want.

Save, and close the batch file. Keep the explorer window showing the contents of your ffmpeg64 folder open.

Now, to add both versions of FFMPEG to your system path:
  1. Press the Windows and R keys.
  2. Type "control sysdm.cpl,,3". 
  3. Click "Run".
  4. Click on "Environment Variables".
  5. Select "Path" under "System variables" and click "Edit".
  6. Go to where your ffmpeg32.bat file is. 
  7. Select and copy the folder's path address from the address bar towards the top of the window.
  8. Back in the "Edit environment variable" window, click "New" and paste in the folder path. 
  9.  Repeat steps 6-8, but use the location of your ffmpeg64.bat file.
  10. Click OK on all the windows you opened to get here.
To make sure everything worked, open a command prompt (or Powershell, whatever your preference), then type ffmpeg32. If a long list of options is shown after a moment, cool. Do the same with ffmpeg64. If neither shows an error message like "command not found", you should be good to go.

Now, whenever you make your .bat file to run ffmpeg, you can specify whether you want to run the 32-bit version of both FFMPEG and AVISynth by calling ffmpeg32, like so:

    ffmpeg32 -i "videofile.avs" -c:v prores -profile:v 3 -pix_fmt yuv422p10le "output.mov"

If you want to run the 64-bit versions of FFMPEG and AVISynth, just call ffmpeg64 instead, like so:

    ffmpeg64 -i "videofile.avs" -c:v prores -profile:v 3 -pix_fmt yuv422p10le "output.mov"

PS: FFMPEG doesn't generate "official" ProRes files, so if it will be the last stop in your export chain, consider using a different workflow if the file is going to a major TV channel. Some channels have reportedly (on Reddit's /r/editors subreddit) said that FFMPEG ProRes files won't pass QC with them.

11 comments:

buzzer said...

Thank you very much bro its helped me So much cheers :D

Andrew Swan said...

Belated you're welcome, man. :)

buzzer said...

bro i would like to know very important thing lol bro may i know the script line for Auto Load plugins lol even i checked dooms9.org,avisynth.nl i was tried but it not worked for me bro please help me in this one onky bczz i was good now in meguui tool and more over i cant able to find some 64bit engine files also mean .dll files of 64bit plugins as like 3d convolution and Smooth tweak,HDRAC,Histogram all some are not working in 64bit lol its kicking me off saying u cant run 32bit in 64bit damet hehehe so funny its raising i was fedup with it lol :P :D :)

buzzer said...

even if u concern about me we can meet in Team viewer as well my bro love you :) :D :P

Unknown said...

Andrew, Thank you so much for you videos and tutorial.They have helped enormously this newbie.

Question: For a 64 bit avisynth+ install in 64 bit windows 7, the various 64 bit dll's should be placed in C:\Program Files (x86)\AviSynth+\plugins64 OR C:\Program Files (x86)\AviSynth+\plugins64+?. I think your tut recommends the latter but I could not get it to work and used the Plugins64 folder.
Also which version of libfftw3f-3.dll do you recommend.The links from the wiki are only for V3.3.5 but the doom 9 forum has V3.3.7( or 8?).
THanks again
Merah

mitkola said...

Thank you so much for this detailed tutorial!

I can add some suggestion for a problem that I meet.
When I'm starting AvsPMod 32 or AvsPMod 64 I've received following error:
"Error 126 The specified module could not be found.
Loading avisynth.dll failed. Make sure AviSynth is installed."
After research of DLL dependencies I have found that there are missing Visual C++ redistributables. I have downloaded and installed the latest supported Visual C++ redistributable 2015,2017 and 2019 for x86 and x64 and all works fine.

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Thank you!

Raistlin Majere said...

Andrew, I am new to this, but When I tried to download the Plugins for QTGMC, like Masktools2 etc, I don't see the .7zip files on github anymore. Can you tell me if I am doing something wrong or if need to find these somewhere else now? Thx

Raistlin Majere said...

Nevermind, I found them, I was not opening the assets link. Thx

FlappyJack said...

The guide doesn't mention the 64 bit version of FFTW3 and I think it should. I was trying to use TemporalDegrain2 from one of your other guides, but ran into an error from fft3dfilter "fftw3.dll not found" since I was using AVS 64 bit. Took me a while to figure it out.

Zachary Halberd said...

Hi Andrew. Thank you for taking the time to make these videos and this blog for the community. I've managed to successfully get this all working on my main workstation, however, when I followed your tutorial step-by-step for a second time to install on my laptop, I keep receiving the same error messages. I try to open with AVSpmod32 and AVSpmod64 and then I receive the following error messages:

"The specified module could not be found. LoadLibrary(pythondll) failed"

"C:\AvsPmod64\AvsPmod_high_res_ico_version\PYTHON27.DLL"

If I try to use AVSPmod32, I get the same error messages but with the indicated 32bit version of the error. Again, I carefully followed every step on both systems yet I only get this error message on my laptop. I do have the latest Python installed on my laptop.

Any ideas what this might be?

Thanks!


Andrew Swan said...

Zachary,

Not sure, unfortunately. It's been a while, so I may need to update these tutorials.

Which deinterlacing algorithm is the best? Part 1 - HD interlaced footage

Before I began, I'd like to give a special thanks to Aleksander Kozak for his help in testing and providing the HD footage used in this ...