¶VirtualDub's command line switches
While I'd like to say that the reason I'm posting this is to republish some info I dropped from the old help file, the real reason is that I want to stem the flow of comments about watermelons. I had no idea that salting watermelon was so common. One of my friends suggested that the salt draws water out and makes the melon taste sweeter, but I buy that about as much as the diarrhea-prevention theory a commenter posted. When I tried it I all I tasted was salty watermelon. Maybe I used the wrong kind of salt.
Anyway, about VirtualDub's command-line parameters....
VirtualDub exposes a few switches on its command line that can be used to automate its behavior. Nearly all of them are centered around running scripts, so you cannot do much that is not scriptable -- in particular, you cannot script capture mode at all. However, you can run jobs automatically, which is how the various front-end apps work.
The switches in 1.5.10 and 1.6.0 are, as follows:
- /s<script>: run a script
- /c: clear job list
- /b<srcdir>,<dstdir>: add a job using current settings for every file in srcdir, to save an AVI with the same name in dstdir
- /p<src>,<dst>: add a job using current settings for one file called <src>, to save an AVI called <dst>
- /r: run the job list
- /x: exit when jobs are complete
- /h: disable crash handler
- /fsck: test crash handler
- /vtprofile: enable VTune 6 profiling -- automatically enables VTune sampling only during renders and causes instant abort on close instead of "abort dub?" dialog
There must not be spaces between the switches and their arguments, but you can quote, like: /s"foo bar.vcf" /p"this one.avi","that one.avi". The command line parsing will be a bit cleaner in 1.6.1, and in addition, I'm adding a facility for passing parameters to a script.
You can also load a video file by specifying it on the command-line, but note that it is not loaded until after the command-line has been parsed -- so attempting to load a file that way and then execute a script using /s will not work as intended.
Render and preview operations can be invoked directly and immediately from a script. However, if an error occurs, VirtualDub will stop and display a dialog. If you are automating a pipeline you should construct a job queue instead and run it with /r. This way the errors are deposited into the VirtualDub.jobs file instead and VirtualDub will proceed to the next job. (This file is always located next to the EXE, so make sure the current user has write access to that folder.) VirtualDub always flushes its job queue to disk immediately before starting a render so if it crashes during an operation, the .jobs file will have the failed job in the In Progress state, which is then changed to Aborted on the next load. Remember that VirtualDub is a GUI application, so if you are starting it from the command interpreter you may need to use start /wait to force cmd.exe to pause.