Answers.Body: <h3>The short answer, if you're familiar with AviSynth</h3>
  
  <p>You don't need to use <code>LoadPlugin()</code>, if you copy the four files in the plugin:</p>
  
  <pre><code>FFMS2.avsi
  ffms2.dll
  ffms2.lib
  ffmsindex.exe
  </code></pre>
  
  <p>to the plugins directory of your AviSynth installation (see below for its location).</p>
  
  <p>That's all. Then you directly use it in your AviSynth script calling its function(s), mostly the function</p>
  
  <pre><code>FFmpegSource2()
  </code></pre>
  
  <p>(or <code>FFMS2()</code>, which is the same, or <code>FFMS2("your_file.ts", atrack=-1)</code>) in concordance with documentation, but not <code>DirectShowSource()</code>.</p>
  
  <hr>
  
  <h3>The long answer</h3>
  
  <p>If you're beginning with AviSynth, the rest of the answer will walk you through the pitfalls.</p>
  
  <p><strong>AviSynth versus AviSynth+</strong></p>
  
  <p>AviSynth has two versions, denoted AviSynth and AviSynth+, at <a href="http://avisynth.nl/index.php/Main_Page" rel="nofollow noreferrer">the homepage</a>:</p>
  
  <blockquote>
    <p><strong>Official builds</strong><br>
    v.2.6.0 ST, 32-bit at SourceForge<br>
    ...<br>
    <strong>Forks</strong><br>
    AviSynth+: new features, backward compatible.</p>
  </blockquote>
  
  <p>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 <code>FFMS2</code>. Download it from the <a href="https://github.com/AviSynth/AviSynthPlus/releases" rel="nofollow noreferrer">official Github repo</a> pointed to from <a href="http://avisynth.nl/index.php/Main_Page" rel="nofollow noreferrer">the homepage</a>.</p>
  
  <p><strong>The directory of plugins for AviSynth+</strong></p>
  
  <p>When you install the Github fork of AviSynth+, check the box <code>Customize plugins directory</code> to find the paths without changing them. Copy the four plugin files mentioned above to <code>C:\Program Files (x86)\AviSynth+\plugins+</code> or to <code>C:\Program Files (x86)\AviSynth+\plugins64+</code>, depending on your version of Windows. The <code>+</code> at the end of the directory is for AviSynth+ instead of AviSynth.</p>
  
  <p>The file <code>FFMS2.avsi</code> in the FFMS2 plugin is the same for both architectures.</p>
  
  <p>If you copy it to the wrong directory, you may see this in Windows Media Player:</p>
  
  <pre>
  Cannot load a 64 bit DLL in 32 bit Avisynth: 
      'C:/Program Files (x86)/AviSynth+/plugins+/ffms2.dll'
  </pre>
  
  <p>which means that you should move those files to <code>C:\Program Files (x86)\AviSynth+\plugins64+\</code>.</p>
  
  <p><strong>Choose the appropriate media player</strong></p>
  
  <p>If you play the <code>.avs</code> file with Windows Media Player, you may see  a <code>.MP4.ffindex</code> file for each file that you use with <code>FFMS2()</code> and the <code>.avs</code> file shows no image and no sound, only a musical note that looks like standard Windows.</p>
  
  <p>Windows Media Player is not able to play back <code>.avs</code> files. Use Media Player Classic — you may get it with very useful <a href="https://www.codecguide.com/download_k-lite_codec_pack_mega.htm" rel="nofollow noreferrer">K-Lite Mega Codec Pack</a> — simply download and install it. Be sure to select the <strong>Mega</strong> pack, because the Basic pack doesn't contain the player.</p>
  
  <p><strong>Convert the script to a media file</strong></p>
  
  <p>Another possibility is to convert the <code>.avs</code> file into a media file, for example with <a href="https://ffmpeg.org/" rel="nofollow noreferrer">FFmpeg</a>:</p>
  
  <pre><code>ffmpeg -i your.avs output.mp4
  </code></pre>
  
  <p>FFmpeg chooses appropriate codecs automatically by the extension of the output file) and play back the result in (almost) any media player.</p>
  
  <p>You may download the ready-to-use FFmpeg from <a href="https://ffmpeg.zeranoe.com/builds/" rel="nofollow noreferrer">Zeranoe's page</a> — just unpack the downloaded archive file and add the path to <code>ffmpeg.exe</code> into your <code>PATH</code> environment variable.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-29T00:23:20.027Z
