View Full Version : portable avisynth?


smok3
31st January 2007, 11:15
is there a way to do a portable avisynth package? (like i want everything on an usb key and no (or minimum) system changes should be made.)

Terka
31st January 2007, 13:00
great idea !

Mug Funky
2nd February 2007, 05:11
i second this idea.

Pookie
2nd February 2007, 06:34
What about the registry entry that points to the default plugin location ? I wonder if Avisynth will complain if that entry doesn't exist...
Sounds like we'll know pretty soon. Best of luck.

smok3
2nd February 2007, 09:08
i guess it should go like:
1. temporarily unistall original avisynth (if there) and notice the user what version was there maybe
2. 'install' the mobile version - and use user determined default plugin folder
3. on reboot (or some other event) check if the mobile device (well not a device, but the location itself) is still present.
3b. if yes - do nothing
3c. in no - uninstall mobile version & install/register old one if there was one before.
... but iam no coder so this is probably naive?

Pookie
2nd February 2007, 10:02
There's a handful of tools which may be of use:

DependencyWalker http://www.dependencywalker.com/
Regmon by sysinternals.com http://www.snapfiles.com/download/dlregmon.html
Filemon by sysinternals.com
WhatChanged.exe http://www.portablefreeware.com/download.php?id=634
Regshot http://regshot.blog.googlepages.com/regshot.html

squid_80
2nd February 2007, 14:20
What about the registry entry that points to the default plugin location ? I wonder if Avisynth will complain if that entry doesn't exist...
It doesn't complain, it just doesn't auto-load anything.

Guest
2nd February 2007, 14:43
What is the point of all this?

IanB
3rd February 2007, 01:23
At a guess, to access Avisynth on a locked SOE environment PC that won't let you install anything. :sly:

The show stopper with doing this will be adding the registry keys for the AVI layer intercept. This part of the registry is usually read only on such crippled environments.

I beleive these would be the required keysHKCR "CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" "" "AviSynth"
HKCR "CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" "" "AviSynth.dll"
HKCR "CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" "ThreadingModel" "Apartment"
HKCR "Media Type\Extensions\.avs" "" ""
HKCR "Media Type\Extensions\.avs" "Source Filter" "{D3588AB0-0781-11CE-B03A-0020AF0BA770}"
HKCR "avifile\Extensions\AVS" "" "{E6D6B700-124D-11D4-86F3-DB80AFD98778}"In the 2nd line use the full path to the usb stick drive avisynth.dll

Guest
3rd February 2007, 01:28
At a guess, to access Avisynth on a locked SOE environment PC that won't let you install anything. :sly: And you just happen to have all the other video/audio/encoding stuff you need already installed!?

ilovejedd
3rd February 2007, 04:33
If you're using command line only utilities, then no need to install. You can just run them from a portable mass storage device. Besides, there are some programs that do not require installation, VirtualDub being one. Although there is the matter of vfw codecs. Most systems should have an mpeg2 decoder and there's DGIndex so manipulating mpeg2 files and already decrypted vob files should be easy enough. XviD, x264 will, quite possibly, pose a problem.

Pookie
3rd February 2007, 08:32
X264.exe and Mencoder.exe can take care of that. The difficult to solve one is in Ian B's post. No biggie if you had registry write access - you could add it for the session, then auto remove it when you pull the thumb drive.

I have no idea how WINE works, but perhaps the installation routine of Avisynth on that platform might provide some insight?

smok3
26th March 2007, 20:30
IanB: tnx will try. (the practical problem will be an yv12 splitter, if the system doesnt have one installed i imagine...?). Well, in any case i guess the admin access will be needed.

edit: this *.reg is not working:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}]
@="AviSynth"

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32]
@="T:\utility\avisynth\avisynth.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
@=""
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"

[HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS]
@="{E6D6B700-124D-11D4-86F3-DB80AFD98778}"

any ideas what iam missing? edit: see my next post, where i answer myself:

smok3
26th March 2007, 22:56
mkay, i think i got everything working now, if my portable root avisynth directory is for example:
t:\utility\avisynth\
then the full *.reg script would be (you can skip the plugin dir, but no less):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}]
@="AviSynth"

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32]
@="T:\\utility\\avisynth\\AviSynth.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
@=""
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"

[HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS]
@="{E6D6B700-124D-11D4-86F3-DB80AFD98778}"

