Friday, September 18, 2009

windows batch file to convert videos to mp3

save this as tomp3.bat
@echo off

setlocal

set filename=%~n1
set filepath=%~df1
set dirname=%~dp1
set dumpfile=%dirname%\audiodump.wav
set outfile=%dirname%\%filename%.mp3
mplayer -ao pcm:fast -af volnorm -vo null -vc null "%filepath%" -dumpfile "%dumpfile%"
lame -h "%dumpfile%" -o "%outfile%"
del "%dumpfile%"
pause
endlocal
and drag and drop the movie to the batch file