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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th December 2013, 02:11   #21  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Vampiredom, There is also a compile/run time version in RT_Stats, not based on Frame number, Constructor, Destructor.
__________________
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 14th December 2013, 00:25   #22  |  Link
vampiredom
Registered User
 
Join Date: Aug 2008
Posts: 233
I finally got around to trying it, StainlessS. It works a treat. Excellent. I have no idea if this is even possible… but it there some way to have a function like this return a program's STDOUT to AviSynth as a string? That would be extremely useful.
vampiredom is offline   Reply With Quote
Old 15th December 2013, 21:10   #23  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by vampiredom View Post
return a program's STDOUT to AviSynth as a string?
What you can do today is redirect STDOUT to a file, and read the file from AviSynth. See here
martin53 is offline   Reply With Quote
Old 16th December 2013, 02:03   #24  |  Link
vampiredom
Registered User
 
Join Date: Aug 2008
Posts: 233
Quote:
Originally Posted by martin53 View Post
What you can do today is redirect STDOUT to a file, and read the file from AviSynth. See here
Thanks. Yeah, I already do stuff like this ... I often write Perl scripts and such that generate strings and write them out as AviSynth variables in a text file, Import() them in AviSynth, etc.

It would just be handy (and cleaner) to have AviSynth be able to read the STDOUT directly, I suppose.

Last edited by vampiredom; 16th December 2013 at 05:50. Reason: clarity
vampiredom is offline   Reply With Quote
Old 10th November 2015, 16:29   #25  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Been playing a little with functions to extract MediaInfo using CallCmd

Library of funcs, require CallCmd, RT_Stats, GScript. [EDIT: And of course the magnificent MediaInfo.exe, CLI version]
Code:
# CallCmd_MediaInfo.Avs
#
# If Below Global Variable Exists then will use it, Otherwise MediaInfo.Exe must live somewhere in Path of system Environment. 
#Global MEDIAINFO_PATH = "C:\BIN\MediaInfo.Exe"          # Modify for your system, Can Comment out if MediaInfo.Exe already in system Path. 

######
# Debug sends ONLY CallCmd output to DebugView 
######
Function CallCmdReturnOutput(String "Cmd",Bool "Debug") {
    # Call with temporary output filename placement insertion position flagged with '@@@FILENAME@@@' (excluding quotes).
    # Returns with output filename in string, or Int(-1) on error.
    myName="CallCmdReturnOutput: "    Debug=Default(Debug,False)
    Find_FN_S="@@@FILENAME@@@"  pos = RT_FindStr(Cmd,Find_FN_S,Sig=False)
    Assert(pos!=0,RT_String("%sOutput Filename not flagged in CMD arg string\n'%s'",myName,Cmd))
    fn=RT_GetFullPathName("MediaInfo_"+RT_LocalTimeString(File=true)+".txt")        # Unique filename, full path
    Cmd=RT_StrReplace(Cmd,Find_FN_S,fn)
    RT_FileDelete(fn)                                                               # Delete output file prior to Call (Unlikely to ever Exist)    
    CallCmd(BlankClip(Length=1), Open=Cmd, Hide=true, debug=Debug, Synchronous=1)   # Call the command, wait command terminated.
    return (Exist(fn)) ? fn : -1
}

######
# Debug sends CallCmd Info + COMPLETE MediaInfo output to DebugView 
######
Function GetMediaInfo(String VidFn,Bool "Debug",Bool "DelOutputFile") {
    # Get MediaInfo
    myName="GetMediaInfo: "     DelOutputFile=Default(DelOutputFile,True)   Debug=Default(Debug,FalsE)
    VidFn=RT_GetFullPathName(VidFn)
    # If Global Var exists, then use it else expect MediaInfo to be in a system path.
    MEDIAINFO = RT_VarExist("MEDIAINFO_PATH") ? MEDIAINFO_PATH : "MediaInfo.Exe"
    # Below, Double %% is ESCaped representation of single %, ie must use %% for literal single %, % is insertion marker for RT_String.
    Fmt="""%s  --LogFile="@@@FILENAME@@@" --Inform=Video; "%s" """
    # Below inserts MEDIAINFO at beginning and VidFn at end of string
    Cmd=RT_String(Fmt,MEDIAINFO,VidFn)
    Ofn=CallCmdReturnOutput(Cmd,Debug=Debug)
    Assert(Ofn.IsString,RT_string("%sCallCmdReturnOutput return FAILED",myName))
    Txt=RT_ReadTxtFromFile(Ofn)
    (Debug) ? RT_DebugF("MediaInfo:\n%s",Txt,name=myName) : NOP
    (DelOutputFile) ? RT_FileDelete(Ofn) : NOP
    return Txt   
}