[HKEY_CLASSES_ROOT\avs_auto_file]
@="AviSynth Autoload Script"

[HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[HKEY_CLASSES_ROOT\avsfile]
@="AviSynth Script"

[HKEY_CLASSES_ROOT\avsfile\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"plugindir2_5"="T:\\utility\\avisynth\\plugins"

also there must be devil.dll in the same dir as avisynth.dll (and maybe even msvcp60.dll).

to 'unistall' use the same script with lil - simbols, like:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}]
@="AviSynth"

[-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32]
@="T:\\utility\\avisynth\\AviSynth.dll"
"ThreadingModel"="Apartment"

[-HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
@=""
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"

[-HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS]
@="{E6D6B700-124D-11D4-86F3-DB80AFD98778}"

[-HKEY_CLASSES_ROOT\avs_auto_file]
@="AviSynth Autoload Script"

[-HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[-HKEY_CLASSES_ROOT\avsfile]
@="AviSynth Script"

[-HKEY_CLASSES_ROOT\avsfile\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[-HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"plugindir2_5"="T:\\utility\\avisynth\\plugins"

the avisynth i used is 2.5.7, rc3, md5:
76bb8e202d1bb66710779b9ce2292d64 *AviSynth_311206.exe

edit: warning, this reg files will kill any allready installed avisynth version, so you will have to reinstall.

edit2: your portable dir should look like in this illustration:
T:\utility\avisynth\plugins\
T:\utility\avisynth\Docs\
T:\utility\avisynth\Examples\
T:\utility\avisynth\avisynthOFF.reg
T:\utility\avisynth\avisynthON.reg
T:\utility\avisynth\avisynth.dll
T:\utility\avisynth\devil.dll
T:\utility\avisynth\msvcp60.dll

chipzoller
18th April 2007, 21:13
Has anyone confirmed this is a working avisynth environment in vivo?

smok3
18th April 2007, 22:19
for me it is working fine on 3 different win32, xp systems (but i did not try any other win flavor..)

p.s. slight problem was only with HC encoder, which requires to find the dll files on system32 for some reason (prog dir is not working either...)

chipzoller
2nd May 2007, 22:45
@smok3
Have you considered making an install package for this? This, in my opinion, would be a very attractive package for anyone looking to create a portable avisynth.

smok3
4th May 2007, 16:28
chipzoller, not tested enough, also my avisynth knowhow is way to low to even suggest that this is the good way to do things, anyway i think the portability of incoming versions is up to the real devs.

vlada
3rd March 2008, 16:26
Hi,

I tried this unfortunately I cannot write to HKEY_CLASSES_ROOT\CLSID\. Is there any workaround for this?

dimzon
3rd March 2008, 17:31
Actually some software (like BeHappy/MeGUI) use avithink via special wrapper so you doesn't need to register it as COM component. To avoid dll hell you can hexedit avisynth.dll and change the name of registry keys (and use direct LoadPlugin instead). In this way is possible to create software wich can redistribute with it's own Avisynth/plugin versions and doesn't mess already installed versions...

sh0dan
3rd March 2008, 19:52
AviSynth doesn't require registry keys as such - it just won't autoload plugins.

IanB
3rd March 2008, 21:57
The HKEY_LOCAL_MACHINE\Software\Avisynth\PluginDir2_5 key is what defines where to autoload plugins, it is not needed apart from this. So you have to manually load all your plugins with out it.

Adding keys to HKEY_CLASSES_ROOT\CLSID\ is what lets applications load .AVS files thru the AviFile interface as used with .AVI files. This is the main show stopper.

To just use Avisynth via the C or C++ API's like MeGui and HC do you just need to make Avisynth.dll available to the application, (putting it in the directory with the applications .EXE is sufficient).

smok3
4th March 2008, 08:49
i did a full 'portable' distro some time ago btw, if somebody wants to play around;
http://somestuff.org/downloads/portable_avisynth/portable_avisynth.7z
(based on 2.5.7 irc)

use at your own risk.

IanB
4th March 2008, 10:07
Okay this appears similar to doing an install to T:\utility\avisynth\. Differences are 3 .DLL's are put in this directory and not put in the windows system directory and registry updating is not automatic, there are 2 .REG files provided to load the relevant values. These still require write access to the appropriate parts of the registry. So crippled SOE environments are still screwed.

AvisynthON.regWindows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}]
@="AviSynth"

[HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32]
@="T:\\utility\\avisynth\\AviSynth.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
@=""
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"

[HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS]
@="{E6D6B700-124D-11D4-86F3-DB80AFD98778}"

[HKEY_CLASSES_ROOT\avs_auto_file]
@="AviSynth Autoload Script"

[HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[HKEY_CLASSES_ROOT\avsfile]
@="AviSynth Script"

[HKEY_CLASSES_ROOT\avsfile\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"plugindir2_5"="T:\\utility\\avisynth\\plugins"


AvisynthOFF.regWindows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}]
@="AviSynth"

[-HKEY_CLASSES_ROOT\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32]
@="T:\\utility\\avisynth\\AviSynth.dll"
"ThreadingModel"="Apartment"

[-HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
@=""
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"

[-HKEY_CLASSES_ROOT\AVIFile\Extensions\AVS]
@="{E6D6B700-124D-11D4-86F3-DB80AFD98778}"

[-HKEY_CLASSES_ROOT\avs_auto_file]
@="AviSynth Autoload Script"

[-HKEY_CLASSES_ROOT\avs_auto_file\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[-HKEY_CLASSES_ROOT\avsfile]
@="AviSynth Script"

[-HKEY_CLASSES_ROOT\avsfile\DefaultIcon]
@="T:\\utility\\avisynth\\AviSynth.dll,0"

[-HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"plugindir2_5"="T:\\utility\\avisynth\\plugins"

I could add these 2 scripts to the distribution and make an installer mode to drop the system .DLL's in the install directory for manual usage/copying.

But would this really be of benefit?

Thorts please....

chipzoller
4th March 2008, 15:00
Yes, please, IanB. I'd like to be able to test out avisynth filters on various machine setups without having to 'officially' install avisynth and all the filters. For me, my flash drive is my swiss army knife of video-related tools and having avisynth be one of them would essential.

dimzon
4th March 2008, 15:04
AviSynth doesn't require registry keys as such - it just won't autoload plugins.
Yes, but changing this key via hexeding local copy of avisynth.dll allow us to disable autoloading of all pluging from globally installed avisynth. It may be usefull to avoid any plugin version conflicts for applications like MeGUI.

IanB
4th March 2008, 21:53
...hexediting local copy of avisynth.2 easier choices :-

1. rename the plugin directory out of the way.

2. rename/delete the registry key/contents.

koolcracker
9th March 2008, 07:14
Could this be used to work AviSynth properly on a linux machine?

halsboss
16th March 2008, 00:52
Adding keys to HKEY_CLASSES_ROOT\CLSID\ is what lets applications load .AVS files thru the AviFile interface as used with .AVI files. This is the main show stopper.

Did I miss any suggestions/thoughts on resolving that one ? I suppose it means Vdub won't open an .AVS ?

... there is the matter of vfw codecs ... Most systems should have an mpeg2 decoder and there's DGIndex so manipulating mpeg2 files and already decrypted vob files should be easy enough. XviD, x264 will, quite possibly, pose a problem.
I assume this means "as input/decoder codecs" since command-line encoders like HC, FFMPEG and X264 don't appear to need them. Were there any suggestions to address that too - apart from DGindex and DGAVCIndex which I guess avoid the need for mpeg2 and mpeg4 codecs ? (does DGAVCIndex decode xvid ? :) )

squid_80
16th March 2008, 02:32
Did I miss any suggestions/thoughts on resolving that one ? I suppose it means Vdub won't open an .AVS ?

Possibly someone could write an input plugin for virtualdub that would use avisynth.dll directly to open avisynth scripts, rather than through the AVIFile interface.

halsboss
16th March 2008, 03:04
I would if I had the knowledge to do it :) Should I guess that the same issue arises with input to HC, ffmpeg, x264 ?

squid_80
16th March 2008, 06:17
HC is ok because it already uses avisynth directly. Only issue is that it seems to expect avisynth.dll to be in windows\system32 directory (see a few posts above).
X264 does use AVIFile but could easily be fixed. Or use avs2yuv to open the script and pipe data to x264.
Ffmpeg I don't know about.

halsboss
16th March 2008, 06:53
HC's good ... great !
avs2yuv to open the script and pipe data to x264. Well well... does anyone know if ffmpeg can accept piped input and how to do it ?

Pity about vdub and its dependency on encoder codecs and inability to open .avs in the context of this thread. Don't take that the wrong way, it's also its strength.

If I understand what was written, at least we know
(1) already-installed decoder codecs can be used fine in opening a video file in the .avs
(2) DGindex and DGAVCIndex can also help mitigate against unavailable codecs, and open mpeg2 and mpeg4 inside our .avs
(3) HC doesn't need special treatment, feed it an .avs and all's well
(4) with programs that "accept piping" then avs2yuv can be used to run .avs scripts and pipe the output to our desired program

That's also some way toward a combination of portable avisynth and the tools that use it to produce video files.

Cheers

Wilbert
16th March 2008, 13:53
Well well... does anyone know if ffmpeg can accept piped input and how to do it ?
Yes, but it's not necessary. See:

http://avisynth.org/mediawiki/FAQ_frameserving

vlada
17th March 2008, 09:37
halsboss
I think you are confusing codecs and DirectShow filters. MPEG-2 codec simply can't exist, because it is not exceptable for VfW. VfW codecs are used in video editors (VirtualDub, Avisynth, Vegas) to (de)compress AVI files. For other formats you can't use codecs instead you have to use DirectShow filters.

Back on topic...

I would be interested to make following things work without Avisynth installed:
1) x264.exe with AVS input. From what I understood, should be possible to workaround using avs2yuv.
2) xvid_encraw.exe - probably same as x264.
3) HC - should work, but probably needs an update to allow avisynth.dll placed somewhere else then in c:\windows\system32 directory
4) SoundOut plugin - I have no idea how to make it work

