View Single Post
Old 21st December 2015, 16:50   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Kypec,
In your first script, could add to end
Code:
    ForceProcessAVI()  # Forcibly write AVI
    Return MessageClip("DONE")
Instead of calling AVSMeter (I guess you have used it that way since old v1.0 TWriteAVI).
ForceProcessAVI should be about same speed as AVSMeter, maybe a bit faster (a very tiny bit not really worth mentioning).

Before the above return MessageClip("DONE"),
Could insert code to create AVS and BAT files, avs to use avisynth to open the lossless file, and batch file that hands the avs as argument
to Simple x264 launcher.
Demo of creating any kind of script/bat file here:- http://forum.doom9.org/showthread.ph...52#post1749752

Some functions that may assist in your task
Code:
RT_FilenameSplit(string filename,int "get"=15)
 Splits the un-named filename string into component parts selected by 'get' bit flags arg and returns the
 parts joined together.
 'Get' (default 15, 1 -> 15), If set, Bit 0=DRIVE, 1=Dir, 2=Name, 4=Extension.
 Add 1 for Drive (bit 0), add 2 for Dir (bit 1), add 4 for Name (bit 2), add 8 for Extension (bit 3).
 Some combinations do not make sense, eg Drive + Extension (1+8=9). Below sensible options.
   1  = Drive (includes trailing ':')
   2  = Dir (includes trailing '\')
   3  = Drive + Dir
   4  = Name
   6  = Dir + Name
   7  = Drive + Dir + Name
   8  = Extension (includes leading '.')
   12 = Name + Extension
   14 = Dir + Name + Extension
   15 = Drive + Dir + Name + Extension
 Assuming a current working directory of eg "D:\avs\avi\", 'filename'="test.avi" and 'get'=15, returns "D:\avs\avi\test.avi",
 so given a relative filename and default 'get'=15, is equivalent to RT_GetFullPathName(filename).

***
***
***

RT_GetFullPathName(string "name")
 Creates an absolute or full path name for the specified relative path 'name'.
  eg 'RT_GetFullPathName("test.avs")' might return "D:\avs\test.avs".
 Throws and error if cannot return path.

***
***
***

RT_GetFileExtension(string s)
 Returns filename extension from the supplied filename, including '.' prefix.

RT_StrReplace(string source,string find,string replace,bool "sig"=True) # Based on Algorithm by Vampiredom, Gavino & IanB.
 String args 'source', 'find' and 'replace' unnamed and compulsory.
 Takes a source string, searches for all occurences of find string and replaces the found strings with the replace string.
 Can use "" in replace string (only in replace) to delete the found substrings from the source string.
 Newlines are treated no differently to other characters, and could be replaced/deleted.
 v1.14, added 'sig' arg,default true is Case Significant (as previous version). Set false for case insignificant find string.

RT_StrReplaceMulti(string source,string find,string replace,bool "sig"=True)
 String args 'source', 'find' and 'replace' unnamed and compulsory.
 Takes a source string, searches for all occurences of find substrings and replaces the found substrings with the replace substrings.
 Find string and Replace string are both multiline [Chr(10) separated] strings, both of n lines where find[i] and replace[i]
 are matched pairs, ie the first line of a multiline find is replaced by the first line of a multiline replace, etc.
 Can use "" in replace string (only in replace) to delete the found substrings from the source string.
 Differs from RT_StrReplace, in that both find and replace strings are multiline strings and MUST match in number of lines.
 Cannot use either carriage return [Chr(13)] or newline [Chr(10)] in find or replace as these are interpreted as end of current line,
 you would need to use RT_StrReplace() instead.
  eg S=RT_StrReplaceMulti("THE cat SAT.","SAT"+Chr(10)+"THE","sat"+Chr(10)+"The") produces "The cat sat.".
 v1.14, added 'sig' arg,default true is Case Significant (as previous version). Set false for case insignificant find string.

***
***
***

RT_QuoteStr(string)
 Non-clip function.
 Encloses supplied string arg in double quotes, Use on filenames containing spaces.
 Do NOT use with eg RT_FileDelete, only on filenames sent to a DOS command.

RT_WriteFile(String FileName, string format,dat1,...,datn,bool "Append"=False)
 Writes  a formatted string to FileName file. The unnamed 'format' string and optional unnamed 'dat' args are used to construct the
 text string that is written, uses C/CPP printf() style formatting.
 Format: compulsory string controlling format and describing the datn type args that are expected.
 datn: Variable number of data args of any type (excluding clip).
 Append, Default False, optional and MUST be supplied with name (eg Append=True) as we do not know where optional data args end,
 Appends to file if already exists, else opens new FileName.
OMITTED A lot more RT_WriteFile stuff.
EDIT:
Quote:
to feed Avisynth output directly to x264 encoder doing first pass
I'll try knock something simple up which you can mod to suit.
__________________
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; 21st December 2015 at 17:27.
StainlessS is offline   Reply With Quote