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. |
16th July 2012, 21:07 | #61 | Link |
Registered User
Join Date: Aug 2008
Posts: 233
|
For ImageMagick usage, you could use ImageWriter() to write an image sequence, then perform ImageMagick filters on it via CALL25. Then, import the modified sequence for additional AviSynth processing. It may not be ideal, but it would work.
|
17th July 2012, 20:09 | #62 | Link | ||
Registered User
Join Date: Mar 2007
Posts: 407
|
Quote:
Quote:
Code:
function xCall(clip c, string "command") { c ConvertToRGB24() #for ImageWriter, ImageSource ScriptClip(""" Trim(current_frame, -1) #to fix filename to 000000 and make Call execute on all frames ImageWriter("C:\Temp\", 0, 0,type="tif") #no success with ebmp Call(command, "0") """, args="command", local=true, after_frame=true) ScriptClip(""" ImageSource("C:\Temp\000000.tif") """, after_frame=true) } Code:
function xCall(clip c, string "command") { c ConvertToRGB24() #for ImageWriter, ImageSource ScriptClip(""" Trim(current_frame, -1) #to fix filename to 000000 and make Call execute on all frames ImageWriter("C:\Temp\", 0, 0,type="tif") #no success with ebmp Call(command, "0") StackHorizontal(last,ImageSource("C:\Temp\000000.tif")).Crop(c.width,0,0,0) """, args="command") } Code:
xCall(last,"...somePath...\Mogrify -flip C:\Temp\000000.tif") it makes ImageMagick filters available to AviSynth scripts! http://www.imagemagick.org/script/co...ne-options.php (called 'options' there) ______ Last edited by martin53; 23rd September 2012 at 20:30. Reason: added optimized version |
||
3rd September 2012, 23:21 | #63 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
So you could use if(current_frame==Whatever){ # Assuming GScript run(...) } Anyway, here's an alternative to Run, RT_Call() implemented in RT_Stats plugin, Calls an executable at either compile time or in runtime script. http://forum.doom9.org/showthread.php?t=165479 EDIT: Quote:
__________________
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; 4th September 2012 at 00:45. |
||
23rd September 2012, 20:17 | #64 | Link | |
Registered User
Join Date: Mar 2007
Posts: 407
|
Quote:
|
|
27th September 2012, 07:56 | #65 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
@Martin53,
OK, Find CallCmd() v0.0 beta, source included here:- Link deleted, see post #69 Give it a whirl. Code:
CallCmd() by StainlessS, Based on Call by Nic. Outline by Nic from Call v1.3 -------------------------------------------------------------------------------- Call.dll v1.3:- http://forum.doom9.org/showthread.php?t=46506 Conceived by DDogg, thrown together badly by Nic To Use: LoadPlugin("D:\plugin\call.dll") Call("d:\besweet\besweet.exe -core( -input d:\matrix\matrix.ac3 -output d:\matrix\matrix.mp3 )", "0") This will do the command on frame 0 if you want to do things on multiple frames seperate with a comma or semicolon i.e. Call("d:\besweet\besweet.exe", "0,20,50") will do the call on frames 0, 20 and 50. Using the number -1 will make it do it on the very last frame! New Features !! : ---------------- 1) To get Call to operate before any encoding starts is to specify a clip and the frame number as -2 i.e. LoadPlugin("call.dll") Call(BlankClip, "lame --decode fatboy.mp3 fatboy.wav", "-2") WavSource("fatboy.wav") The above script will convert fatboy.mp3 into fatboy.wav and then load it :) (BlankClip is very useful here :) ) 2) If you need to put in " for long file names put in single quotes as apostrophes ' and that should now work. i.e. Call(BlankClip, "lame --decode 'e:\my rip dir\fatboy.mp3' fatboy.wav", "-2") 3) NicEcho can be used for outputting stuff. use as: Call(BlankClip, "d:\nicecho.exe d:\report.txt 'Hello world how are you?\nCarriage Return'", "-2") Remember the single quotes around the test! If you want to append to an already existing file prefix the file name with a @ i.e. Call(BlankClip, "d:\nicecho.exe @d:\report.txt 'Appending'", "-2") Notes: 1) REMEMBER THE QUOTES FOR THE SECOND PARAMETER (i.e. its not an integer input but a string!) 2) REMEMBER THAT THE PROGRAM YOUR CALLING MUST CLOSE ITSELF AFTER PROCESSING. OTHERWISE THE ENCODE WILL GET STUCK UNTIL YOU CLOSE IT MANUALLY! 3) REMEMBER TO PUT IN FULL PATHS TO YOUR PROGRAM. TO TEST YOUR PATH, GO START->RUN THEN TRY IT FROM THERE TO MAKE SURE IT WILL WORK. (sorry for the shouting, but I say it just to make you read it ;) ) -Nic PS CALL_25.dll is the AviSynth 2.5 version! :) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- CallCmd() by StainlessS CallCmd(clip,String Command, String Frames, bool "Hide"=false, bool "debug"=false) as well as explicit frame numbers in Frames string, can use -1 = Last frame. -2 = In constructor (before first frame). -3 = In Destructor (after last frame). Hide if true, hide console window. debug if true, sends debug info to DebugView Window. Does NO massaging of Command text string, ie does not replace single quotes with double quotes, was source of problems in Call(). Instead wrap eg filenames (EDIT: containing spaces) in quotes using perhaps: Function QuoteStr(String s) { return Chr(34) + s + Chr(34) } or use triple and single double-quotes eg CallCmd(BlankClip, """d:\nicecho.exe @d:\report.txt "Appending" """, "-2") ssS
__________________
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; 1st October 2012 at 02:53. |
28th September 2012, 08:36 | #66 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Additional to above:
I dont like the copy to and from clipboard idea, (sounds too ImageMagick specific) but, I could add an arg to frames eg "*" meaning DO ON EVERY FRAME (all other frame numbers being disallowed in frame string), and perhaps a positional insert/escape char in command, to insert a fixed number of digits corresponding to the frame number eg Code:
CallCmd(clip,"C:\PortableApps\ImageMagick\Mogrify.exe -flip C:\Temp\#.tif", "*",Hide=true,Debug=true,Insert="#",digits=6) Code:
"C:\PortableApps\ImageMagick\Mogrify.exe -flip C:\Temp\000000.tif" EDIT: From ImageReader in docs Code:
start = 0, end = 1000: Specifies the starting and ending numbers used for filename generation. The file corresponding to start is always frame 0 in the clip, the file corresponding to end is frame (end-start). The resulting clip has (end-start+1) frames. 'end=0' does NOT mean 'no upper bound' as with ImageWriter. The first file in the sequence, i.e., corresponding to 'start', MUST exist in order for clip parameters to be computed. Any missing files in the sequence are replaced with a blank frame. in the constructor, would be more of a problem if existence of ALL images ascertained in constructor.
__________________
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; 28th September 2012 at 15:03. |
29th September 2012, 12:47 | #67 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
@StainlessS,
thank you for your help! CallCmd works fine. To my opinion, an extension "*" is not needed, as anyone could either use it inside the RTE (like me), or with Animate(). At least it can wait until someone asks. I don't like the overhead of clipboard or temporary file either - but it is an easy way to start with, when someone wants to use ImageMagick features from AviSynth. This seems to be an exotic approach right now. If more people should want to do this, better interfaces can be made. You are right with the 'existence check' problem. I did not have it with earlier tests. Maybe I inadvertently had created that file. Proposed fix: add red code line. Code:
exist("C:\Temp\000000.tif") ? last : ImageWriter("C:\Temp\", 0, 0, type="tif") ScriptClip(""" c = last currentframe=current_frame Trim(current_frame, -1) ImageWriter("C:\Temp\", 0, 0, type="tif") CallCmd("C:\PortableApps\ImageMagick\Mogrify.exe -flip C:\Temp\000000.tif", "0",hide=true) StackHorizontal(last,ImageSource("C:\Temp\000000.tif").Crop(c.width,0,0,0) """, after_frame=true) Last edited by martin53; 29th September 2012 at 16:55. |
29th September 2012, 15:22 | #68 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Implemented as below: CallCmd(clip,String Command, String Frames,String "Insert"="",Int "Digits"=6,Bool "Once"=True,Int "Offset"=0,bool "Hide"=false,bool "Debug"=false) as well as explicit frame numbers in Frames string, can use -1 = Last frame. -2 = In constructor (before first frame). -3 = In Destructor (after last frame). Insert, Character which is replaced by frame number + Offset with at least Digits number of digits. Digits, Minimum number of digits in inserted text. Once, If true (default) then only executes command once on each frame, if replayed, does not exec 2nd time. Offset, Offset added to frame number when generating inserted text. Hide, If true, hide console window. Debug, If true, sends debug info to DebugView Window. Almost done, suffering crashes right now but probably just something silly to correct.
__________________
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; 1st October 2012 at 15:59. |
|
1st October 2012, 03:00 | #69 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Here 0.01beta CallCmd()
LINK REMOVED Code:
CallCmd() by StainlessS, Based on Call by Nic. Outline by Nic from Call v1.3 -------------------------------------------------------------------------------- Call.dll v1.3:- http://forum.doom9.org/showthread.php?t=46506 Conceived by DDogg, thrown together badly by Nic To Use: LoadPlugin("D:\plugin\call.dll") Call("d:\besweet\besweet.exe -core( -input d:\matrix\matrix.ac3 -output d:\matrix\matrix.mp3 )", "0") This will do the command on frame 0 if you want to do things on multiple frames seperate with a comma or semicolon i.e. Call("d:\besweet\besweet.exe", "0,20,50") will do the call on frames 0, 20 and 50. Using the number -1 will make it do it on the very last frame! New Features !! : ---------------- 1) To get Call to operate before any encoding starts is to specify a clip and the frame number as -2 i.e. LoadPlugin("call.dll") Call(BlankClip, "lame --decode fatboy.mp3 fatboy.wav", "-2") WavSource("fatboy.wav") The above script will convert fatboy.mp3 into fatboy.wav and then load it :) (BlankClip is very useful here :) ) 2) If you need to put in " for long file names put in single quotes as apostrophes ' and that should now work. i.e. Call(BlankClip, "lame --decode 'e:\my rip dir\fatboy.mp3' fatboy.wav", "-2") 3) NicEcho can be used for outputting stuff. use as: Call(BlankClip, "d:\nicecho.exe d:\report.txt 'Hello world how are you?\nCarriage Return'", "-2") Remember the single quotes around the test! If you want to append to an already existing file prefix the file name with a @ i.e. Call(BlankClip, "d:\nicecho.exe @d:\report.txt 'Appending'", "-2") Notes: 1) REMEMBER THE QUOTES FOR THE SECOND PARAMETER (i.e. its not an integer input but a string!) 2) REMEMBER THAT THE PROGRAM YOUR CALLING MUST CLOSE ITSELF AFTER PROCESSING. OTHERWISE THE ENCODE WILL GET STUCK UNTIL YOU CLOSE IT MANUALLY! 3) REMEMBER TO PUT IN FULL PATHS TO YOUR PROGRAM. TO TEST YOUR PATH, GO START->RUN THEN TRY IT FROM THERE TO MAKE SURE IT WILL WORK. (sorry for the shouting, but I say it just to make you read it ;) ) -Nic PS CALL_25.dll is the AviSynth 2.5 version! :) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- CallCmd() v1.01beta by StainlessS CallCmd(clip,String Command, String Frames,String "Insert"="",Int "Digits"=6,Bool "Once"=True,Int "Offset"=0,bool "Hide"=false,bool "Debug"=false) as well as explicit frame numbers in Frames string, can use -1 = Last frame. -2 = In constructor (before first frame). -3 = In Destructor (after last frame). * = DO ON EVERY FRAME (all other frame numbers being disallowed in frame string). Insert, Character which is replaced by frame number + Offset with at least Digits number of digits. If Insert character occurs in text then escape it by inserting two copies, OR, choose a different Insert character. Digits, Minimum number of digits in inserted text. Once, If true (default) then only executes command once on each frame, if replayed, does not exec 2nd time. Offset, Offset added to frame number when generating inserted text. Hide, If true, hide console window. Debug, If true, sends debug info to DebugView Window. --- Does NOT replace single quotes with double quotes in Command string, was source of problems in Call(). Instead wrap eg filenames containing spaces in quotes using perhaps: Function QuoteStr(String s) { return Chr(34) + s + Chr(34) } or use triple and single double-quotes eg CallCmd(BlankClip, """d:\nicecho.exe @d:\report.txt "Appending" """, "-2") --- CallCmd(clip,"C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\#.tif", "*",Insert="#",digits=6,Once=False,Offset=0,Hide=true,Debug=true) Executing on each playing, on every frame, hiding console window, sending debug info to debugview, and converting command string on frame eg 0 to "C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif" ssS Code:
ColorBars().ShowFrameNumber().ConvertToRGB24().Trim(0,99) # IM="C:\PortableApps\ImageMagick\Mogrify.exe" # ImageMagick Mogrify exe TMPDIR="C:\Temp\" # Output directory for images IMCMD = " -flop " # Image Magick Mogrify Command, Horizontal Flip (Or whatever). BASENAME="Test_" # Base name TYPE="tif" # Extension type # FRAMES="*" # All Frames INSERT="#" # Insert number where '#' occurs in Command, escape with '##' if '#' required OR change INSERT. DIGITS=6 # DONT CHANGE ONCE=False # MUST do every time as both ImageWriter and ImageSource called every time (default True) OFFSET=0 # DONT CHANGE HIDE=True # Hide Console DEBUG=True # Write debugging to DebugView # EXT="." + TYPE FIRSTNAME=MakePicName(TMPDIR+BASENAME,EXT,DIGITS,0) CMD= QuoteStr(IM) + IMCMD + QuoteStr(TMPDIR + BASENAME + INSERT + EXT) RD_NSTR = "%0"+String(DIGITS)+"d" RD_NAME=TMPDIR+BASENAME+RD_NSTR+EXT WID = Width # Remember orig width # --- # If not exist, Force Write of first image during compile time so that ImageSource will not fail. Result discarded #(Exist(FIRSTNAME)) ? NOP : ImageWriter(TMPDIR+BASENAME,0,-1, type=TYPE).Trim(0,-1).RT_AverageLuma(n=0,w=1,h=1) # EDIT: # Force Write of first image during compile time so that ImageSource will not fail. Result discarded # Already existing may not be correct size etc, so always force may be better than based on existing. ImageWriter(TMPDIR+BASENAME,0,-1, type=TYPE).Trim(0,-1).RT_AverageLuma(n=0,w=1,h=1) # -------------------------------- ImageWriter(TMPDIR+BASENAME,0,0, type=TYPE) CallCmd(CMD,FRAMES,insert=INSERT,digits=DIGITS,once=ONCE,offset=OFFSET,hide=HIDE,debug=DEBUG) # comment out to disable h-flip StackHorizontal(ImageSource(RD_NAME,0,FrameCount-1)) #Crop(WID,0,-0,-0) # Comment out to show input and h-flipped output side by side Return Last # -------------------------------- Function MakePicName(String BaseName,String Ext,int Digs,int n) {GScript(""" S=String(n) While(StrLen(s)<Digs) {S="0"+S} Return BaseName+S+Ext """)} Function QuoteStr(String s){Chr(34) + s + Chr(34)} Also uses RT_AverageLuma to force initial tif creation (samples single pixel, RGB->YUV-Y). Colored text edited.
__________________
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; 16th November 2013 at 15:04. |
1st October 2012, 15:26 | #70 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Would anyone mind if I modified from the original Call() spec for Frames specification?
Was thinking maybe only allow '';' SEMICOLON as a frame number separator with ',' COMMA being used to specify a range of frames, eg "10,20;55" being frames 10 to 20 and frame 55, and "0,0" replacing the '*' meaning ALL frames, and eg "100,-10" being frames 100 to 109. Anybody care ? EDIT: would probably need individual eg "DoConstructor" and "DoDestructor" type args so that -2 and -3 not misinterpreted, last frame -1, would need a little more thought, probably not needed if destructor call implemented.
__________________
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; 1st October 2012 at 18:20. |
3rd October 2012, 19:00 | #71 | Link | |
Registered User
Join Date: Mar 2007
Posts: 407
|
You are basically right about
Quote:
Now I have to ask a question where I feel very silly. There is always this discussion about how frames are calculated through the filter graph, and I think I remember that somewhere in the manual or so it is said that ImageWriter() is only executed if it is (in my words) in the filter graph. So, all functions that should do something not only during graph construction, must be a 'null transform' so to speak for the clip, to get their chance for doing something on each frame. You seem to use RT_AverageLuma to deal with that. Beginners question 1: Usually, we need to set current_frame beforehand. Is RT_AverageLuma safe to be used without that (so sorry if it's in the doc and I didn't read carefully)?Finally, I understand that you propose a solution without RTE. Of course I support that from the bottom of my heart. But because the new proposal writes a different file number for each frame, it spills the HD. I appreciate your approach to deal with ever changing file names with ImageMagick (btw I think RightStr("00000"+string(n),6) could replace the while loop), but I had two reasons for the RTE, and the more versatile Call(Frames="*") eliminates only one. Maybe ImmaAVS can make a constant file name, I didn't study that. Or, of course, a Call() can be added that deletes all obsolete files. But would that challenge the file system more, if files are added to and removed from the directory permanently? |
|
5th October 2012, 20:25 | #72 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
Attached, an alternative proposal that does without runtime environment and still uses only one file. I fall back on Animate() to do it
StainlessS, nice solution with RT_AverageLuma() (if I really understand it or not), I copied that. Hope you don't mind the script is not polished up with all user constants etc., it is meant as proof of concept. No doubt if someone processes his photo gallery, it may be very useful to execute Call() on every frame. |
6th October 2012, 16:43 | #73 | Link | |||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Firstly, sorry for not getting back sooner, I've had a nightmare couple of days, including but not limited to, personal injury, a trip to the
hospital, and no power for about 2.5 days (not related to the injury), all in all I've had a real **** time. (NO commiserations required, I'de rather just forget) Quote:
As well as a global compile stage, each iteration of scriptclip has a compile stage where filter constructors and functions returning ordinary (non-clip) variables are called in script sequence, the ordinary variables can be used as args to following constructors. During this time the graph is created. After all constructors and ordinary functions have been called (compile stage), then the graph is processed by calls to GetFrame, with each instance of GetFrame in the graph requesting a frame from the one before it. EDIT: During compile time graph creation phase, it is possible for a compile time function eg RT_AverageLuma OR eg current_frame=0 AverageLuma() to request frames from a partially existing graph where GetFrame's for filters already in the graph can be traversed. In this case, the constructor of ImageReader is called after the constructor to ImageWriter BUT, in the ImageReader constructor it creates the output VideoInfo using the already existing 1st frame, if there is no existing 1st frame, it puts an error message on the clip. During GetFrame (graph processing), If exists but size etc are wrong, then it will print an error message when the new frame (written by call to imagewriter GetFrame) is not the same as the wrong sized previously existing frame (mismatch with the VideoInfo), so the existing frame MUST be same as the expected result. Always forcing achieves this. EDIT: See edited text at end of post. RT_AverageLuma forces the ImageWriter plug to actually write the file even though the result of RT_AverageLuma is thrown away, it would be the same if you used standard AverageLuma whether or not the result is stored in a variable, you would need to set current_frame=0 AverageLuma(). For AverageLuma, current_frame is just a number conveniently set by the system (in RTE), RT_AverageLuma will use current_frame if 'n' is not supplied and current_frame is available (RTE). Only filters, (functions that return a clip) can be linked into the graph and if eg ImageWrite is not somehow used in final output (graph) then as no frames are requested from it, so no frames are produced by it, no images are written and the source to imagewrite has no frames requested from it. (I dont know for sure, but think that the constructor and destructor would still be called even though it's GetFrame would never be called). RT_AverageLuma requests a frame from the already existing sub graph in line "ImageWriter("C:\Temp\", 0, 0, type="tif").Trim(0,-1).RT_AverageLuma(n=0,w=1,h=1)" forcing ImageWriter to produce an image file. It does not matter that the return value is not used by subsequent filters, the function is called at compile time and does not require any request from a following filter. Any functions returning ordinary variables are always called irrespective of whether their return value is used. Concerning the forced write, there is no other effect on the incoming clip and does not interfere with other frames (assuming not using eg DirectShowSource with some sort of DirectShow auto eg IVTC where random requesting of frames could cause the ivtc etc to keep loosing track of where it was in the ivtc sequence, really NOT a good idea to use auto anything prior to avisynth. Someone using ExBlend wanted to know how to remove blending originating in DirectShow auto deinterlacing which was non-existant in the source. Just forcing frame zero to be called is unlikely to cause any problems, only random or out of sequence forcing frames might cause DirectShow internal filters to go nuts and the result would be quite obvious, video jumping about out of sequence, constantly for eg DS auto IVTC). Quote:
Have not really looked at the latest attachment too hard but suggest this rather than replace: Code:
Function StrReplace(string s,string find,string replace) # Repeated, string replacements # Original:- http://forum.doom9.org/showthread.php?t=147846&highlight=gscript By Vampiredom, Gavino, IanB #{i=s.FindStr(find)return(i==0?s: s.LeftStr(i-1)+replace+s.MidStr(Strlen(find)+i).StrReplace(find,replace))} # Converted to use RT_Stats RT_StrAddStr() to avoid 2.58/2.6a3 string concatenation bug:- {i=s.FindStr(find) return(i==0?s:RT_StrAddStr(s.LeftStr(i-1),replace,s.MidStr(Strlen(find)+i).StrReplace(find,replace)))} Code:
ColorBars().ShowFrameNumber().ConvertToRGB24().Trim(0,2) #Exist("C:\Temp\000000.tif") ? last : ImageWriter("C:\Temp\", 0, 0, type="tif") ImageWriter2("C:\Temp\", 0, 0, type="tif").Trim(0,-1).RT_AverageLuma(n=0,w=1,h=1) #BilinearResize(640,576) # Produces error message "StackHorizontal "Image Heights Dont Match" ScriptClip(""" Trim(current_frame,-1).ImageWriter2("C:\Temp\", 0, 0, type="tif") CallCmd("C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif","0",hide=True,debug=true) I=ImageSource2("C:\Temp\000000.tif") StackHorizontal(last,I).Crop(width,0,0,0) """) Code:
# Forced creation 00000005 22:11:12 ImageWriter2: Constructor 00000006 22:11:12 ImageWriter2: GetFrame(0) 00000007 22:11:12 ImageWriter2: Opening File C:\Temp\000000.tif 00000009 22:11:12 ImageWriter2: Destructor # Constructor frame 0 00000010 22:11:12 ImageWriter2: Constructor 00000011 22:11:12 CallCmd: Constructor Command = 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000016 22:11:12 ImageReader2: Constructor Parse Header Filename =C:\Temp\000000.tif # Graph Frame 0 00000020 22:11:12 ImageWriter2: GetFrame(0) Opening File C:\Temp\000000.tif 00000024 22:11:13 CallCmd: GetFrame(0) on command 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000026 22:11:13 ImageReader2: GetFrame(0) 00000027 22:11:13 CallCmd: Destructor 00000029 22:11:13 ImageWriter2: Destructor 00000030 22:11:13 ImageWriter2: Constructor 00000031 22:11:13 CallCmd: Constructor Command = 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000036 22:11:13 ImageReader2: Constructor Parse Header Filename =C:\Temp\000000.tif 00000040 22:11:13 ImageReader2: Destructor # Delayed destructor 00000041 22:11:13 ImageWriter2: GetFrame(0) Opening File C:\Temp\000000.tif 00000045 22:11:13 CallCmd: GetFrame(0) on command 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000047 22:11:13 ImageReader2: GetFrame(0) 00000048 22:11:13 CallCmd: Destructor 00000050 22:11:13 ImageWriter2: Destructor 00000051 22:11:13 ImageWriter2: Constructor 00000052 22:11:13 CallCmd: Constructor Command = 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000057 22:11:13 ImageReader2: Constructor Parse Header Filename =C:\Temp\000000.tif 00000061 22:11:13 ImageReader2: Destructor 00000062 22:11:13 ImageWriter2: GetFrame(0) Opening File C:\Temp\000000.tif 00000066 22:11:13 CallCmd: GetFrame(0) on command 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000068 22:11:13 ImageReader2: GetFrame(0) 00000069 22:11:13 CallCmd: Destructor 00000071 22:11:13 ImageWriter2: Destructor 00000072 22:11:16 ImageReader2: Destructor EDIT: Not sure about the weird destructor sequence above where new ImageRead constructor called before old delayed destructor. EDIT: The noted line above in red: Code:
#BilinearResize(640,576) # Produces error message "StackHorizontal "Image Heights Dont Match not work then) the the error produced by ImageReader would be from source: Code:
sprintf(buf,"ImageReader2: images must have identical heights"); OutputDebugString(buf); EDIT: Quote:
(outside of any scriptclip) at the end of script (I think, maybe, perhaps). EDIT: What are the advantages to using Animate rather than Scriptclip with a supplied string, would not be surprised if scriptclip were implemented something like your example. EDIT: Currently modding CallCmd() to use separate constructor and/or destructor commands and also the previoulsy posted mod to frames spec. EDIT: Code:
# Graph Frame 0 00000020 22:11:12 ImageWriter2: GetFrame(0) Opening File C:\Temp\000000.tif 00000024 22:11:13 CallCmd: GetFrame(0) on command 'C:\PortableApps\ImageMagick\Mogrify.exe -flop C:\Temp\000000.tif' 00000026 22:11:13 ImageReader2: GetFrame(0) and it requests a frame from CallCmd which requests one from ImageWriter2 which requests one from Last (before Scriptclip), the debug messages are printed AFTER the noted function's GetFrame has received the frame from all of the filters before it (nearer source filter) when it has actually gotten the the requested frame.
__________________
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; 8th October 2012 at 19:08. |
|||
7th October 2012, 20:09 | #74 | Link | |||
Registered User
Join Date: Mar 2007
Posts: 407
|
StainlessS,
Quote:
Quote:
EDIT:What is ImageWriter2??? Quote:
EDIT: After all you explained, I fully support your script solution. Regarding HD spilling, I thought of Code:
CMD= "cmd/c del " + QuoteStr(TMPDIR + BASENAME + RD_NSTR + EXT) + \ " && ren "+ QuoteStr(TMPDIR + BASENAME + INSERT + EXT) + " " + QuoteStr(TMPDIR + BASENAME + RD_NSTR + EXT) + \" && " + QuoteStr(IM) + IMCMD + QuoteStr(TMPDIR + BASENAME + RD_NSTR + EXT) #RD_NSTR = "%0"+String(DIGITS)+"d" RD_NSTR = "000000" One possible solution: another Call() must be included into the AviSynth script, that contains only the delete & rename, and is not executed on frame 0. Phew! I would feel better if ImageWriter could be made to write always to the same file name. Warning, off topic I agree on questioning whether Animate() could be better than ScriptClip. With these two examples Code:
##### Animate ##### function DoScript(clip c, int frame, string command) { c GEval(StrReplace(command, "current_frame", string(frame))) } str="subtitle(string(current_frame))" Colorbars(pixel_type="RGB32") Animate(0, Framecount-1, "DoScript", 0, str, Framecount-1, str) Code:
##### ScriptClip ##### Colorbars(pixel_type="RGB32") GEval("""ScriptClip("subtitle(string(current_frame))")""") Warning 2, even more off topic Can I read Windows' %TEMP% and other environment variables with an AviSynth script yet, e.g. instead of manually setting TMPDIR? Last edited by martin53; 7th October 2012 at 21:00. |
|||
7th October 2012, 22:19 | #75 | Link | |
Registered User
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
|
Quote:
__________________
Roelofs Coaching |
|
7th October 2012, 22:51 | #76 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
reading/writing an image some time ago, and ripped out the source and added some debugging stuff so I could establish the problem, cant remember off hand whether originated from 2.58 or 2.6. I removed most of the debug messages and combined in a few places in the above listing, 'Parse header' is where ImageReader creates the VideoInfo from existing image. Quote:
EDIT: Beaten to it. Will comeback again, very nearly ready to up CallCmd with new frames range spec and separate Open (Constructor) and Close (Destructor) commands. EDIT: Have added an additional EDIT to post #73
__________________
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; 8th October 2012 at 00:18. |
||
8th October 2012, 23:41 | #77 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
CallCmd v1.00, Execute command - 8 Oct 2012
Execute command on selectable frames or at startup or closedown. New thread started here: http://forum.doom9.org/showthread.php?t=166063
__________________
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 ??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|