As far as the scaler question goes, it may end up being irrelevant but I would still like to know if it can be done wholly in the encoder. If I have to use pointresize in avisynth then I'll use avisynth for scaling (and the end goal involves helping a bunch of people migrate from standard avisynth to an x64 compatible fork anyway - they already use x264 for their encoding and want to migrate from x86 to x64 builds, but they use Avisynth for scaling and cleanup)
The windows batch file I'm starting from is this:
Code: Select all
@echo off
set /p fn="Filename? "
@echo.
set /p src="Source? "
@echo.
set /p scale="Scale value? (common values are 2, 4, 8)"
@echo.
choice /m "Are there subtitles?"
@echo.
IF errorlevel 2 goto Encode
IF errorlevel 1 goto Subtitle
:Subtitle
set /p sub="Subtitle file name? "
goto Subencode
:Encode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof
:Subencode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf subtitles=%sub% -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof
:Fail
@echo ----------------------
@echo Encode failed, please review FFMPEG output.
@echo I will go ahead and delete %fn% for you.
pause >nul
del %fn%
goto :eof
Code: Select all
mediainfo --Inform="Video;%%Width%%" %src% > temp.txt
set /p iw=<temp.txt
set /a iw=%iw%*%scale%
mediainfo --Inform="Video;%%Height%%" %src% > temp.txt
set /p ih=<temp.txt
set /a ih=%ih%*%scale%
goto :Encode
:Encode
cls
x264 --crf 20 --bframes -1 --b-adapt 2 --output-csp i420 --output %fn% --video-filter resize:%iw%,%ih%,1:1:point %src%