unicodeutf-8ffmpegdirectshowavisynth

UTF-8 source files are not supported in avisynth


I use avisynth to demux video from audio. When I use

 x = "m.mkv"
 ffvideosource(x)

It work correctly but when I change my video filename to a UTF-8 one and my script as:

 x = "م.mkv"
 ffvideosource(x)

I Got the following error: failed to open for hashing avisynth

I found a link (UTF-8 source files are not supported) who tell UTF-8 file name not work in avisynth, and to correct the problem, it said:

specify the parameter utf8=true when calling ffvideosource, save the script as UTF-8 without BOM and then see if that works.

But, I couldn't solve the problem. As I Open the script in the notepad and save it in utf-8 format, I got the following error:

UTF-8 Source files are not supported, re-save script with ANSI encoding

How can I solve the problem, How can I run my script with a UTF-8 filename?


Solution

  • Very common problem when using UTF-8 in AviSynth.

    Follow these steps:

    1. Check the plugins folder. There should exist these three files: ffms2.dll, ffmsindex.exe, and FFMS2.avsi. If you did not have problem with ANSI, I guess that you don't have FFMS2.avsi in your plugins folder; In this situation download the latest version form here.

    2. After that make an AVS file with Notepad++. For example I do this:

      x = "C:/Users/Nemat/Desktop/StackOverFlow/نعمت.mkv"
      ffmpegsource2(x,utf8=true)
      

      Please note that here I used ffmpegsource2().

    3. In the Encoding menu from Notepadd++ select Encode in UTF-8 without BOM.

    4. Save your file.

    5. Check the video file exists in the addressed directory.

    6. Double click on your AVS file.

    7. Enjoy it!