Convert multiple video files using command line batch file

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
bairmik
New Cone
New Cone
Posts: 1
Joined: 06 Nov 2006 22:37

Convert multiple video files using command line batch file

Postby bairmik » 06 Nov 2006 23:04

Greetings all,

I have been searching for a way to convert multiple video files (from avi to mp4) using a command line batch file.

I am looking for it to be completely automated, I just want to specify what directory the existing avi files are in and where I would like the new mp4 files to be put.

I have the following batch script as a starting point:

Code: Select all

vlc "input_filename" :sout="#transcode{vcodec=mp4v, vb=512, acodec=mp4a, ab=128, channels=2, audio-sync}:std{access=file, mux=mp4,url="output_filename"}" --sout-transcode-width=320 --sout-transcode-height=240 --aspect-ratio=width:height
Is there a way to indicate a directory for the 'input_filename'? something along the lines of 'file:///c:/video/*.avi' or similar to indicate to transcode every avi file in a directory, then for the 'output_filename' select a specific directory like 'file:///c:/video/mp4/' where it will create mp4 files with the same file names as the avi?

I am using windows xp pro sp2, and just installed vlc 0.8.5.

I have looked all over for an answer and haven't seen any reference for using wildcards for the filename or using a blank directory for file output.

Any help would be greatly appreciated.

Thank you.

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 07 Nov 2006 00:18

I don't believe VLC will recognize * or ? used on its command line. You will probably need to be very clever here and use replaceable parameters and or the environment along with the for command to cycle through a directory a file at a time. Then there is the issue of naming the files that are output so that the files are not over written. Which I suppose could be done by reading the environment so that it uses the original file name with a new extension in a new folder. But bear in mind DOS (Windows) would be creating a new command line for each file that is fed to VLC.

VLC has no provision for batch processing when it comes to transcoding. Really a playlist should be suitable for input assuming the output filename could be resolved.

Why don't you try feature requests.

ScottB
New Cone
New Cone
Posts: 6
Joined: 30 May 2007 01:46

Postby ScottB » 30 May 2007 02:05

Code: Select all

for %%a in (*.VOB) do "C:\Program Files\VideoLAN\VLC\vlc" -I dummy -vvv %%a --sout=#transcode{vcodec=h264,vb=1024,acodec=A/52,ab=192,channels=2,deinterlace}:standard{access=file,mux=ts,dst=%%a.mpg} vlc:quit
This should cycle through the files one at a time.

anexny
New Cone
New Cone
Posts: 6
Joined: 02 Jun 2007 05:26

Postby anexny » 02 Jun 2007 05:27

Similar problem: I'm trying to setup a sort of video jukebox, where the PC will randomly play all files in a folder at system startup. With 0.85, I could use, basically, "vlc.exe -Z --loop -f c:\vids\*.*" and it'd play the files just fine. But with 0.86, it no longer likes the *.* part, and instead gives me an error. I don't want to use a playlist, because I don't want to have to edit the playlist every time I add a file to the video folder.

What happened between 0.85 and 0.86 to cause VLC to no longer handle *.* correctly?


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Louis0021 and 49 guests