######
# Debug sends ONLY FULL SECTION Info to DebugView 
######
Function ExtractMediaInfoSection(String Txt,String SectionName,Bool "Debug") {
    myName="ExtractMediaInfoSection: "    Debug=Default(Debug,False)    Lines=RT_TxtQueryLines(Txt) T="" InSect= False
    GSCript("""
        For(i=0,Lines-1){S=RT_TxtGetLine(Txt,i)if(S==SectionName){InSect=True}else if(S==""){InSect=False} else if(InSect){T=RT_TxtAddStr(T,S)} }
    """)
    (Debug) ? RT_DebugF("%s:\n%s",SectionName,T,name=myName) : NOP
    Return T
}

Function GetMediaInfoSection(String VidFn,String "SectionName",Bool "Debug") {
    # Get MediaInfo by SectionName (Default="Video") and return as String. Section Name eg "General", "Video", "Audio", "Audio #1", "Text #3"
    # Will return "" if SectionName does not exist (eg "Text #24" does not exist, or "Audio #1" when only "Audio" section in file). 
    SectionName=Default(SectionName,"Video")
    Txt=GetMediaInfo(VidFn)
    return ExtractMediaInfoSection(Txt,SectionName,Debug)
}

Function GetGeneralInfo(String VidFn,Int "Stream",Bool "Debug") {
    Stream = Default(Stream,0)                                            # Default is NO STREAM Number (Unlikely more than 1 General section)
    SectionName=(Stream==0)?"General":"General #"+String(Stream)
    Return GetMediaInfoSection(VidFn,SectionName,Debug=Debug)
}

Function GetVideoInfo(String VidFn,Int "Stream",Bool "Debug") {
    Stream = Default(Stream,0)                                            # Default is NO STREAM Number
    SectionName=(Stream==0)?"Video":"Video #"+String(Stream)
    Return GetMediaInfoSection(VidFn,SectionName,Debug=Debug)
}

Function GetAudioInfo(String VidFn,Int "Stream",Bool "Debug") {
    Stream = Default(Stream,0)                                            # Default is NO STREAM Number
    SectionName=(Stream==0)?"Audio":"Audio #"+String(Stream)
    Return GetMediaInfoSection(VidFn,SectionName,Debug=Debug)
}

Function GetTextInfo(String VidFn,Int "Stream",Bool "Debug") {
    Stream = Default(Stream,0)                                            # Default is NO STREAM Number
    SectionName=(Stream==0)?"Text":"Text #"+String(Stream)
    Return GetMediaInfoSection(VidFn,SectionName,Debug=Debug)
}

Function GetFirstStream(String VidFn,String SectionName,Bool "Debug") {
    S=GetMediaInfoSection(VidFn,SectionName,Debug=Debug)
    S=(S=="")?GetMediaInfoSection(VidFn,SectionName+" #1",Debug=Debug):S
    return S  
}

######
# Debug shows only Specific Info.
######

Function ExtractSpecificMediaInfo(String SectionText,String IDString,bool "Debug") {
    myName="ExtractSpecificMediaInfo: "
    Debug=Default(Debug,false)
    Ret = ""    # Not Found     
    Lines=RT_TxtQueryLines(SectionText)
    GSCript("""
        For(i=0,Lines-1) {
            S=RT_TxtGetLine(SectionText,i)
            if(RT_FindStr(S,IDString,sig=False)==1) {
                S=MidStr(S,Strlen(IDString)+1)                              # Strip IDString from Start
                While(RT_Ord(S)==32 || RT_Ord(S)==9) {S=MidStr(S,2)}        # Eat White
                if(LeftStr(S,1)==":") {
                    S=MidStr(S,2)                                           # Strip Colon
                    While(RT_Ord(S)==32 || RT_Ord(S)==9) {S=MidStr(S,2)}    # Eat White
                    Ret = S                                                 # Result
                    i = Lines                                               # Break                        
                }
            }
        }
    """)
    (Debug) ? RT_DebugF("'%s' = '%s'",IDString,S,name=myName) : NOP         # Write IDString = Extracted Text to DebugView
    return Ret  
}

