Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
27th May 2020, 09:18 | #1 | Link |
Registered User
Join Date: Oct 2015
Posts: 97
|
Using Avisynth in FFmpeg ? (Unknown error occurred)
I want to import avisynth in ffmpeg but it has error
Code:
ffmpeg -i test.avs -vcodec libx264 -preset ultrafast -crf 18 -acodec libopus -b:a 192k out.mkv Code:
LoadPlugin("C:\Users\Downloads\Programs\MeGui\tools\ffms\ffms2.dll") FFVideoSource("C:\Users\Downloads\Video\file.mkv") I had Avisynth 2.6 installed on my pc, But even i upgrade it to +3.6.0 still same error. |
27th May 2020, 09:20 | #2 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
Does the script open in Virtualdub? (Or any tool capable of opening avs scripts since you are using Linux)?
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
27th May 2020, 09:40 | #4 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Try the ffmpeg build in staxrip, it's from Patman and supports avisynth and vapoursynth input.
In staxrip there is an encoder dialog, at the bottom there is a dropdown menu where you can find a few useful command line features such as: Execute Command Line Show Command Line Copy Command Line Before using the features open a source file and if you can install Windows Terminal! Another similar advanced GUI is Hybrid, GUIs can be useful for people that try to learn the console or look for builds, most dialogs in staxrip have a command line preview, the log file is very clean and list all command lines it executes. staxrip has a Apps dialog that shows the version, the name who has built it, when it was built, which compiler was used etc. and it has download links, in the case of ffmpeg a link to Patmans MediaFire folder.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 27th May 2020 at 09:58. |
27th May 2020, 15:48 | #8 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Starting with version 3.1.2 the FFmpeg AVS interface has changed. To use an AVS script as the input for FFmpeg it is necessary to include the folder from which the AVS script loads plugins in your "PATH" variable (even if this is your "AviSynth\Plugins" autoload folder).
Last edited by manolito; 27th May 2020 at 15:53. |
27th May 2020, 19:08 | #9 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
EDIT: What if you load some plugins from auto Plugins directory, and other plugins from other user directories, all gotta be in path ?
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th May 2020 at 19:11. |
|
27th May 2020, 19:21 | #10 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Not necessarily. You can customise auto-load directory/directories in the batch file.
__________________
Groucho's Avisynth Stuff |
27th May 2020, 19:26 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
But would you not also need Path Add (or whatever the command is)
EDIT: And where manual load loading plugins in script then also somehow need do it there as well.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th May 2020 at 13:26. |
27th May 2020, 19:38 | #12 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Yes. Although there's probably a way to do this in the batch file "automatically".
__________________
Groucho's Avisynth Stuff |
27th May 2020, 19:59 | #13 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Quote:
I always try to establish upgrade paths for the AVStoDVD helper tools, and FFmpeg really gave me a headache when they changed their AVS interface. AVStoDVD tries to be "self-sufficient", it loads all AVS plugins it needs explicitly from one of its own subfolders. Including these subfolders in the path did not make the error message disappear, and the reason was that I had added some stuff to the AVS script where the required plugins were autoloaded. Only after also adding the autoload folder to the path FFmpeg was happy again.. |
|
27th May 2020, 20:09 | #14 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Damn, thats a bummer, guess I'll stick with v3.1.2 or thereabouts for avs.
EDIT: Maybe a bit of improvisation is required. Somebody else improvising:- https://metro.co.uk/video/woman-impr...-mask-2179162/
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th May 2020 at 20:17. |
27th May 2020, 21:28 | #15 | Link | |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
ffmpeg does not use standard DLL loading, it does not find avisynth.dll in portable mode, standard DLL loading would find it when it's in path, I have to fake it with a soft link, staxrip has a dozen avisynth and vapoursynth clients included and ffmpeg is the only one paranoid enough to block default DLL loading...
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 27th May 2020 at 21:31. |
|
27th May 2020, 23:10 | #16 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Quote:
AVStoDVD has a "Lib" subfolder where the AviSynth plugins and the "A2DSource.avsi" are located. Here is the relevant part from this AVSI: Quote:
This works fine with older FFmpeg versions, but using a current version will crash FFmpeg. The only way to prevent this crash is to add the "AVStoDVD\Lib" folder to the Path environment variable (or go back to an older FFmpeg version). So please before you make such a false statement the next time, take the time to test it yourself... |
||
28th May 2020, 01:46 | #17 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
The Windows convention is like this:
If you call a file in the currently active folder then it is not necessary to specify the absolute path. Just specifying the file name is all which is required in this case. If the active folder is elsewhere then the full absolute path is required to call a file. If the folder where the requested file is stored is contained in the "Path" variable then it is never required to specify the full path to the file. The file name is all which is needed. The FFmpeg devs decided to break this convention a while ago. Even if the "LoadPlugin" call contains the full path of the plugin, the plugin will not load and you will get an error message unless the folder where the plugin is stored is part of the "Path" environment variable. I really hate the FFmpeg devs for making such a decision. But like it or not, this is the current state of things... |
28th May 2020, 02:02 | #18 | Link | |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
28th May 2020, 19:32 | #19 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
This whole thing with FFmpeg suddenly breaking the loading of plugins happened in 2016, so I rechecked it today.
WinXP SP3 32-bit Classic AVS 2.6.1 Alpha The latest XP compatible build of FFmpeg by Reino An older Sherpya XP compatible build from 2015 Case one: All plugins located in the autoload folder, folder is not in the path. I have to mention that I have a few C-Plugins in the autoload folder which I autoload with the help of a separate AVSI which has a LoadCPlugin command to load this C-Plugin (the ffms2 C-Plugin comes with such an AVSI). Using the current FFmpeg version I get an error message that a C-Plugin cannot be loaded, then FFmpeg aborts. This happens even if none of the C-Plugins is used in the script. No problem with the older FFmpeg version. To make it work with the new FFmpeg I need to include the autoload folder in the path. The issue is probably not present under AVS+ because AVS+ can autoload C-Plugins. Case two: Autoload folder is empty, all plugins located in a separate folder where nothing gets autoloaded. This folder is not in the path. Using LoadPlugin commands which specify the full path of the plugins works, also with the new FFmpeg version. But making this plugin folder the active folder first and then use LoadPlugin commands specifying just the file name does not work with the new FFmpeg version. (This is how AVStoDVD does it so the new FFmpeg versions crash) Again this method works with the old FFmpeg version, while the new version requires that the plugin folder is in the path. And not to forget that this is solely an FFmpeg issue. Other encoders like HCenc are not affected, they work without the need to add plugin folders to the path for both usage cases. Last edited by manolito; 28th May 2020 at 22:50. |
29th May 2020, 06:38 | #20 | Link | ||
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
For specific reference, these two commits are what manolito is talking about:
Safe win32 dlopen implementation: https://git.videolan.org/?p=ffmpeg.g...e2c2e6136931eb Switching AviSynth to said dlopen implementation: https://git.videolan.org/?p=ffmpeg.g...05b7e257778e1f Right at the top of compat/w32dlfcn.h: Quote:
Quote:
https://ffmpeg.org/pipermail/ffmpeg-...st/198519.html That said, this issue doesn't exist on Windows 10. The if blocks in w32dlfcn.h are #if _WIN32_WINNT < 0x0602 - i.e. anything below Windows 8. So XP (until the bcrypt switchover in 2018, anyway, as that was when FFmpeg dropped XP support), Vista, and 7 would be subject to that block, and 8, 8.1, and 10 are not, because the issue this was meant to address (KB2533623) was already fixed in the RTM of Windows 8. |
||
|
|