The short answer, if you're familiar with AviSynth
You don't need to use LoadPlugin()
, if you copy the four files in the plugin:
FFMS2.avsi
ffms2.dll
ffms2.lib
ffmsindex.exe
to the plugins directory of your AviSynth installation (see below for its location).
That's all. Then you directly use it in your AviSynth script calling its function(s), mostly the function
FFmpegSource2()
(or FFMS2()
, which is the same, or FFMS2("your_file.ts", atrack=-1)
) in concordance with documentation, but not DirectShowSource()
.
The long answer
If you're beginning with AviSynth, the rest of the answer will walk you through the pitfalls.
AviSynth versus AviSynth+
AviSynth has two versions, denoted AviSynth and AviSynth+, at the homepage:
Official builds
v.2.6.0 ST, 32-bit at SourceForge
...
Forks
AviSynth+: new features, backward compatible.
AviSynth 2.6.0 is a very old version, in spite of its title as an "Official build". You're better off with the new version for FFMS2
. Download it from the official Github repo pointed to from the homepage.
The directory of plugins for AviSynth+
When you install the Github fork of AviSynth+, check the box Customize plugins directory
to find the paths without changing them. Copy the four plugin files mentioned above to C:\Program Files (x86)\AviSynth+\plugins+
or to C:\Program Files (x86)\AviSynth+\plugins64+
, depending on your version of Windows. The +
at the end of the directory is for AviSynth+ instead of AviSynth.
The file FFMS2.avsi
in the FFMS2 plugin is the same for both architectures.
If you copy it to the wrong directory, you may see this in Windows Media Player:
Cannot load a 64 bit DLL in 32 bit Avisynth:
'C:/Program Files (x86)/AviSynth+/plugins+/ffms2.dll'
which means that you should move those files to C:\Program Files (x86)\AviSynth+\plugins64+\
.
Choose the appropriate media player
If you play the .avs
file with Windows Media Player, you may see a .MP4.ffindex
file for each file that you use with FFMS2()
and the .avs
file shows no image and no sound, only a musical note that looks like standard Windows.
Windows Media Player is not able to play back .avs
files. Use Media Player Classic — you may get it with very useful K-Lite Mega Codec Pack — simply download and install it. Be sure to select the Mega pack, because the Basic pack doesn't contain the player.
Convert the script to a media file
Another possibility is to convert the .avs
file into a media file, for example with FFmpeg:
ffmpeg -i your.avs output.mp4
FFmpeg chooses appropriate codecs automatically by the extension of the output file) and play back the result in (almost) any media player.
You may download the ready-to-use FFmpeg from Zeranoe's page — just unpack the downloaded archive file and add the path to ffmpeg.exe
into your PATH
environment variable.