Created
September 3, 2011 10:25
-
-
Save ayanamist/1190974 to your computer and use it in GitHub Desktop.
mp4convertor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set CurPath=%0 | |
IF NOT "%CurPath%"=="" set CurPath=%CurPath:~0,-15%" | |
set PATH=%CurPath%;%PATH% | |
set flock="%CurPath%\converting.txt" | |
:START | |
if exist %flock% goto WAIT | |
echo 文件正在转换中!请勿删除此文件! > %flock% | |
set source=%~f1 | |
echo 当前正在转换 >> %flock% | |
echo %source% >> %flock% | |
echo 如果你发现相应的MP4文件已经生成,请删除本文件,会自动开始下一个任务。 >> %flock% | |
set tmp=%~dpn1.tmp.avi | |
set vid=%~dpn1.264 | |
set aud=%~dpn1.aac | |
set mp4=%~dpn1.mp4 | |
if exist %mp4% goto END | |
mencoder.exe "%source%" -af volnorm=1,channels=2 -vf harddup -ofps 24 -oac faac -faacopts br=96:mpeg=4:object=2 -ovc x264 -ffourcc H264 -x264encopts crf=25:level_idc=21:bframes=3:frameref=2:nopsnr:nossim -nosub -o "%tmp%" | |
mencoder -ovc copy -nosound -of rawvideo -o "%vid%" "%tmp%" | |
mencoder -ovc frameno -oac copy -of rawaudio -o "%aud%" "%tmp%" | |
if not exist "%vid%" goto END | |
if not exist "%aud%" goto END | |
mp4creator -c "%vid%" -rate=24 "%mp4%" | |
mp4creator -c "%aud%" "%mp4%" | |
if not exist "%mp4%" goto END | |
del "%tmp%" | |
del "%vid%" | |
del "%aud%" | |
goto END | |
:END | |
del %flock% | |
exit /b | |
:WAIT | |
echo Waiting:%source% | |
ping 127.0.0.1 > nul | |
goto START |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment