View Full Version : How to use avs script to stop encoding early
1loser
21st January 2003, 06:45
Have you ever started an encoding with Cinema craft, with let's say 4 passes, and than after several hours you wish you would have chosen 3 passes instead. Well I'm not sure if there's a right way to do this but I just discovered a way to do it, at least it works on my Athlon. You can make a test with a very short clip by using the trim command in an avs script.
mpeg2source("movie title.d2v")
trim(1000,3000)# this will give you about a 60 sec clip.
In the above example the pass #0, which creates the vaf file, will be about 2000 frames. If you select 4 passes than it will start again showing 8000 frames. Now place any avs script inside the plugin directory ***(important to do so at the right time)***. In this case we want to change the passes from 4 to 3, so 2 x 2000 frames = 4000 frames. I would say at about 4100 frames would be a good time to do this. When it gets to frame 6000 it will stop with an error. This way you just complete 3 passes and now you can finish with muxing.
The avs script you put in the plugin directory can be the actual script you are using for encoding OR just one letter inside a script should work.
When you installed avisynth ver 2.07 (for example) it puts a key in the registry like below.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
"plugindir"="C:\\Program Files\\AviSynth2\\plugins"
@="C:\\Program Files\\AviSynth2"
If this key is not in your registry than maybe it won't work.
Please let me know if this works OR if there is a better way to do this.
scmccarthy
21st January 2003, 07:58
I think what you are experiencing is that you cannot put avs files in the plugin directory, it the plugins are auto loaded from there.
So it only works for a version of AviSynth that has autoloading enabled.
Stephen
1loser
15th February 2003, 04:06
I recently did a fresh install of XP and now when I put an avs file in the plugin directory it doesn't allow me to stop the encoding process early. The encoding was going very slow since I used several filters for noise and smoothing and wanted to change the number of passes from 3 to 2 but this little trick doesn't work anymore. :mad:
Wilbert
15th February 2003, 12:14
If you are using v2.5 you should rename to *.avsi, so that it will be loaded automatically.
scmccarthy
15th February 2003, 18:42
If you are using v2.5 you should rename to *.avsi, so that it will be loaded automatically. Oh, my goodness, that is so tricky! I assume that is something new with 2.5beta.
Stephen
1loser
18th February 2003, 04:23
I'm using avisynth ver 2.07. I'm not sure if you understand or maybe I'm just confused from the last two responses. Placing a avs script in the plugin directory use to stop the encoding at the end of whatever pass it was on but now it doesn't work anymore. It could be because I was loading the plugins in the avs script referencing a different folder where I keep the plugins. At one time I had the plugins in both places at the same time. I recently became aware that I didn't need to load the plugins if they are in the plugin directory when using ver 2.06 and 2.07.
Richard Berg
18th February 2003, 04:42
Wouldn't it be easiest just to kill the process?
@scmccarthy - yes, for the beta it changed to a new extension for "avisynth includes." Previously, a common complaint from people was inability to run Avisynth because (knowingly or not -- many plugins provide *.avs files) they had AVS files in their autoload directory that weren't wrapped in functions and thus confused the parser.
scmccarthy
18th February 2003, 16:17
@1loser
I had assumed you understood that putting an avi file in the plugin directory 'kills the process' because of the autoload feature. When it tries to load the avi file as a plugin, it crashes.
The reason it worked for you is that it crashs avisynth before it starts the next pass, after it completes the current one. So the answer to why not just kill the process is that the way you've been doing it times the crash between passes. Just what you want. In principle, however, you are relying on a bug in AviSynth's new autoloading feature. You shouldn't be surprised if it gets fixed.
I thought you knew about the autoload feature, since you were relying on it. Anything that will mess up AviSynth when it tries to reload the plugins will work. How about putting an avisynth 2.5 plugin in the 2.07 plugin folder instead of the avi?
Come to think of it, I have one more idea if that does not work, but you'll have to ask, otherwise I'll just be sitting here spinning out ideas and wasting everyone's time.
Stephen
1loser
19th February 2003, 00:50
Originally posted by scmccarthy
I had assumed you understood that putting an avi file in the plugin directory 'kills the process' because of the autoload feature. When it tries to load the avi file as a plugin, it crashes.Stephen I learned this one day by mistake but thought it would be handy to take advantage of this bug. I put an avs file in the plugin directory(I guess that's the same as avi file).
Originally posted by scmccarthy
The reason it worked for you is that it crashs avisynth before it starts the next pass, after it completes the current one. So the answer to why not just kill the process is that the way you've been doing it times the crash between passes. Just what you want. In principle, however, you are relying on a bug in AviSynth's new autoloading feature.Exactly !!!
Originally posted by scmccarthy
I thought you knew about the autoload feature, since you were relying on it. Anything that will mess up AviSynth when it tries to reload the plugins will work. How about putting an avisynth 2.5 plugin in the 2.07 plugin folder instead of the avi?I was using avisynth version 2.06 for several months before I realized I didn't need to load the plugins in my script. I don't know anything about ver 2.5 at the moment but I guess I could try putting a 2.5 plugin in the plugin directory at the right time to cause avisynth to stop early.
Originally posted by scmccarthy
Come to think of it, I have one more idea if that does not work, but you'll have to ask, otherwise I'll just be sitting here spinning out ideas and wasting everyone's time.
Stephen I would be interested in knowing a better way to cause my encoding to stop at the end of the pass it is currently on. Infact maybe something should be added as a feature instead of a bug.
scmccarthy
19th February 2003, 05:31
I would be interested in knowing a better way Oh, I'd say something if I thought I had a better way. Just let me know if it works.
Stephen
scmccarthy
19th February 2003, 05:44
OK. OK. My idea is harder than I thought it would be, I probably can't do it.
I thought it would be cool to have a shutdown plugin that has a switch in it that can be changed after it is loaded. A plugin that has its own applet....
*thinking*
OK, it is easier than I thought, the avisript can be edited during a pass. So, put shutdown as the first filter in the script and uncomment it during the last pass. Anyway, stick to what works. I am not sure what will work or what you will find best.
Stephen
1loser
22nd February 2003, 18:21
Originally posted by scmccarthy
OK, it is easier than I thought, the avisript can be edited during a pass. So, put shutdown as the first filter in the script and uncomment it during the last pass.
Stephen This didn't work, the encoding speed increased which means there's a problem.
scmccarthy
23rd February 2003, 05:18
When I use VirtualDub, the script can be deleted after it is opened and it would still be used.
Stephen
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.