Function FirstStreamSpecificMediaInfo(String VidFn,String SectionName,String IDString,Bool "Debug") {
    S=GetFirstStream(VidFn,SectionName)
    return ExtractSpecificMediaInfo(S,IDString,Debug=Debug)                 # Debug Output ONLY eg "Display aspect ratio = 16:9"  
}

Function GetAspectRatio(String VidFn,Int "Stream",Bool "Debug") {
    # Demo individual purpose function
    Stream = Default(Stream,0)                                              # Default is NO STREAM Number
    S=GetVideoInfo(VidFn,Stream)    
    return ExtractSpecificMediaInfo(S,"Display aspect ratio",Debug=Debug)   # Debug Output ONLY eg "Display aspect ratio = 16:9"  
}
EDITED:

And demo Client
Code:
# CallCmd_MediaInfo_Client.Avs

Import("CallCmd_MediaInfo.Avs")

Colorbars.KillAudio

#NAME="Out.AVI"                                                     # No Stream numbers usually eg "Audio", not "Audio #1"
NAME="VTS_01_1.VOB"                                                 # Possible Stream Numbers eg "Text #1"

STREAM  = 0
DEBUG   = True

################################################
# UNCOMMENT ONE OF BELOW and Set Above STREAM #
################################################

###
# Send CallCmd + Complete MediaInfo to DebugView
###
#S=GetMediaInfo(NAME,Debug=DEBUG)

###
# Send Section INFO to DebugView
###
#S=GetVideoInfo(NAME,Stream=STREAM,Debug=DEBUG)
#S=GetAudioInfo(NAME,Stream=STREAM,Debug=DEBUG)
#S=GetTextInfo(NAME,Stream=STREAM,Debug=DEBUG)
#S=GetFirstStream(NAME,"Audio",Debug=DEBUG)
#S=GetFirstStream(NAME,"Text",Debug=DEBUG)


###
# Send ONLY Specific INFO to DebugView
###
#S=GetAspectRatio(NAME,Stream=STREAM,Debug=DEBUG)
#S=GetVideoInfo(NAME).ExtractSpecificMediaInfo("Display aspect ratio",Debug=DEBUG)
#S=FirstStreamSpecificMediaInfo(NAME,"Audio","Format",Debug=DEBUG)

###
# Leave MediaInfo generated file in current directory, Looks something like "MediaInfo_20151110_225534_968.txt"
###
S=GetMediaInfo(NAME,Debug=DEBUG,DelOutputFile=False)

############################
############################
############################

S = (S!="") ? RT_StrReplace(S,Chr(10),"\n") : S
Return SubTitle(String(S),lsp=0,Font="Courier New")
Oops, got my Channels and Streams muxed up, Demuxed.
__________________
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; 11th November 2015 at 10:15. Reason: Update
StainlessS is offline   Reply With Quote
Old 10th November 2015, 16:40   #26  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Further to previous post, here MediaInfo output of typical VOB with stuff that can be extracted.
EDIT: Sections are separated by Blank Line, with section Name at start of each section.

Code:
General
Complete name                            : D:\CallCmd\VTS_01_1.VOB
Format                                   : MPEG-PS
File size                                : 1 024 MiB
Duration                                 : 24mn 48s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 770 Kbps

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Duration                                 : 24mn 48s
Bit rate mode                            : Variable
Bit rate                                 : 4 695 Kbps
Maximum bit rate                         : 8 436 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.453
Stream size                              : 833 MiB (81%)

Audio #1
ID                                       : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : DVD-Video
Duration                                 : 24mn 48s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 68.1 MiB (7%)

Audio #2
ID                                       : 189 (0xBD)-129 (0x81)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : DVD-Video
Duration                                 : 24mn 48s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 68.1 MiB (7%)

Audio #3
ID                                       : 189 (0xBD)-130 (0x82)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : DVD-Video
Duration                                 : 24mn 48s
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 34.1 MiB (3%)

Text #1
ID                                       : 189 (0xBD)-33 (0x21)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 400ms

Text #2
ID                                       : 189 (0xBD)-34 (0x22)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 160ms

Text #3
ID                                       : 189 (0xBD)-35 (0x23)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 480ms

Text #4
ID                                       : 189 (0xBD)-36 (0x24)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 160ms

