Sunday, October 28, 2012

Updated MP4 to MP3 Script



Wanted to add some metadata to the mp3 I created from mp4s.
so. But for some reason yet to be investigated windows 8 cant seem to find my metadata.
VLC is happy.


REM FORMAT REQ <name-nospace><space><minus><space><songname><.mp4ext>
REM EG 'coolkids - i like to rock.mp4'
for /f "tokens=1,* delims=-" %%a in ('dir *.mp4 /b') do (call :makemusic %%a "%%b")
goto :eof

:makemusic
set str=%2%
set artist=%1%
REM %str:~2,-5% is used to strip the quotemarks and filename
set title=%str:~2,-5%

REM UPDATE WITH YOUR CORRECT PATH TO FFMPEG
G:\music\ffmpeg.exe -i "%1 - %title%.mp4" -vn -ar 44100 -ac 2 -ab 192000 -f mp3 -metadata title="%title%" -metadata artist="%artist%" "%1 - %title%.mp3"
REM <need command that will allow normalise the sound levels> :eof


No comments: