@echo off REM To Create help-text-file of FFMpeg REM @echo off REM ffmpeg.exe -h > ffmpeg-help.txt REM REM batch to convert to mp4 for flash and Quicktime REM if exist *.log del *.log if exist *.mbtree del *.mbtree if exist ffmepg_mp4_2Pass.mp4 del ffmepg_mp4_2Pass.mp4 REM set zvr=192 REM target video kbits per sec. REM set zab=64000 REM target audio bits per sec. REM set thn=1 REM number of threads for FFMpeg REM set zvq=1 REM taget video qualitiy 1 best, 2 middle, 3 low REM set zvb=176 REM target video width in pixel REM 2, 4, 6 ..... but not 1, 3, 5 ..... REM set zvh=100 REM target video height in pixel REM 2, 4, 6 ..... but not 1, 3, 5 ..... REM please add 16 pixels for height of control bar of Quicktime player REM set zva=1.7777 REM target video REM for 4:3 code 1.3333 REM for 16:9 code 1.7777 REM f.e. 152 / 86 is nearly 1.7777 REM f.e. 177 / 100 is 1.7777 cls echo ffmpeg for MP4 (Flashplayer and Quicktime player) if not exist ffmpeg.exe goto error1 REM REM input file IF "%1%" == "" goto error2 if exist %1.mp4.tmp.txt del %1.mp4.tmp.txt >NUL if exist %1.mp4 del %1.mp4 > NUL REM echo. echo. REM Pass 1 REM ffmpeg.exe -i %1 -vb %zvr%k -ab %zab% -threads %thn% -level %zvq%00 -s %zvb%x%zvh% -aspect %zva% -pass 1 -vcodec libx264 -flags +loop -cmp +chroma -partitions 0 -me_method epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -y ffmepg_mp4_2Pass.mp4 REM 1 line !! REM -r 25 fps form source REM -ac 2 channel number from source REM -y ffmepg_mp4_2Pass.mp4 last coded param REM if exist ffmepg_mp4_2Pass.mp4 del ffmepg_mp4_2Pass.mp4 if not exist *.log goto error3 REM REM PASS 2 REM ffmpeg.exe -i %1 -vb %zvr%k -ab %zab% -threads %thn% -level %zvq%00 -s %zvb%x%zvh% -aspect %zva% -pass 2 -vcodec libx264 -flags +loop -cmp +chroma -partitions 0 -me_method epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -vstats_file %1.mp4.tmp.txt -y %1.mp4 REM 1 line !! if not exist %1.mp4.tmp.txt goto error4 if not exist %1.mp4 goto error4 REM REM del %1.mp4.tmp.txt >NUL REM goto end REM REM :error1 echo. echo. echo ***** ffmpeg.exe not found ! goto anz :error2 echo. echo. echo ***** Inputfile %1 not found ! :anz echo. echo Call batch.bat input_file echo. echo f.e. batch.bat t.mpg echo. goto end :error3 echo. echo 2. Pass not possible (1. Pass with error) ! goto end :error4 echo. echo 2. Pass with error ! :end set zvr= set zab= set thn= set zvq= set zvb= set zvh= set zva= if exist *.log del *.log if exist *.mbtree del *.mbtree if exist ffmepg_mp4_2Pass.mp4 del ffmepg_mp4_2Pass.mp4 echo. echo. echo ***** End ***** echo. echo.