Text #5
ID                                       : 189 (0xBD)-37 (0x25)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 160ms

Text #6
ID                                       : 189 (0xBD)-38 (0x26)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 160ms

Text #7
ID                                       : 189 (0xBD)-40 (0x28)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video
Duration                                 : 24mn 43s
Delay relative to video                  : 3s 160ms

Text #8
ID                                       : 189 (0xBD)-32 (0x20)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video

Text #9
ID                                       : 189 (0xBD)-39 (0x27)
Format                                   : RLE
Format/Info                              : Run-length encoding
Muxing mode                              : DVD-Video

Menu
__________________
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; 10th November 2015 at 16:46.
StainlessS is offline   Reply With Quote
Old 11th November 2015, 00:11   #27  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Post #25 updated, general fiddling about.

EDIT: result of client script (extracting and showing only video Info [not audio/text etc]).
Code:
Import("CallCmd_MediaInfo.Avs")
Colorbars.killAudio
S=GetVideoInfo("VTS_01_1.VOB")
S = (S!="") ? RT_StrReplace(S,Chr(10),"\n") : S
Return SubTitle(String(S),lsp=0,Font="Courier New")


And this would show, just "16:9".
Code:
Import("CallCmd_MediaInfo.Avs")
Colorbars.killAudio
S=GetAspectRatio("VTS_01_1.VOB")
Return SubTitle(String(S),lsp=0,Font="Courier New")
__________________
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; 27th July 2019 at 21:58.
StainlessS is offline   Reply With Quote
Old 5th April 2016, 18:16   #28  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Strange delay under Win10

StainlessS,
would you please help checking if there might be a new Win10-related issue.
I use a loop of AviSynth Script calls to a Thumbsheet-Creator function to make thumbsheets of a set of clips.
The thumbsheet creator uses the ImageWriter function, and to compress the Jpegs and remove the frame number from the filename, CallCmd calls ImageMagick's 'convert' and command prompt's 'del' at the closedown of the modified script in line 63
Code:
CallCmd(Close=
\"Cmd.exe /c P:\PortableApps\ImageMagick\convert " + chr(34) + JpgName +"000000.jpg" +chr(34) + " -quality 75 " + chr(34) + JpgName + ".jpg" + chr(34) + " && del " + chr(34) + JpgName +"000000.jpg" +chr(34),
\Hide=true, Synchronous=7)
I used this regularly and without obvious flaws for many months, for a while with 32bit AviSynth+ r1779, and recently updated from Win7 (x64) to Win10.

Now I observe that the thumbsheets all need a suspicious time of exactly 30 seconds to be created, and by some random cause, the time switches to exactly 30 minutes(!) per thumbsheet.

I'm unsure if the 'synchronous' parameter might be broken in Win10, so CallCmd runs into some sort of timeout.

Will change the outmost loop to do these operations outside the AviSynth script and report more findings.

EDIT
After commenting out line in AVS script and adding the commands in the calling AU3 script, processing time is not as stable at 30" as before, and issue is still there. So seems not to come from the CallCmd line but maybe from VirtualDub (which is the portable version 1.10.4 being called directly without the 'portable wrapper' because that is not needed here) or AviSynth+ itself.

AVS script is executed from AutoIt via:
Code:
RunWait("P:\PortableApps\VirtualDubPortable\App\VirtualDub\vdub.exe " & $s2 & " /cmd VirtualDub.RunNullVideoPass(); /x", "", @SW_HIDE)
AutoIt: 3.3.14.2, OS: WIN_10/X64, Script: MakeThumbsheets.au3
19970814 21.21.59.avi
20:00:56
19970814 22.18.40.avi
20:01:27
19970814 22.20.00.avi
20:01:58
19970814 22.20.18.avi
20:02:28
19970814 22.20.44.avi
20:02:58
19970814 22.21.27.avi
20:03:29
19970814 22.24.23.avi
20:04:00
19970814 22.24.43.avi
20:04:30
19970814 22.26.22.avi
20:05:01
19970815 22.27.48.avi
20:05:32
19970818 22.43.47.avi
20:06:26
19970818 22.45.48.avi
20:06:57
19970818 22.48.49.avi
20:36:58
19970818 22.51.32.avi
20:37:31
19970818 22.52.36.avi
20:38:01
19970818 22.53.43.avi
20:38:32
19970818 22.56.25.avi
20:39:03
19970818 22.57.46.avi
20:39:33
20:40:04
>>>>>> Please close the "Report Log Window" to exit <<<<<<<


