Wednesday, October 17, 2018

Tutorial - Alternate Setup for FFMPEG, Alternate Install for AVISynth+

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:



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



There are a few setup options that I didn't cover in my last tutorial that I do on my own system to make my life easier when dealing with AVISynth and FFMPEG.

I like to set up FFMPEG to run on any folder on my system, as opposed to having to drop the ffmpeg.exe binary in the folder every time. I also like using the Univsersal AVISynth installer, which allows me to easily install/uninstall different versions of AVISynth, and is just generally cleaner than the official AVISynth+ installer.

DISCLAIMER: 

This process may not work, may crash, or do other things to your system. I check for viruses before using any software, but malicious hackers have been known to break into developer accounts and insert code into previously benign programs, and even regular programs can have bugs.

This is a post accompanying a YouTube tutorial. Video is here:



First, let's set up FFMPEG. I basically already covered this in my now-archived original method for setting up QTGMC, but here's a recap: 
  1. Download and virusscan the latest nightly 32-bit static build of 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. 

  2. Open the downloaded FFMPEG archive. Open the long-named folder within. 
  3. Create a new FFMPEG folder somewhere on your main drive. 
  4. Copy all the files in the opened archive folder to your new FFMPEG folder. 
  5. Press the Windows and R keys or go to the start menu and type "run" and click on the run option. 
  6. Type "control sysdm.cpl,,3". Click "Run". 
  7. Click on "Environment Variables". 
  8. Select "Path" under "System variables" and click "Edit". 
  9. Go back to your open folder where ffmpeg.exe is located. Select and copy the folder's path address from the address bar towards the top of the window. 
  10. Back in the "Edit environment variable" window, click "New" and paste in the folder path. Click OK on all the windows you opened to get here. 
When that's done, you can now run FFMPEG from any directory on your computer, and your .bat files that call FFMPEG will do the same.


Now, for the Universal AVISynth Installer (which I will refer to as the UAI for the rest of this post).

  1. Grab the UAI archive file from here. Virus scan it. 
  2. Open the file. You'll notice there's a folder inside called "AVISynthRepository". 
  3. Open another window with the location where you want the UAI to go. Copy the AVISynthRepository folder over to that location. 
  4. Close the archive window. Open up the folder from where you just copied it to. 
  5. Right-click on the setavs.bat and select "Edit". This will open the .bat file in Notepad. 
  6. Look for the line that says ":set AVS_SRC_DIR=%~dp0". Remove the colon so it now reads: "set AVS_SRC_DIR=%~dp0". Save and close Notepad. 
  7. Right-click on the .bat file and select "Run as administrator". Say yes to the UAC prompt. 
  8. Type 6, hit enter. 
  9. Open up the AVSPLUS_x86 folder, then the plugins folder. 
  10. Copy over all your desired AVISynth plugins (aka filters). 
  11. Set up any additional system .dll files as necessary.
To uninstall:
  1. Right-click on the .bat file and select "Run as administrator".
  2. Say yes to the UAC prompt. 
  3. Type 8 to uninstall any 32-bit versions of AVISynth.
  4. Type 9 to uninstall any 64-bit version. 
  5. Hit enter. Type y, hit enter. 

Please note that you can install 64-bit AVISynth+ either instead of or alongside the 32-bit version. Its filters would then go in the plugins folder inside the AVSPLUS_x64 folder. To preview a script with 64-bit filters, you'll need the 64-bit version of AVSPmod. To render using 64-bit AVISynth, you'll need to use the 64-bit version of FFMPEG. You can follow the above setup instructions for FFMPEG I've described above, or go to this post to see how to set up both the 32 and 64-bit versions at the same time and use either at will.



Bonus unnecessary info:

If you need to do step 11 of the setup process a lot, you can copy the files over to the directory of whatever version of AVISynth you're running (in the case of the above tutorial, AVSPLUS_x86), then add entries to the .bat file to have them copied over and uninstalled as part of the script. To do so, edit the .bat file.

For example, if I wanted to add the FFTW3 library files to the install, I would change:

) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"

so it becomes:


) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\FFTW3.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\libfftw3f-3.dll" "%WINDIR%\SysWow64"

To allow the installer to uninstall those files, I would change:

) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"

so it becomes:

) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
del "%WINDIR%\SysWow64\libfftw3f-3.dll"
del "%WINDIR%\SysWow64\FFTW3.dll"

No comments:

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 ...