Error using avisynth script as input to ffmpeg

I searched the internet and could not find a solution. I hope this question will not be duplicated.

I have the following files in one folder:

  • ffmpeg.exe (32-bit)
  • IN.mp4 (video codec - AVC, audio codec - PCM)
  • RUN_FILE.bat and batch files RUN_AVS.bat
  • SCRIPT.avs (avisynth script file)
  • MSharpen.dll (sharpening filter for avisynth)

Text in RUN_FILE.bat :

 ffmpeg -i "IN.mp4" -c:v libx264 -crf 24 -c:a libmp3lame -aq 2 OUT.mp4 

Text in RUN_AVS.bat :

 ffmpeg -i "SCRIPT.avs" -c:v libx264 -crf 24 -c:a libmp3lame -aq 2 OUT.mp4 

Text in SCRIPT.avs (3 lines):

 LoadPlugin("D:\MSharpen.dll") DirectShowSource("D:\IN.MP4") MSharpen(15,150) 

If I try to download an avisynth script using an external program such as a classic media player, it works fine (and sharpens the video frames).

Going to the command line and starting RUN_FILE.bat works as expected, however, running RUN_AVS.bat me the following error (see screenshot):

error message

I find this confusing since ffmpeg is configured with --enable-avisynth .

I would appreciate help on this. This is part of a large and very important project (automatically scanning a folder with hundreds of video files, sharpening and transcoding them to another folder with the same file names).

+7
ffmpeg video avisynth
source share
2 answers

Well ... it looks like it's all about the versions.

Note rogerdpack is what made me systematically try old versions of ffmpeg, etc. I gave my answer +1, but I think the answer should be such that it is a complete solution to the question, so I am writing my own answer. I hope you understand rogerdpack :-)

Anyway, here is the combination that worked for me (I hope the post url is ok):

32-bit version of FFMPEG version 2.5.2 (downloaded from http://ffmpeg.zeranoe.com/ )

Avisynth 2.5.8 (download from official build )

MSharpen plugin for avisynth (downloaded from MSharpen Official Link ).

Be sure to copy the MSharpen.dll file to the avisynth plugin folder and restart the computer. In my case, the plugin folder is C:\Program Files (x86)\AviSynth 2.5\plugins .

BTW I am running Windows 7 Ultimate Service Pack 1 (64 bit) with Intel i5-3570K, 16GB RAM, etc. Perhaps I should have said that in the OP.

What is it worth, here is my solution.

The location of the folders and files is as follows:

I have a main folder; the name does not matter - name it "MAIN". Inside the "MAIN" I have 2 files and 2 folders.

2 files:

  • ffmpeg.exe (version 2.5.2, 32-bit)
  • Batchconvert.bat

2 folders:

  • Source (contains all video files)
  • Target (will contain encoded video output files)

The BatchConvert.bat file has the following text:

for %% a in ("Source *. *") do @echo DirectShowSource ("%% a") → "batchScript.avs" && & &&& & & @echo MSharpen (10, 120) → "batchScript.avs" && & & ffmpeg -i "batchScript.avs" -n -c: v libx264 -crf 24 -c: a libmp3lame -b: a 192k "Target \ %% ~ na.mp4" && & &&& & del "batchScript.avs" pause

A batch file basically scans all files from the "Source" and encodes them in the "Target", and it skips files that have already been encoded. It does not modify the files in the "Source" at all, just in case.

All that remains to be done is to copy all the videos to Source and run BatchConvert.bat!

+1
source share

Have you tried Google searches for the red image in the screenshot?

From what I found here http://ffmpeg.zeranoe.com/forum/viewtopic.php?t=1084 , and in other sources an unknown error may be due to a difference in 32/64-bit builds, either in ffmpeg or avisynth . It may also be a problem if you use Avisynth 2.5.8 instead of 2.6 (open an avisynth script containing "Version ()" as the last command in it, in any player, to find which one you have). Finally, you can try opening the script in x264.exe instead of ffmpeg and see if it works.

I would post it in the comments instead of the answer, but I have not yet been allowed to comment.

+6
source share

All Articles