EDIT2
will try AVSMeter instead of vdub NullVideoPass()

Last edited by martin53; 5th April 2016 at 20:12. Reason: More findings
martin53 is offline   Reply With Quote
Old 5th April 2016, 22:28   #29  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Mobile:

M53, I'm sorry, don't use/have win 10, me still happy on xp32.
Callcmd comes with source, you are perhaps best person to fix problem. If you have any questions on source then can post or PM and I'll do my best to assist.
__________________
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 6th April 2016, 23:38   #30  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
You could perhaps try without HIDE, see if anything is waiting some keypress or something (or error message).
__________________
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 4th April 2018, 01:03   #31  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
CallCmd v1.04, see first post.

Code:
	v1.00,      - 08 Oct 2012, Changed Frames spec, added Open,Close
	v1.01,      - 21 Oct 2012, Add Synchronous Arg.
	v1.02,      - 1 Jan 2013, Add error message on fail.
	v1.03,                  , SetLastError(ERROR_SUCCESS) prior to call.
	v1.04,      - 3 Apr 2018, compile VS2008
Included Avsiynth v2.58, avs+ v2.6 x86, and Avs+ x64 dll's
__________________
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 14th June 2020, 22:37   #32  |  Link
dani75
Registered User
 
Join Date: Jul 2016
Location: Paris, France
Posts: 12
CallCmd: *** ERROR *** Creating Process Paramètre incorrect. (0x00000057)

Good morning everybody.
I just discovered CallCmd() (thanks to StainlessS) and I found it useful inside one of my scripts under AviSynth (still in 2.6.0) to call an executable I made. I installed the CallCmd_25_x86 library (my OS is W10 64 bits).
Unfortunately, I got a 0x00000057 issue. Therefore I replaced the original CallCmd I was working on by the following :
Code:
CallCmd(Last,Open=""" "cmd /C echo Hello world"  """,Debug=True)
And I got the following on DebugView:
Quote:
00000006 18.37546158 [10172] CallCmd: Constructor IN
00000007 18.37561607 [10172] CallCmd: CallCmd: v1.04 - 04 Apr 2018 - by StainlessS
00000008 18.37573242 [10172] CallCmd: Command for Frames = ''
00000009 18.37584686 [10172] CallCmd: Open Command (Constructor) = ' "cmd /C echo Hello world" '
00000010 18.37596893 [10172] CallCmd: FRAMES: About to Parse Frames String
00000011 18.37610626 [10172] CallCmd: Doing command on 0 Frames
00000012 18.37621689 [10172] CallCmd: Open (Constructor) on command ' "cmd /C echo Hello world" '
00000013 18.38459778 [10172] CallCmd: *** ERROR *** Creating Process Paramètre incorrect. (0x00000057)
00000014 18.38466263 [10172] CallCmd: Constructor OUT
00000015 18.59652138 [10172] [ 0] type=I Q: 2 length: 78642
00000016 18.66365051 [10172] CallCmd: Destructor IN
00000017 18.66374779 [10172] CallCmd: Destructor OUT
Does that say anything to someone?
dani75 is offline   Reply With Quote
Old 14th June 2020, 23:40   #33  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Too many double quotes.
Code:
BlankClip
CallCmd(Last,Open="""cmd /C echo Hello world & pause""",Debug=True)
I've added "& pause" where "&" means new command, (ie multiple commands on single line), and "pause" to wait, so you can see it.
hit a key and it goes away.

EDIT: If you're on avs v2.60 x86, maybe should use "CallCmd_x86_1.04.dll" and rename to just "CallCmd.dll". [the one you are using is for avs v2.58]
__________________
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; 14th June 2020 at 23:53.
StainlessS is offline   Reply With Quote
Old 14th June 2020, 23:57   #34  |  Link
dani75
Registered User
 
