Hello fellas. I wrote some simple batch file that converts any audio/video files to .ogg (audio) format. For example music off youtube which is in .flv format. Here's the script:
[code]
set ogg_rate=1.3
set source_dir=f:\music
set dest_dir=f:\music\out
set my_temp=f:\tempRem Go to source dir
cd /d %source_dir%
for %%f in (*.*) do (Rem Extract audio from avi file using ffmpeg
c:\encode\ffmpeg.exe -i "%source_dir%\%%f" "%my_temp%\%%f.wav"rem Encode the audio with OGG encoder using 1.3 quality setting
cd /d %my_temp%
c:\encode\oggenc2.exe -q %ogg_rate% -o "%dest_dir%\%%f.ogg" "%my_temp%\%%f.wav"rem delete all temp files
cd /d %my_temp%
del *.* /q
)
[/code]It works file, but I cannot figure out how to remove the unnecessary extension.
For example, input file is "file.flv" then after converting to wave it will be file.flv.wav than, after converting it to .ogg it will be file.flv.ogg
How to get the file.ogg - without ".flv"
BTW- instead of .flv it can me .mp4, .avi or another extension. Thanks.
for %%f in (*.*) do (
c:\encode\ffmpeg.exe -i "%source_dir%\%%f" "%my_temp%\%%~nf.wav"cd /d %my_temp%
c:\encode\oggenc2.exe -q %ogg_rate% -o "%dest_dir%\%%~nf.ogg" "%my_temp%\%%~nf.wav"
)see: FOR /?, third page i think, it shows all the tilde enhancements.
Thanks. That worked great.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |