|
|
| ALbino |
| Posted: Oct 20 2014, 04:51 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
Hey all,
I'm pretty sure this isn't possible, but I thought I would ask. I was hoping to make a batch script where I could run some post processing on some files and then automatically output them as an image sequence. To just save as a normal video file you might do something like this:
Virtualdub.exe /s myscript.vcf /p c:\folder\file.avi c:\folder\newfile.avi /r /x
However, I don't think there's a way to specify that the output should be an image sequence. Very few people would probably use it, so I'm not surprised if that's the case, but I figured it was worth asking Thanks. |
 |
| ALbino |
| Posted: Oct 20 2014, 05:33 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
I'm thinking there's a few better ways to do this now that I'm really thinking about it. Maybe with ffmpeg for example. I'd delete my original post, but I can't figure out how |
 |
| dloneranger |
| Posted: Oct 20 2014, 10:32 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Just in case you want to try this with virtualdub it is possible The easiest way to write your script is to use the 'queue batch operation->save image sequence' menu entry and then read the .jobs file in a text editor You can substitute the filename params from a .bat by replacing them with VirtualDub.params[x] (where x is the param number) See the help file -> advanced operation -> command-line operation -> /i
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 20 2014, 05:32 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
Very interesting! I've never actually made a script, in my case I was just passing a settings profile along using /s. Is there a tutorial for this somewhere? Or do you do freelance work? ;) |
 |
| dloneranger |
| Posted: Oct 20 2014, 08:28 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
If you've saved settings then it is a script :-) It's just missing the load and save parts that you're interested in There's a slightly out of date guide http://www.virtualdub.org/docs/vdscript.txt But the easiest way is to load a file, set everything up and then queue a job - then just open the .jobs file in a text editor and copy the bits you need Change the open and save(or export) to use Virtualdub.params[x] and you can use it from a .bat file easily
If you do a search for params you'll find quite a few examples including a save image sequence one (link is here) http://forums.virtualdub.org/index.php?act...21840&hl=params
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 20 2014, 09:00 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
| QUOTE (dloneranger @ Oct 20 2014, 08:28 PM) | If you've saved settings then it is a script :-) It's just missing the load and save parts that you're interested in There's a slightly out of date guide http://www.virtualdub.org/docs/vdscript.txt But the easiest way is to load a file, set everything up and then queue a job - then just open the .jobs file in a text editor and copy the bits you need Change the open and save(or export) to use Virtualdub.params[x] and you can use it from a .bat file easily
If you do a search for params you'll find quite a few examples including a save image sequence one (link is here) http://forums.virtualdub.org/index.php?act...21840&hl=params | Hah, guess that makes sense. Opening the Jobs file is a great idea. Thanks for the help! |
 |
| ALbino |
| Posted: Oct 20 2014, 09:07 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
By the way, that example bat script is very close to what I'm looking for. Thanks so much for that :) |
 |
| dloneranger |
| Posted: Oct 20 2014, 09:32 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
You're welcome
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 20 2014, 09:35 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
So I've been working my way through your example script, and I've been able to modify it to do exactly what I need using your trick of opening the Jobs list.
The only thing I'm struggling with is outputting it in the format I'd like. Here's the relevant code:
| CODE | :loopfiles if %1.==. goto alldone set MySettings="%~dpn1_toseq.vdscript" >%MySettings% echo VirtualDub.Open(VirtualDub.params[0],"",0); >>%MySettings% echo VirtualDub.video.SetPreserveEmptyFrames(0); >>%MySettings% echo VirtualDub.video.SetFrameRate2(0,0,1); >>%MySettings% echo VirtualDub.video.SetIVTC(0, 0, 0, 0); >>%MySettings% echo VirtualDub.video.filters.Clear(); >>%MySettings% echo VirtualDub.audio.filters.Clear(); if %pFrameCountToSave%==0 goto skipframecount >>%MySettings% echo VirtualDub.video.SetRangeFrames(%pFrameStartAt%,%pFrameCountToSave%); :skipframecount >>%MySettings% echo VirtualDub.SaveImageSequence(VirtualDub.params[1], %pFileExt%, %pNumberOfDigits%, %pImageType%, %pSaveOption%); :skipwritesettings
rem <-- Define Output Directory, "%~dpn1" is the source directory -->
rem if you want to save in a specific folder use something like set OutputSeq="c:\somewhere\%~n1" rem set OutputSeq="%~dpn1" set OutputSeq="%~dpn1"
rem <-- Actually running each file through the script -->
set InputVideo=%1 @echo Saving %~nx1 %vdub% /i %MySettings% %InputVideo% %OutputSeq% /x if not errorlevel 1 goto nextfile echo "An error happened" pause goto :eof
|
If I leave OutputSeq set to "%~dpn1" then the jpgs export to my source directory with the file name and the numbers appended, i.e. ThisIsATest.avi is saved as ThisIsATest00001.jpg. If I change OutputSeq to a specific directory, i.e. c:\test\, then the images just come up as 00001.jpg without the file name. So if you were to do more than 1 file they would overwrite I suppose. Ideally, I would like to output them as ThisIsATest--00001.jpg as I think that would be more readable, and it would avoid any duplicate problems. Any help would be appreciated 
Edited to Add: I just tested it out, and they do overwrite if you specify a directory. |
 |
| dloneranger |
| Posted: Oct 21 2014, 07:28 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
You can modify outputseq to anything you like It's just using standard .bat file params %~dpn1 = drive:path\name of param 1 So you could use eg set OutputSeq="c:\test\%~n1--" Virtualdub will tack on the .jpg, .bmp etc itself
Because it's running a script, it assumes you've answered the 'do you want to overwrite' in the dialog where you save a file already You can test inside the .bat file for already existing files Here's a simple example
Above %vdub% /i %MySettings% %InputVideo% %OutputSeq% /x add call :testexist %OutputSeq%
Above :nextfile add :testexist if exist "%~1.*" echo error somethings already there, close this .bat window or press a key to overwrite &pause goto :eof
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 21 2014, 07:56 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
"drive:path\name of param 1" explained a lot for me about what was actually happening there, it all seemed very mysterious before :)
This is totally fantastic, I've got it pretty much up and running for what I need now. Thanks so much for all the help with all of this! |
 |
| dloneranger |
| Posted: Oct 21 2014, 12:24 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
The ~ means "with any quotes removed", so it's handy for being able to modify the filenames d drive p path n name x extension use any you need (%1 is the same as %dpnx1)
You can use them multiple times to make subdirectory names etc as well from parts of the filename set newpath="%~dp1%~n1\ImgSeq of %~n1--" "c:\some where\video1.avi" ="c:\some where\video1\ImgSeq of video1--"
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 21 2014, 06:59 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
This is great information. Is there a site you would recommend that has all of the syntax on how to write these kind of scripts? Something that explains how the if and for statements work, and the other operators? |
 |
| dloneranger |
| Posted: Oct 21 2014, 08:05 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
http://ss64.com/nt/ is pretty good Its params page isn't easy to find so here it is http://ss64.com/nt/syntax-args.html
One tip for .bat files ! and & in filenames/paths can kill your .bat file or have horrible side effects
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ALbino |
| Posted: Oct 22 2014, 10:02 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 101
Member No.: 26983
Joined: 9-February 10

|
I've been plowing through this all day. So much to learn! Thanks again :) |
 |