Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Question About Virtualdub.params, Passing parameters from command line
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Greme
Posted: Jul 16 2014, 05:45 PM


Newbie


Group: Members
Posts: 2
Member No.: 38156
Joined: 16-July 14



Hi, apologies with what is probably a stupid query, but I am having problem with using the /i invoke command to pass parameters to virtual dub.

I am currently attempting to batch-segment a set of avi files. To do so, I have created the following batch file
CODE

@echo off
set vdub="D:\Vdub\vdub.exe"
set myscript="D:\Vdub\scripts\autosplitterscript.vdscript"
set framecut=125
set /a COUNTER=0
set /a ERRCNT=0

:loop
if "%~f1".=="". goto theend
mkdir "%~p1"\split\%~n1
%vdub% /i %myscript% "%~f1" "%~p1\split\%~n1\%~n1%~x1" %framecut% /x
if errorlevel 1 (
set /a ERRCNT=%ERRCNT%+1
echo Error....&pause
)
set /a COUNTER=%COUNTER%+1
shift
goto loop

:theend
set /a SUCCEED=%COUNTER%-%ERRCNT%
echo.
echo All (%COUNTER%) files processed
echo %SUCCEED% files processed sucessfully, %ERRCNT% files produced errors
pause


and the following vdscript file
CODE

VirtualDub.Open(VirtualDub.params[0],"",0);
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetEditMode(1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(0);
VirtualDub.video.SetMode(0);
VirtualDub.video.SetSmartRendering(0);
VirtualDub.video.SetPreserveEmptyFrames(0);
VirtualDub.video.SetFrameRate2(0,0,1);
VirtualDub.video.SetIVTC(0, 0, 0, 0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.audio.filters.Clear();
VirtualDub.project.ClearTextInfo();
VirtualDub.SaveSegmentedAVI(VirtualDub.params[1], 2048, VirtualDub.params[2], 3);
VirtualDub.Close();


However, I get the error message "Error during script execution at line 1, column 81: Overloaded method SaveSegmentedAVI(string,int,string,int) not found. If I change "VirtualDub.params[2]" to 125 in the vdscript file then the process completes without error.

The reason I'm passing through 125 instead of using the value straight in the script is that eventually I want to enable the user to enter this value themselves - i'm just testing passing down the parameter.


I realise that there is probably a very obvious mistake or error that I'm making, but I can't for the life of me work it out!

Any help would be appreciated.

Greme
 
     Top
raffriff42
Posted: Jul 16 2014, 08:05 PM


Advanced Member


Group: Members
Posts: 384
Member No.: 35081
Joined: 25-June 12



I think you want this:
VirtualDub.SaveSegmentedAVI(VirtualDub.params[1], 2048, Atoi(VirtualDub.params[2]), 3);
(Atoi() converts a string to an integer)

But it looks like you would still have too many arguments to SaveSegmentedAVI, per the documentation
void SaveSegmentedAVI(string filename, int spacethresh, int framethresh);
 
     Top
dloneranger
Posted: Jul 16 2014, 08:10 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



The fourth param is a newer addition than in the docs
It's the minimum number of digits for filename

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
Greme
Posted: Jul 17 2014, 08:29 AM


Newbie


Group: Members
Posts: 2
Member No.: 38156
Joined: 16-July 14



That's brilliant, I forgot that the parameter would be passed as a string.

Just in case anyone strangely has this problem in the future and arrives here, the line that worked for me is:
VirtualDub.SaveSegmentedAVI(VirtualDub.params[1], 2048, Sylia.Atoi(VirtualDub.params[2]), 3);

Thank you both very much for your help with this! smile.gif
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
3 replies since Jul 16 2014, 05:45 PM Track this topic | Email this topic | Print this topic

<< Back to General Discussion