Input of different file formats to Avisynth shouldn't be a problem thanks to ffmpegsource, DGMPGDec and DGAVCDec.

smok3
17th March 2008, 10:06
seems like http://akuvian.org/src/avisynth/avs2yuv/ could indeed be a problem solver, my list of wanted apps would be:
virtualdub, HCenc (should be fine), x264, avs2avi.

halsboss
17th March 2008, 10:45
halsboss
I think you are confusing codecs and DirectShow filters. MPEG-2 codec simply can't exist, because it is not exceptable for VfW. VfW codecs are used in video editors (VirtualDub, Avisynth, Vegas) to (de)compress AVI files. For other formats you can't use codecs instead you have to use DirectShow filters.


Oh, OK. ffdshow "VFW codec configuration" contains a heap of items... AVI (de)compress only is noted for vfw, with "DirectShow Filters" for the rest including ffdshow's "Video decoder configuration" then, and sometimes in an addition a splitter like haali's is also required ? :thanks:

vlada
17th March 2008, 12:50
Well VfW and DirectShow are two parallel framewroks both created by Microsoft. VfW uses codecs and only supports AVI container.

DirectShow is used mainly for decompression (although encoders exist too). Basically all players use DirectShow to play video. To play any video, you need at least 6 filters (not codecs as many people think). The filters include a splitter (like Haali's), a video decoder (ffdshow) and an audio decoder (ffdshow). Some filters (like AVI or MPEG PS splitters) are distributed together with Windows, others can be downloaded separately. The 3 filters I didn't mention yet are also included usually with Windows. It is a source filter, video renderer and audio renderer. If you install DivX or XviD codec, it will also install a DirectShow decoder. That's why many people think they need codecs to play a video.

You can try switching on a and off support for different formats (or 4CCs) in ffdshow (VfW and Video Decoder) and use AviSource and DirectShowSource in Avisynth. You will find out, that if you disable certain format/codec in VfW ad there will be no other codec then ffdshow for it, you won't be able to open the video in VirtualDub or in Avisynth with AviSource. But you will still be able to open it with DirectShowSource or play the video in WMP until you also disable it in ffdshow video decoder.

I hope the explanation is clear, unfortunately my English isn't good enough. Also sorry for being off-topic again.

Leak
17th March 2008, 13:37
That's why many people think they need codecs to play a video.
Considering that the word "codec" is just an amalgamation of "(en-)coder" and "decoder" you need the "dec" part of a codec anyway for playback.

Also, any DirectShow filter that both comes with a DirectShow encoder and decoder filter by this definition *is* a codec - like ffdshow, for instance.

halsboss
17th March 2008, 14:08
Thankyou. I reckon this stuff is on-topic as it's what is needed to use portable avisynth... "no man is an island" applied to portable avisynth usage :) My $0.02c worth anyway.

Seems like portable avisynth use is "problematic" in terms of the type/nature of the input source file and codecs/filters which are pre-installed on a locked-down system and allow avisynth to open the source.

vlada
18th March 2008, 08:20
Leak
People tend to use the term "codec" for anything related to video compression and decompression. But I think it makes much more sense to call codec only the VfW ones, and call the rest DirectShow encoders and DirectShow decoders. They are usually different filters.

ffdshow can be used as a DirectShow encoder? I thought the encoder is only available through VfW.

halsboss
According to my experience you can't install (i.e. register) any VfW codec unless you're an administrator. But you can register DirectShow filters even as a user. Older versions of ffdshow worked with "user" account without any problems. In newer versions I think ffdshow writes it's settings to restricted parts of registries.

Anyway on all computers you can use ffmpegsource, which will open most of video files except of TS (Transport Streams). To open TS files you can use either DGMPGDec (MPEG-2) or DGAVCDec (MPEG-4). None of these programs/source filters need an installation. So opening/decoding almost any video on a crippled environment is not a problem.

Leak
18th March 2008, 11:31
Leak
ffdshow can be used as a DirectShow encoder? I thought the encoder is only available through VfW.
Yes, it can. Just look under "Video Compressors" in GraphEdit. :)

