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.

 
Shell Command: Convert List Of .jpg To Mpeg Or Avi, .bat file comman conversion JPG to AVI
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
mpo
Posted: Sep 6 2013, 03:59 PM


Newbie


Group: Members
Posts: 3
Member No.: 37088
Joined: 6-September 13



I understand the functionality of converting jpg to avi (or other format) is already there.

Would there be an option to call this functionality from a .bat file?

I have folders of 500+ jpg images generated on a regular basis and I need them to be converted into any common video format. I do not have any special quality or frame rate requirements. Any help appreciated. Thank you.

~mpo
 
     Top
malky
Posted: Sep 6 2013, 04:22 PM


Advanced Member


Group: Members
Posts: 290
Member No.: 22386
Joined: 6-November 07



You could simply rename the files sequentially, and as long as they are the same resolution, opening the first in sequence will automatically append the rest.

http://www.virtualdub.org/blog/pivot/entry.php?id=34
 
    Top
mpo
Posted: Sep 6 2013, 04:55 PM


Newbie


Group: Members
Posts: 3
Member No.: 37088
Joined: 6-September 13



...yes, my jpg files are all the same size, format and are sequentially numbered i.e.: 001.jpg, 002.jpg, 003.jpg..... etc. The feature works fine from the application drop-down menu but how can I execute this in command line or through .bat file?

Thank you.

~mpo
 
     Top
raffriff42
Posted: Sep 6 2013, 06:39 PM


Advanced Member


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



It's doable. You create a Virtualdub script::
  • Set up V-dub filters & compression as desired.
  • File, Save Settings.
  • Open settings file in text editor.
  • Add these lines to the end of your settings file:
    CODE
    VirtualDub.SaveAVI(%1);
    VirtualDub.Close();
Save as *.vcf. It will look like this example.
Then at a command prompt:
CODE
"<path\to\vdub.exe>" /x /s "<path\to\script.vcf>"
 
     Top
mpo
Posted: Sep 6 2013, 08:49 PM


Newbie


Group: Members
Posts: 3
Member No.: 37088
Joined: 6-September 13



..excellent! thank you, I will try that.
 
     Top
malky
Posted: Sep 6 2013, 11:41 PM


Advanced Member


Group: Members
Posts: 290
Member No.: 22386
Joined: 6-November 07



FWIW, this bat file works.


CODE
:: verify paths and filenames.
:: Image jpeg files are named four digits, e.g 0001.jpg
:: assumes that XviD codec is installed.
:: output is 000.avi
:: running 'vdub.exe' exits when script finished, 'VirtualDub.exe' waits for user input to exit VirtualDub screen.
:: this bat file placed in same folder as source images.

set vdub="c:\program files\virtualdub\vdub.exe"

for /f "delims=" %%a in (
'dir *0001.jpg /a:-d /o:n /b'
) do call :next "%%a"
GOTO:EOF

:next

set "name=%~n1"

set "name=%name:~0,-1%"

echo processing "%name%.avi"

>vdub.vcf echo VirtualDub.video.SetMode(3);
>vdub.vcf echo VirtualDub.video.SetCompression();
>vdub.vcf echo VirtualDub.video.SetCompression(0x32317679,0,10000,0);
>>vdub.vcf echo VirtualDub.Open("%name%1.jpg",0,0);
>>vdub.vcf echo VirtualDub.Append("%name%2.jpg");
if exist "%name%3.jpg" >>vdub.vcf echo VirtualDub.Append("%name%3.jpg");
>>vdub.vcf echo VirtualDub.SaveAVI("%name%.avi");
>>vdub.vcf echo VirtualDub.Close();

%vdub% /s vdub.vcf >nul
del vdub.vcf
 
    Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
5 replies since Sep 6 2013, 03:59 PM Track this topic | Email this topic | Print this topic

<< Back to Newbie Questions