rendered paste body@echo off
echo avisource(%1) > %1.avs
echo (float(width())/height() == (16./9) ^&^& ((width() ^> 1280) ^&^& (height() ^> 720))) ? spline36resize(1280,720) : last >> %1.avs
echo spline36resize(int((width()/2))*2, int((height()/2))*2) >> %1.avs
echo normalize() >> %1.avs
echo (framerate() ^> 30) ? changefps(framerate()/2.) : last >> %1.avs
echo (framerate() ^> 30) ? changefps(30) : last >> %1.avs
echo ConvertToYV12() >> %1.avs
echo AVS file written, now encoding audio
echo --
avs2wav %1.avs - | neroaacenc -q 0.4 -if - -of %1.aud.mp4
echo --
echo Audio encoded, now encoding video
start /b /low /wait x264 --crf 12 --keyint 400 --min-keyint 24 --no-fast-pskip --b-adapt 2 --direct auto --subme 6 --trellis 1 --8x8dct --partitions p8x8,b8x8,i4x4,i8x8 --me umh --thread-input --quiet --output %1.vid.264 %1.avs
echo --
echo Video encoded, now muxing to mp4
echo --
mp4box -add %1.vid.264:fps=30 -add %1.aud.mp4 %1.final.mp4
echo --
del %1.vid.264
del %1.aud.mp4
del %1.avs
echo Requirements: Avisynth installed, in your PATH (system32/syswow64): x264.exe, neroaacenc.exe, mp4box.exe
pause