vlada
11th April 2008, 16:59
Hi,

I moved a little further. Now I'm able to do letterbox (cropping) detection without Avisynth installed. Sound conversion using SoundOut plugin works too. But I can't make video compression work.

I tried this commandline:
exe\avs2yuv.exe -raw "temp\video.avs" - | exe\xvid_encraw.exe -i - -type 2 -avi "video_out.avi" -max_bframes 2 -qpel -pass1 -qtype 1 -nopacked -progress 2 -stats

with this result:
http://img505.imageshack.us/img505/3023/avs2yuvre8.th.png (http://img505.imageshack.us/my.php?image=avs2yuvre8.png)

Then I tried a Mencoder example from AVS2YUV site:
exe\avs2yuv.exe -raw "temp\video.avs" - | exe\mencoder - -o "hfyu.avi" -ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-1:pred=2:context=1
This is the result:
http://img505.imageshack.us/img505/2091/avs2yuv2qd6.th.png (http://img505.imageshack.us/my.php?image=avs2yuv2qd6.png)

I tried AVS2YUV with and without the -raw function. The results are identical. What am I doing wrong? I do belie this is supposed to work...

squid_80
11th April 2008, 21:04
What does "Program se nevejde do pameti" mean in english?

smok3
11th April 2008, 21:07
has anyone tryed to do a 'thinstalled' version of avisynth + apps + vfw codecs, ect? is there even a chance that something like that may actually work? (not to include thinkering about that one would need a commercial app for this to work)

