Log in

View Full Version : Getting the input file name (not the avs file)


Atlantis
12th February 2014, 13:57
I have an <input> line in an avisynth megui script that adds these 2 lines for my mpeg2 files

LoadPlugin("xxxxxxxxx\DGDecode.dll")
DGDecode_mpeg2source("xxxxxxx\video.d2v")

Later in my script I use tfm with d2v

tfm(d2v="xxxxxxx\video.d2v")

I want to automate this. If I could get the full name of the input file "xxxxxxx\video.d2v" and pass it to tfm automatically, it would be great.

I did a search and all I found was functions to get the current avs script name not the input file.

If its not possible to return the name of the currently opened input file, any other way I cant automate this process in megui?

osgZach
12th February 2014, 14:53
Those are likely internal variables specific to MeGUI, so you'd have to find a way to get it to tell you, identify/read the memory address, or something like that.

When you specify a file to open, or create an AVS scripte / index a file etc, MeGUI knowns the filename since it is loading the file, and then it swaps it with the <xxx> placeholders in its template format.

Atlantis
12th February 2014, 15:07
Forget MeGUI for a second. Let's imagine we are not using MeGUI. Can you get the filename of an opened file in an avs script? Or once you open a file in an avs script, its name is lost?

TurboPascal7
12th February 2014, 15:11
Forget MeGUI for a second. Let's imagine we are not using MeGUI. Can you get the filename of an opened file in an avs script? Or once you open a file in an avs script, its name is lost?

http://forum.doom9.org/showthread.php?t=170042
tl;dr - you can't.

Atlantis
12th February 2014, 15:25
Ok, thanks. Then I should try MeGUI side to do something I guess.

hello_hello
12th February 2014, 16:46
You could do it with AviSynthesizer (http://tangentsoft.net/video/asynther/) (create a template) but it can't be incorporated into MeGUI's script creating as such. You'd need to manually copy and paste. If only MeGUI's script creator could create templates which were a little more clever and use the file name as a variable as AviSynthesizer does. Maybe you could put in a request in the MeGUI thread? MeGUI obviously uses the name of the index file in the script anyway, it just needs to let you use it specifically (or even the source file's name too) elsewhere in a script.
You could at least put this in a MeGUI template:

tfm(d2v=".d2v")

Then copy and paste the name of the file from the input section of the script.

Did you try any of the scripts I posted in your QTGMC/TFM thread? If you did I'm curious as to whether it fixed the combing without blurring as much as the other methods you tried.

StainlessS
12th February 2014, 17:21
Suggest this mod rather than original Avisynthesizer (which has problems)
http://forum.doom9.org/showthread.php?t=166820&highlight=avisynthesizer

EDIT:
Atlantis, I saw your post on MeGUI AutoEncode, if you might be using Avisynthesizer_MOD, then you may also be
interested in MeGUI AutoEncode Batcher, see here:
http://forum.doom9.org/showthread.php?t=163343&highlight=MeGUI+AutoEncode+Batcher
there is also a DGIndex Batcher which can be used to create AVS files from within DGIndex (using DGIndex template), here:
http://forum.doom9.org/showthread.php?p=1543507#post1543507

Atlantis
12th February 2014, 21:20
Thanks for the Avisynthesizer suggestion. It helps alot. There is one problem. Can't you select several video files and sendto Avisynthesizer? I did it but it only creates one avs file.

Since it's about automation, it would help a lot if you could do that on several files.

In my steps I still have to generate a second avs from the first avs because of cropping. I want to check the cropping in MeGUI by eye for each file so there is no surprise later.

I tried DGIndex Batcher but it doesn't create the files in the source directory. It asks for a folder. And the AutoEncode Batcher I am not sure if it will help me. I have my videos each in its own folder with extracted audio, subtitle and chapters. Not sure if AutoEncode batcher can do all that.

I will report about my script in the original topic later. I have been very happy with it. It's bullet proof and I'm sure what comes out is correct. When you have 250 files for a series, it is not realistic, possible to inspect frame by frame each episode and apply different scripts.

hello_hello
13th February 2014, 16:08
[QUOTE=StainlessS;1667698]Suggest this mod rather than original Avisynthesizer (which has problems)
http://forum.doom9.org/showthread.php?t=166820&highlight=avisynthesizer

I replaced the original with your mod version. Thanks!

The RoboSplice template..... There's an avis file I should be putting in the plugins directory? I guess I'm too silly to find it.

hello_hello
13th February 2014, 16:13
Thanks for the Avisynthesizer suggestion. It helps alot. There is one problem. Can't you select several video files and sendto Avisynthesizer? I did it but it only creates one avs file.

Since it's about automation, it would help a lot if you could do that on several files.

When you do that it combines the individual files into a single script/encode. I don't think there's a way to send multiple files to Avisynthesizer in order to create multiple, individual scripts. I've not really needed that myself.

I will report about my script in the original topic later. I have been very happy with it. It's bullet proof and I'm sure what comes out is correct. When you have 250 files for a series, it is not realistic, possible to inspect frame by frame each episode and apply different scripts.

The second script I posted should de-interlace every frame after IVTC. I'd be interested to see how different the result is from the way you're doing it. Anyway.... that's a topic for the other thread.

StainlessS
13th February 2014, 16:38
I don't think there's a way to send multiple files to Avisynthesizer in order to create multiple, individual scripts.

Yep, dats wot I tink two.
I think it puts up a warning when ___FILE___ line not [] enclosed, saying additional filenames will be skipped.

I was thinking that I might try to have it create multiple avs files
if template ___FILE___ line not [] enclosed, but dont know if I understand the code well enough to do that (I'm not a windows progger).

The "RoboSplice.avsi" files are not included anywhere, I was just explaining why I added the ___FILECNT__ thing.
I'll post the avsi's in Avisynthesizer_MOD thread, but they still aint anywhere near finished (I do use them but only on AVI's)

EDIT: Have now added Batch Mode

20 Feb 2014, Added Batch AVS creation mode.
If template has a repeating section {enclosed in square brackets eg [AviSource("___FILE___")]} then will
use the standard mode, creating a single file with multiple sources concatenated.
If template DOES NOT have a repeating section {not enclosed in square backets eg AviSource("___FILE___")}
then will create multiple AVS files, one for each source file.

here:-
http://forum.doom9.org/showthread.php?t=166820