Das Script liest mit ffprobe zuerst die Auflösung aus und korrigiert gegebenenfalls die Höhe. Für Avisynth wird zusätzlich mvtools2 und ffms2 benötigt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | @echo off Setlocal EnableDelayedExpansion for %%f in (%*) do ( for /F %%g in ('ffprobe -v quiet -print_format default^=nk^=0:nw^=1 -show_streams -i %%f') do echo %%g>>"%%~nf.tmp" for /F "tokens=2 delims==" %%h in ('findstr width %%~nf.tmp') do set Width=%%h for /F "tokens=2 delims==" %%i in ('findstr height %%~nf.tmp') do set Height=%%i set /a newHeight=176*!Height!/!Width! set "infile=%%~sf" if !newHeight!==99 ( set newHeight=100 ) echo.SetMTMode^(5, 4^) >> "%%~nf.avs" echo.LoadPlugin^("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll"^) >> "%%~nf.avs" echo.LoadPlugin^("C:\Program Files (x86)\AviSynth 2.5\plugins\mvtools2.dll"^) >> "%%~nf.avs" echo.A = FFAudioSource^("!infile!"^) >> "%%~nf.avs" echo.V = FFVideoSource^("!infile!"^) >> "%%~nf.avs" echo.audiodub^(V,A^) >> "%%~nf.avs" echo.SetMTMode^(2^) >> "%%~nf.avs" echo.Lanczos4Resize^(176,!newHeight!^)>> "%%~nf.avs" echo.super = MSuper^(pel=2^)>> "%%~nf.avs" echo.backward_vec = MAnalyse^(super, isb = true^)>> "%%~nf.avs" echo.forward_vec = MAnalyse^(super, isb = false^)>> "%%~nf.avs" echo.MFlowFps^(super, backward_vec, forward_vec, num=15, den=1, ml=100^)>> "%%~nf.avs" "ffmpeg.exe" -i %%~nf.avs -pix_fmt yuv420p -c:v libx264 -preset slower -crf 25 -profile:v Baseline -level 1.1 -maxrate 128K -bufsize 128K -acodec libfdk_aac -ar 22050 -ac 1 -ab 64k %%~nf_cell.mp4 del "%%~nf.tmp" del "%%~nf.avs" del "!infile!.ffindex" ) echo. echo.................................................................... echo. echo.....................converting done................................ echo. echo.................................................................... echo. ping 127.0.0.0 -n 3 >nul echo. echo Window close in 15 echo. ping 127.0.0.0 -n 5 >nul echo. echo Window close in 10 echo. ping 127.0.0.0 -n 5 >nul echo. echo Window close in 5 echo. ping 127.0.0.0 -n 5 >nul echo. |