kumi
11th April 2008, 21:14
Thinstalled Avisynth works just fine, in my experience. I've never tried packaging codecs (VFW or otherwise), but I don't see why they wouldn't work.

vlada
11th April 2008, 21:16
What does "Program se nevejde do pameti" mean in english?

Sorry, I forgot to translate it. It means something like "The program won't fit in memory". Doesn't make to much sense...

smok3
Sorry, I don't understand exactly what you mean.

smok3
11th April 2008, 21:19
kumi: do you mean: it does work fine with specific codecs found on ones machine or..? (or for example how does a system 'installed' app like x264 and thinstalled avisynth work out?)

vlada: http://www.thinstall.com/ (it is about virtualization)

kumi
11th April 2008, 22:24
smok3: I'm not sure I understand. If you decide to bundle codecs into a Thinstall package, then those (and only those) will be virtualized. For example, if I bundle together Media Player Classic (MPC) and ffdshow into a Thinstall package, and I run this MPC on a system without ffdshow installed, the program will use the virtualized ffdshow. In fact, it will do so even if ffdshow is already installed on the system. Does that answer your question?

squid_80
12th April 2008, 05:05
Sorry, I forgot to translate it. It means something like "The program won't fit in memory". Doesn't make to much sense...

As far as I can tell you've got 2 different errors there... xvid_encraw just doesn't want to run, which is odd. Is xvidcore.dll and aviwriter.dll in the same directory as xvid_encraw.exe?
Mencoder looks like it's trying to read the format (container) of the data being piped from avs2yuv, is there a switch to tell it that the data is raw YV12 (or I420)?

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. :)