View Full Version : portable avisynth?
vlada
12th April 2008, 07:47
squid_80>
xvid_encraw.exe works fine if I feed it with avisynth script
directly. But I want to use avs2yuv to workaround the need to have avisynth installed.
The mencoder is directly from avs2yuv site (http://akuvian.org/src/avisynth/avs2yuv/):
Sample usage:
wine avs2yuv.exe foo.avs - | mencoder - -o hfyu.avi -ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-1:pred=2:context=1
So I guess no switch for mencoder is needed.
Edit: I found out, that he problem with xvid was caused by a damaged xvid_enxraw.exe file.
vlada
14th April 2008, 17:59
I thought I made avs2yuv -> xvid to work, but apparently I confused something, because now I can't make it work on any computer. Here is my commandline:
"exe\avs2yuv.exe" "test.avs" - | "exe\xvid_encraw.exe" - -type 0 -avi "video_out.avi" -max_bframes 2 -qpel -pass1 -qtype 1 -nopacked -progress 10 -stats
The output is very strange:
http://img365.imageshack.us/img365/1024/avs2yuv1rm4.th.png (http://img365.imageshack.us/my.php?image=avs2yuv1rm4.png)
http://img393.imageshack.us/img393/1336/avs2yuv2wv5.th.png (http://img393.imageshack.us/my.php?image=avs2yuv2wv5.png)
So xvid_encraw just prints out it's parameters reference. I believe that the error at the last line comes from avs2yuv.
I also tried following:
exe\avs2yuv.exe "test.avs" -o "test.y4m"
exe\xvid_encraw.exe -i "test.y4m" -type 0 -avi "video_out.avi" -max_bframes 2 -qpel -pass1 -qtype 1 -nopacked -progress 10 -stats
Avs2yuv works O.K., but xvid_encraw gives following error:
http://img373.imageshack.us/img373/1965/avs2yuv3yc3.th.png (http://img373.imageshack.us/my.php?image=avs2yuv3yc3.png)
Do you have any idea what's wrong?
squid_80
14th April 2008, 19:12
I think that first hypen (after xvid_encraw.exe) should be "-i -". Also for y4m input to xvid_encraw you need to specify a framerate (via -framerate) since it can't be determined from the source file (I don't know if it even works, I haven't tested y4m input in a long time).
vlada
14th April 2008, 19:58
Thanks for the suggestions, but unfortunately it doesn't work neither.
Adding the -i parameters raises "Error opening input file -". For the y4m input, it was just to try if avs2yuv output is usable for xvid_encraw. Anyway after specifying framerate and number of frames, xvid_encraw says: "Wrong input format, I want YUV encapsulated in PGM".
So I'm wondering if it is even supposed to work. I was hoping that the output format of avs2yuv will be acceptable for xvid_encraw. Do you have any idea if the developres of these tools are arround?
Or is there any other solution to make Avisynth work without installation? I would like to make my Avisynth based application portable.
squid_80
14th April 2008, 22:41
I wrote most of xvid_encraw. I also have a bad memory.
Try this:
avs2yuv -raw script.avs -o - | xvid_encraw -type 0 -w WIDTH -h HEIGHT -framerate FPS (other options...)
where WIDTH, HEIGHT and FPS are numbers you must fill in (they should match the avisynth script).
vlada
15th April 2008, 09:24
That's it!!! :thanks:
This command line works perfectly:
exe\avs2yuv.exe "temp\video.avs" - | exe\xvid_encraw.exe -type 0 -framerate 25 -w 320 -h 240 -frames 2493 -avi "video_output.avi" ...
So the basic problem was in the hypen i used in xvid_encraw commandline. The second problem is that it doesn't detect framerate, resolution and number of frames. But that's no problem for me, because I know them.
Now I have a portable anyhting -> AVI/MPEG-4 transcoder. After fixing some bugs and adding some missing features, I can finally release my first 0.1 alpha 1 version. :)
IanB
11th July 2008, 23:48
I should have bumped this thread in May.AviSynth 2.5.8 RC2 [June 22nd] - Release!
Changelist with respect to 2.5.7:
Additions:
* Installer standalone option for putting avisynth.dll, etc into install directory and NOT updating registry.Are there any other Installer additions that could assist this project?
smok3
14th July 2008, 14:53
for my hack i find it enough if installer is extractable using a tool like 'universal extractor', so you really shouldn't bother (imho).
The useful things would be (again imho):
a. good&short guide/wiki post from a developer about the procedure and needed files and about possible mess that the procedure may produce
b. recommended guidelines for app developers on how to check if avisynth is installed/operational
*procedure as procedure of making avisynth portable (or half-portable).
IanB
14th July 2008, 22:53
We would rather provide you with the option to extract the contents through the installer than have you rip the contents with some tool because the installer presents the license and you then have to formally accept it.
If you want to troll this and other threads to assemble some documentation and examples I am happy to include them.
smok3
21st July 2008, 11:42
got it (about license),
edit, 4th time, (backslash in paths must actually be double backslash for the registry, now checking if avisynth.dll is in the same dir):
here is a little solution with batch files (they will figure out what is current dir and echo a proper reg), this replaces Avisynth_Template.reg, if you think it is good enough;
ON.bat
@echo off
set THISDIR=%cd%
set INSTALLDIR=%THISDIR:\=\\%
echo INSTALLDIR %INSTALLDIR%
echo.
if exist %THISDIR%\avisynth.dll (
echo avisynth.dll found
) else (
echo avisynth.dll NOT found
pause
goto :eof
)
echo Windows Registry Editor Version 5.00 > tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}] >> tmp.reg
echo @="AviSynth" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll" >> tmp.reg
echo "ThreadingModel"="Apartment" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\Media Type\Extensions\.avs] >> tmp.reg
echo @="" >> tmp.reg
echo "Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\.avs] >> tmp.reg
echo @="avsfile" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\avsfile] >> tmp.reg
echo @="AviSynth Script" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\avsfile\DefaultIcon] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll,0" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\.avsi] >> tmp.reg
echo @="avs_auto_file" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\avs_auto_file] >> tmp.reg
echo @="AviSynth Autoload Script" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll,0" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS] >> tmp.reg
echo @="{E6D6B700-124D-11D4-86F3-DB80AFD98778}" >> tmp.reg
echo. >> tmp.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth] >> tmp.reg
echo @="%INSTALLDIR%" >> tmp.reg
echo "plugindir2_5"="%INSTALLDIR%\\plugins" >> tmp.reg
tmp.reg
del tmp.reg
OFF.bat
@echo off
set THISDIR=%cd%
set INSTALLDIR=%THISDIR:\=\\%
echo INSTALLDIR %INSTALLDIR%
echo.
echo Windows Registry Editor Version 5.00 > tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}] >> tmp.reg
echo @="AviSynth" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll" >> tmp.reg
echo "ThreadingModel"="Apartment" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\Media Type\Extensions\.avs] >> tmp.reg
echo @="" >> tmp.reg
echo "Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\.avs] >> tmp.reg
echo @="avsfile" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\avsfile] >> tmp.reg
echo @="AviSynth Script" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\avsfile\DefaultIcon] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll,0" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\.avsi] >> tmp.reg
echo @="avs_auto_file" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\avs_auto_file] >> tmp.reg
echo @="AviSynth Autoload Script" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon] >> tmp.reg
echo @="%INSTALLDIR%\\AviSynth.dll,0" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS] >> tmp.reg
echo @="{E6D6B700-124D-11D4-86F3-DB80AFD98778}" >> tmp.reg
echo. >> tmp.reg
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth] >> tmp.reg
echo @="%INSTALLDIR%" >> tmp.reg
echo "plugindir2_5"="%INSTALLDIR%\\plugins" >> tmp.reg
tmp.reg
del tmp.reg
edit: this will only work in win xp (fails in win 7)
IanB
21st July 2008, 23:54
Cute! :D
For belt and braces security you could add If exists %INSTALLDIR%\AviSynth.dll ...
smok3
22nd July 2008, 00:25
ok, added.
another thing, a little checker that would check if avisynth is operational, avsutil.exe is required:
checkAvisynth2.bat
:: check if avisynth is operational using practical test
@echo off
:: make temporary version.avs in current folder
echo filename = ^"avstest.txt^" > version.avs
echo Version^(^) >> version.avs
echo trim^(1,5^) >> version.avs
echo converttoyv12^(^) >> version.avs
echo WriteFile^(filename, ^"current_frame^"^) >> version.avs
::run version.avs with avs2avi or x264 in null mode to get the avisynth log
::avs2avi version.avs null.avi -o n -c null >nul 2>&1
::x264 --pass 1 --bitrate 1000 --stats "temp.stats" --output NUL "version.avs" >nul 2>&1
avsutil version.avs play >nul 2>&1
echo.
:: check if there was something written
if exist avstest.txt (
echo avisynth seems operational!
) else (
echo avisynth test did NOT pass!
)
echo.
::delete some
del version.avs >nul 2>&1
del avstest.txt >nul 2>&1
del temp.stats >nul 2>&1
pause
avsutil.exe was found here;
bin http://members.optusnet.com.au/squid_80/
src http://members.optusnet.com.au/squid_80/sources/
edit: license should be ok http://forum.doom9.org/showthread.php?p=1161920#post1161920
---
so now we have;
ON.bat
OFF.bat
checkAvisynth2.bat
On the 2nd thought i wouldn't connect ON and checkAvisynth2, since it's not tested enough and can just generate problems, it won't hurt to have it there thought (together with avsutil.exe + sources http://members.optusnet.com.au/squid_80/sources/avsutil_src.zip)
-------
all the batches and avsutil here;
edit: files provided on request
caeb1dfaa1ec5a508d0a127193bcba87 *portableBatches.7z
(tested on winxp and win7, works fine)
vlada
7th August 2008, 14:13
Unfortunately this doesn't work unless you are administrator. A user doesn't have access to the needed parts of registry. But I'm afraid there isn't workaround for this problem. :-(
SpAwN_gUy
12th September 2008, 16:10
hello, i've found this topic just a few moments ago.. and...
i wonder.. is it possible to make an asv2yuv build.. statically linked with avisynth lib...
'cause.. if this works.. one will have something like avs2yuv standalone exe...
i'm still confused 'bout those thingin compiling.. but i'm an x264farm user.. and there is an option to use avs2yuv on the agent side... and i'm thinking to distribute installer (with "avs2yuv standalone") ... across the network.. so it would not need anything else installed.. and run only when needed..
royia
10th July 2010, 07:42
Are there VirtualDUB / ME GUI versions with AVISynth preinstalled?
Thanks.
DTL
1st December 2025, 11:18
Is it possible to use AVS+ at Win11 in compleltely 'portable' mode (without changes to registry) ? It looks I lost possibility to access even AVX2-based CPU host to make some encodings with AVS. I typically need to run VirtualDub and avsmeter and x264 to open .avs scripts. May some solution exist to load avisynth.dll in user mode at Win11 at the opening of .avs file ? As I see the calling module can easily load avisynth.dll from current working directory instead of Win folders so it is not a problem. But it looks some despatcher needed from Windows to connect .avs files with avisynth.dll and it is registered in registry (and require UAC high level to enter data into registry).
The only found user-mode solution here is attempt to use avs2yuv to feed to ffmpeg (as x264 encoder) or may be x264 (if compiled with support of such inputs ?). May be some new tools exist in 202x years to solve the question better ?
Avspmod loads avisynth.dll directly to make .avs file playback at script editing/previewing so can replace VirtualDub.
Avsmeter64 loads avisynth.dll directly and can be used to test performance.
VoodooFX
1st December 2025, 14:20
Add avs folder to PATH env. You'll need to load plugins in the script.
DTL
1st December 2025, 14:23
My scripts are typically very simple and I add all required plugins to the current working directory and load manually via LoadPlugin(). Even 'complex' QTGMC() scripts can be used in this way with all required plugins collected.
The last still not tested is MPEG encoding - will ffmpeg.exe or x264.exe load avisynth.dll from the current working directory if .avs file at the input ? Or maybe special builds exist ?
real.finder
1st December 2025, 22:57
Is it possible to use AVS+ at Win11 in compleltely 'portable' mode (without changes to registry) ?
will ffmpeg.exe or x264.exe load avisynth.dll from the current working directory if .avs file at the input ? Or maybe special builds exist ?
yes, many tools and encoders like x264 can load avisynth.dll if it in the same directory/folder with x264.exe
you can even do load a plugin folder in avs+ with the encoding script (.avs) itself
DTL
2nd December 2025, 10:59
"many tools and encoders like x264 can load avisynth.dll if it in the same directory/folder with x264.exe"
I mean will it loads if .avs file type is not registered in Win registry ? If it is registered it may be loaded by windows .dll loader simply by the .dll search order starting from current working directory. But the nice application must understand .avs input file type without windows registry and either load avisynth.dll to handle this type or even load and init script environment to dispatch script (?).
As I see avspmod attempt to load avisynth.dll and process script internally. Even if .avs file type and avisynth.dll handler is not registered. Looks like the same with avsmeter. But VirtualDub can not (?).
Also 'nice application' if trying to load avisynth.dll as library may load file from all possible .dll search paths (current working directory and all PATH environment variable folders and system paths ?).
real.finder
2nd December 2025, 15:45
I mean will it loads if .avs file type is not registered in Win registry ?
yes
Also 'nice application' if trying to load avisynth.dll as library may load file from all possible .dll search paths (current working directory and all PATH environment variable folders and system paths ?).
it will load any needed dll (even the one from vcredist) from current working directory
this program made by my friend (I helped him in ideas not the code) https://github.com/animefn/ABST is fully portable and use avs portably
hellgauss
11th May 2026, 17:21
I've tested a simple script with ffmpeg and avisynth+ on a clean windows11 sandbox
In order to load .avs with ffmpeg you need avisynth.dll and also msvcp140.dll vcruntime140.dll and vcruntime140_1.dll in the same ffmpeg working dir.
Loadplugin inside the script.avs must be relative to the script path.
StainlessS
11th May 2026, 20:31
Loadplugin inside the script.avs must me relative to the script path.
I assume FullPath is also acceptable. [DriveLetter + ":\" + Path + "\" + dll_Name]
hellgauss
12th May 2026, 01:27
Yes it is ok too, but in a portable enviroment it is better to use a relative path.
StainlessS
12th May 2026, 10:22
but in a portable enviroment it is better to use a relative path.
Yep, I guess so. :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.