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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th January 2019, 00:02   #1  |  Link
zorr
Registered User
 
Join Date: Mar 2018
Posts: 447
Setting script's working directory

I have another question related to the AvisynthOptimizer port. When the optimizer tests a new set of parameters it creates a new script into a separate directory and runs it. In order to make relative paths work I change the script's working directory to the original directory where the script was located. In Avisynth this is done easily by using SetWorkingDir() at the beginning of the script.

In Python the working directory can be changed with os.chdir() but I noticed that it doesn't have effect inside the function which FrameEval is calling unless the os.chdir() is also there. Is this by design and can it be changed so that calling os.chdir() in the beginning of the script would make the change also effective inside FrameEval()? Or is there some other workaround to change the working directory for the whole script?
zorr is offline   Reply With Quote
Old 11th January 2019, 00:31   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Why not just pass an path argument to FrameEval?

Also possibly relevant for AvisynthOptimizer:
Quote:
Generally I don't recommend invoking filters within FrameEval unless unavoidable, because that introduces extra overhead.
See https://forum.doom9.org/showthread.p...01#post1841001
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 11th January 2019, 10:48   #3  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
I suspect you open and write a file or something. Open the file handle outside frameeval and pass it as an argument to the function or something. See the functools.partial example in the documentation.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th January 2019, 01:34   #4  |  Link
zorr
Registered User
 
Join Date: Mar 2018
Posts: 447
Quote:
Originally Posted by ChaosKing View Post
Why not just pass an path argument to FrameEval?
Yes that's certainly possible. I was just hoping that there would be a "cleaner" option.

Quote:
Originally Posted by ChaosKing View Post
Also possibly relevant for AvisynthOptimizer:
> Generally I don't recommend invoking filters within FrameEval unless unavoidable, because that introduces extra overhead.
That's good advice right there, luckily I don't need to invoke any filters, I only need to read the frame properties, measure time and store those into a file. And the writing is only done during the last frame so file I/O should not be a bottleneck.

Quote:
Originally Posted by Myrsloik View Post
I suspect you open and write a file or something. Open the file handle outside frameeval and pass it as an argument to the function or something. See the functools.partial example in the documentation.
Thanks, turns out I don't need to worry about the working directory inside FrameEval after all. The optimizer sets the output file using an absolute path and that will work just fine inside FrameEval. And while the working directory will be wrong inside FrameEval I think nobody wants to open any clips in there...

By the way the optimizer works with VapourSynth scripts now. I'm going to do an official release this weekend. Now the question is... what to call it when it's no longer Avisynth-specific. SynthOptimizer? MetaOptimizer? ZorrIsDaManOptimizer?
zorr is offline   Reply With Quote
Old 12th January 2019, 10:24   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ZorrIsDaManOptimizer, sounds pretty good, but, hows bout OptiSynth ?
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 12th January 2019, 10:37   #6  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by StainlessS View Post
ZorrIsDaManOptimizer, sounds pretty good, but, hows bout OptiSynth ?
+1 for OptiSynth. Or ZOptiSynth
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 12th January 2019, 11:26   #7  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
OptiSynth sounds cool.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 12th January 2019, 15:07   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OptiSynth also name for an engine oil, Vroom, Vroom !
__________________
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; 13th January 2019 at 15:35.
StainlessS is offline   Reply With Quote
Old 12th January 2019, 15:56   #9  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
The name can't be ending with -synth , it will confuse people
lansing is offline   Reply With Quote
Old 12th January 2019, 16:12   #10  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by lansing View Post
The name can't be ending with -synth , it will confuse people
Agreed.

I like this:
Quote:
Originally Posted by StainlessS View Post
Vroom
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 12th January 2019, 16:13   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by lansing View Post
The name can't be ending with -synth , it will confuse people
Dont be daft, aint nobody gonna try puttin' it in their engine.

EDIT: since seeing G2K4 comment, Maybe OptiVroom.
__________________
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; 12th January 2019 at 16:17.
StainlessS is offline   Reply With Quote
Old 12th January 2019, 16:22   #12  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Maybe OptiVroom.
Hm, sounds a bit like a household cleaning appliance.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 12th January 2019, 16:24   #13  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Zoptimizer?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 12th January 2019, 17:28   #14  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
I would start with the creator's initial followed by the name that best describe the script, something like ZoPluginOptimizer or ZoVSPluginOptimizer
lansing is offline   Reply With Quote
Old 12th January 2019, 21:59   #15  |  Link
zorr
Registered User
 
Join Date: Mar 2018
Posts: 447
Thanks for the name ideas guys! I agree that it shouldn't be a "synth", that's a category of its own and this little software doesn't deserve to be called that.

I think the "optimizer" should be part of the name since that's what it does. And what does it optimize? Well it doesn't optimize Avisynth or Vapoursynth so the original name is kinda wrong too. Lansing was closer with the "plugin" idea, but it really doesn't optimize plugins either. It optimizes scripts. So... ScriptOptimizer?

If we stick with original name format we could just replace AviSynth with something more general. It's just hard to come up with a word that would explain succinctly what it and Vapoursynth are... "frameserving tool for video manipulation"? Ok how about we take the common parts from both Avisynth and Vapoursynth and slap the optimizer in there as well. Something like XSynthOptimizer. Hey if I call it XXXSynthOptimizer it would crash the whole forum as there would be so much interest!

There's also another dilemma, where should I put the thread for this tool? I could make a new thread here for Vapoursynth related discussion and keep the original for Avisynth related things. Might be hard to know where to ask more general questions though.
zorr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.