Join Date: Jul 2016
Location: Paris, France
Posts: 12
I tried it, even with "CallCmd_x86.dll". Sorry, no change at all, except in the instruction line :
Code:
[9932] CallCmd: Constructor IN
[9932] CallCmd: CallCmd: v1.04 - 04 Apr 2018 - by StainlessS
[9932] CallCmd: Command for Frames = ''
[9932] CallCmd: Open Command (Constructor) = ' cmd /C echo Hello world & pause '
[9932] CallCmd: FRAMES: About to Parse Frames String
[9932] CallCmd: Doing command on 0 Frames
[9932] CallCmd: Open (Constructor) on command ' cmd /C echo Hello world & pause '
[9932] CallCmd: *** ERROR *** Creating Process Paramètre incorrect. (0x00000057)
[9932] CallCmd: Constructor OUT
[9932] [     0]   type=I   Q: 2   length: 78642
[9932] CallCmd: Destructor IN
[9932] CallCmd: Destructor OUT
dani75 is offline   Reply With Quote
Old 15th June 2020, 00:04   #35  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Can someone with W10 and Avs installed try out the script in post #33, thanks.
__________________
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 15th June 2020, 12:45   #36  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I installed Avs+ 3.61 test 8 on Win10 Home 1709, x86 Tablet/Laptop thingy, and runs post #33 script OK.
Can you try with Anti Virus turned off, dont know what else to suggest.

EDIT: Maybe also post result of "AvsMeter AvsInfo -l".

EDIT:
Groucho, what is red stuff below supposed to be ? [for post #33 script, below done on W7]
Code:
d:\TESt>avsmeter callcmd.avs

AVSMeter 3.0.1.0 (x86), (c) Groucho2004, 2012-2020
AviSynth+ 3.6.1 (r3290, master, i386) (3.6.1.0)
Hello world pt...
Press any key to continue . . .
__________________
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; 15th June 2020 at 12:53.
StainlessS is offline   Reply With Quote
Old 15th June 2020, 13:33   #37  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Groucho, what is red stuff below supposed to be ? [for post #33 script, below done on W7]
Code:
d:\TESt>avsmeter callcmd.avs

AVSMeter 3.0.1.0 (x86), (c) Groucho2004, 2012-2020
AviSynth+ 3.6.1 (r3290, master, i386) (3.6.1.0)
Hello world pt...
Press any key to continue . . .
It works if you escape the '&' with '^':
Code:
CallCmd(Last,Open="""cmd /C echo Hello world ^& pause""",Debug=True)
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 15th June 2020, 13:42   #38  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
It works if you escape the '&' with '^':
I get this with
Code:
CallCmd(Last,Open="""cmd /C echo Hello world ^& pause""",Debug=True)
Code:
d:\TESt>avsmeter callcmd.avs

AVSMeter 3.0.1.0 (x86), (c) Groucho2004, 2012-2020
AviSynth+ 3.6.1 (r3290, master, i386) (3.6.1.0)
Hello world & pause
Hello world & pause

Number of frames:                      240
Length (hh:mm:ss.ms):         00:00:10.000
Frame width:                           640
Frame height:                          480
Framerate:                          24.000 (24/1)
Colorspace:                          RGB32
Audio channels:                          1
Audio bits/sample:                      16
Audio sample rate:                   44100
Audio samples:                      441000

Script runtime is too short for meaningful measurements

Frames processed:               240 (0 - 239)
Time (elapsed):                 00:00:00.000

d:\TESt>
The intended pause does not work. EDIT: in my prev post you can see the pause, "Press any key to continue . . .".
__________________
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; 15th June 2020 at 13:46.
StainlessS is offline   Reply With Quote
Old 15th June 2020, 13:50   #39  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
The intended pause does not work. EDIT: in my prev post you can see the pause, "Press any key to continue . . .".
Oh, I see. I'll try to figure it out. I don't even know what this plugin is supposed to do...

Edit - It seems to work as intended with avsr.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 15th June 2020 at 14:02.
Groucho2004 is offline   Reply With Quote
Old 15th June 2020, 14:08   #40  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I don't even know what this plugin is supposed to do
Plugin to execute command on selectable frames or at startup or closedown. Based on Call() by Nic.

I'll try also with avsr.

For "Hello world pt...", I was just kinda curious what the 'pt' thing stood for, presumably to represent Ampersand '&'.

EDIT: One of its main uses was to delete files prior to RT_Stats RT_FileDelete().
Also, eg call ImageMagick to operate on an image/frame, and then reload result into script + many other possibilities.

EDIT: also, can set to delete some file on clip destructor, ie delete temp files on clip/script closure.
__________________
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; 15th June 2020 at 14:13.
StainlessS is offline   Reply With Quote
Reply

Tags
call, execute

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 16:15.


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