Answers.Text: You still used `DirectShowSource` filter. Use `FFMS2` instead: `FFMS2(your_file.ts, atrack=-1)`. You needn't use `LoadPlugin()`, it will be autoloaded by using `FFMS2`.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-07T22:18:08.573Z
Answers.Text: It means that the directory into your copied file is NOT an autoload directory. I don't know which version of AviSynth do you use — see e.g. [Plugin Autoloader](http://avisynth.nl/index.php/AviSynth%2B#Plugin_Autoloader). If you have a very old version, consider to download a newer one: [Avisynth+ r2772-MT](https://github.com/pinterf/AviSynthPlus/releases/tag/r2772-MT) 64-bit + 32-bit (download links are at the end), or [AviSynth+ 3.4.0](https://github.com/AviSynth/AviSynthPlus/releases/tag/v3.4.0) (only 32-bit IMHO).
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-07T22:21:22.583Z
Answers.Text: No, [AviSynth+ 3.4.0](https://github.com/AviSynth/AviSynthPlus/releases/tag/v3.4.0) is both 64-bit + 32-bit, too.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-11T19:13:50.807Z
Answers.Text: Which version of AviSynth do you have? (Put the `version` as a single row in your text editor, save it as `version.avs` and play it back.)
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-11T21:37:24.443Z
Answers.Text: It's very old version, in spite it's an "Official build" one. Use "Forks -> Latest release" (which is the same 3.4.0 as I already wrote in my previous comment) and download the .exe file (the installer).
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-12T18:44:04.047Z
Answers.Text: See my extended answer — all things are now good, only Windows Media Player is not appropriate for `.avs` files.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-11T12:58:30.593Z
Answers.Text: @miguelmorin, it will be nice from you and helpful for other people. Feel free to edit it.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-11T13:24:43.973Z
Answers.Text: @miguelmorin, other possibility is to write the summary of the discussion as your own answer, and I will it vote up (and maybe other people, too). Yes, you may answer your own question.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-20T12:06:11.220Z
Answers.Text: @miguelmorin — yes, it would be better to make it as a new question, because **1.** you will have a larger space to express your problem, **2.** if I will not answer your question, other people may do it, **3.** everyone may vote your answer.
Answers.UserDisplayName: MarianD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-22T06:51:11.030Z
Answers.Text: I added a new question about 32-bit AviSynth+ https://video.stackexchange.com/questions/30042/how-to-install-avisynth-32-bit
Answers.UserDisplayName: emonigma
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T12:05:21.220Z
Answers.LastActivityDate: 2020-02-11T18:13:19.093Z
Answers.LastEditDate: 2020-02-11T18:13:19.093Z
Answers.UserDisplayName: MarianD
Body: <p>I was unable to read MTS or MP4 files in AviSynth. <a href="https://video.stackexchange.com/questions/29123/can-avisynth-handle-mts-files/29126#29126">Can AviSynth handle MTS files?</a> pointed to the <a href="https://github.com/FFMS/ffms2" rel="nofollow noreferrer">FFmpegSource2 filter</a>, with <a href="http://avisynth.nl/index.php/FFmpegSource" rel="nofollow noreferrer">information on the wiki</a>. I downloaded the plugin and pointed to it from the first line</p>
  
  <pre><code>LoadPlugin("C:\path\to\ffms2\x64\ffms2.dll")
  DirectShowSource("\path\to\MP4\file")
  </code></pre>
  
  <p>This threw <code>error 0xc1</code>. <a href="https://forum.videohelp.com/threads/381913-avisynth-LoadPlugin-LSMASHSource-dll-error-0xc1" rel="nofollow noreferrer">This thread</a> mentioned different architectures, so I tried the <code>x86</code> folder (<code>C:\Program Files (x86)\AviSynth\plugins</code>).</p>
  
  <p>After a little while, Windows Media Player opens a dialog with this text (translated to English):</p>
  
  <pre><code>Windows Media Player is unable to open the file. It's possible that Media Player
  does not support this type of file or that you need a codec that is not
  installed. [Close] [Help online]
  </code></pre>
  
  <p>How can I enable FFmpegSource2 plugin in AviSynth?</p>
  
Tags: <ffmpeg><codec><mpeg><avisynth>
Title: Errors in FFmpegSource2 plugin source filter for AviSynth
UserDisplayName: emonigma
ThreadText: # Errors in FFmpegSource2 plugin source filter for AviSynth
  
  (Asked by: username_0 on 2019-12-22)
  
  I was unable to read MTS or MP4 files in AviSynth. [Can AviSynth handle MTS files?](https://video.stackexchange.com/questions/29123/can-avisynth-handle-mts-files/29126#29126) pointed to the [FFmpegSource2 filter](https://github.com/FFMS/ffms2), with [information on the wiki](http://avisynth.nl/index.php/FFmpegSource). I downloaded the plugin and pointed to it from the first line
  
  ```
  LoadPlugin("C:\path\to\ffms2\x64\ffms2.dll")
  DirectShowSource("\path\to\MP4\file")
  
  ```
  
  This threw `error 0xc1`. [This thread](https://forum.videohelp.com/threads/381913-avisynth-LoadPlugin-LSMASHSource-dll-error-0xc1) mentioned different architectures, so I tried the `x86` folder (`C:\Program Files (x86)\AviSynth\plugins`).
  
  After a little while, Windows Media Player opens a dialog with this text (translated to English):
  
  ```
  Windows Media Player is unable to open the file. It's possible that Media Player
  does not support this type of file or that you need a codec that is not
  installed. [Close] [Help online]
  
  ```
  
  How can I enable FFmpegSource2 plugin in AviSynth?
  
  **Tags:** ffmpeg, codec, mpeg, avisynth
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-12-23. Score: 1 | Accepted answer
  
  ### 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](http://avisynth.nl/index.php/Main_Page):
  
  > **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](https://github.com/AviSynth/AviSynthPlus/releases) pointed to from [the homepage](http://avisynth.nl/index.php/Main_Page).
  
  **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](https://www.codecguide.com/download_k-lite_codec_pack_mega.htm) — 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](https://ffmpeg.org/):
  
  ```
  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](https://ffmpeg.zeranoe.com/builds/) — just unpack the downloaded archive file and add the path to `ffmpeg.exe` into your `PATH` environment variable.
  
  > **Comments:**
  > **username_1**: You still used `DirectShowSource` filter. Use `FFMS2` instead: `FFMS2(your_file.ts, atrack=-1)`. You needn't use `LoadPlugin()`, it will be autoloaded by using `FFMS2`.  
  > **username_1**: It means that the directory into your copied file is NOT an autoload directory. I don't know which version of AviSynth do you use — see e.g. [Plugin Autoloader](http://avisynth.nl/index.php/AviSynth%2B#Plugin_Autoloader). If you have a very old version, consider to download a newer one: [Avisynth+ r2772-MT](https://github.com/pinterf/AviSynthPlus/releases/tag/r2772-MT) 64-bit + 32-bit (download links are at the end), or [AviSynth+ 3.4.0](https://github.com/AviSynth/AviSynthPlus/releases/tag/v3.4.0) (only 32-bit IMHO).  
  > **username_1**: No, [AviSynth+ 3.4.0](https://github.com/AviSynth/AviSynthPlus/releases/tag/v3.4.0) is both 64-bit + 32-bit, too.  
  > **username_1**: Which version of AviSynth do you have? (Put the `version` as a single row in your text editor, save it as `version.avs` and play it back.)  
  > **username_1**: It's very old version, in spite it's an "Official build" one. Use "Forks -> Latest release" (which is the same 3.4.0 as I already wrote in my previous comment) and download the .exe file (the installer).  
  > **username_1**: See my extended answer — all things are now good, only Windows Media Player is not appropriate for `.avs` files.  
  > **username_1**: @miguelmorin, it will be nice from you and helpful for other people. Feel free to edit it.  
  > **username_1**: @miguelmorin, other possibility is to write the summary of the discussion as your own answer, and I will it vote up (and maybe other people, too). Yes, you may answer your own question.  
  > **username_1**: @miguelmorin — yes, it would be better to make it as a new question, because **1.** you will have a larger space to express your problem, **2.** if I will not answer your question, other people may do it, **3.** everyone may vote your answer.  
  > **username_0**: I added a new question about 32-bit AviSynth+ https://video.stackexchange.com/questions/30042/how-to-install-avisynth-32-bit  
  
  ---
  
  