I have made a batch file to convert all clips in a folder into vcd mpeg.
My problem is the encoded clips have the original extension then the MPG ext.
IE: 'Clip1.flv' converts into 'Clip1.flv.MPG' can anyone suggest how to alter my batch file to remove the original ext when encoded.
my batch file:
for %%f in (*.*) do mencoder.exe "%%f" -o "%%f.MPG" -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf scale=352:240,harddup -srate 44100 -af volnorm=1 -lavcopts vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_m inrate=1152:vbitrate=1152:
vrc_maxrate=1152:acodec=mp2:abitrate=224:aspect=4/3 -ofps 30000/1001
+ Reply to Thread
Results 1 to 3 of 3
-
-
Try this
Code:for %%F in (*.*) do mencoder.exe "%%F" -o "%%~dpnF.mpg" [..... rest the same]
Type "for /?" at the command line to see some useful expressions you can use in batch files under Win2k or higher.
eg:
In addition, substitution of FOR variable references has been enhanced.
You can now use the following optional syntax:
%~I - expands %I removing any surrounding quotes (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
I wonder if this might get into an infinite loop. Does it keep converting all the new MPG files?
Maybe the file list is fixed on the first call. Anyway, if you're only doing flv files, why not do
(*.flv) rather than (*.*), or put the output files into a different directory. -
Alan, thanks very much for the info, I have changed -o "%%f.MPG" into
-o "%%~nf.MPG" and it works perfectly, dropping the original extension.
(from your post %~nI - expands %I to a file name only )
The batch does not loop into the mpegs, and has not in the past.
I use *.* as i convert many different formats at a time.
Great help thanks Alan.
Similar Threads
-
Time & Date Subtitle File Generator (.srt) - Testers Required
By time2innov8 in forum SubtitleReplies: 108Last Post: 5th Feb 2024, 17:31 -
Batch "file creation from a text file, Placed into a created directory
By Muther in forum ProgrammingReplies: 5Last Post: 24th Sep 2015, 18:29 -
Batch file
By Anurag in forum ComputerReplies: 16Last Post: 19th May 2009, 11:27 -
WPL file converting help required
By cool4cats in forum Video Streaming DownloadingReplies: 1Last Post: 25th Nov 2008, 06:41 -
Batch file that can delete a specific file
By Dark_Raven in forum ProgrammingReplies: 1Last Post: 10th Jun 2008, 08:16