04.06.2022, 19:24
Hab den verwendeten clip im posting verlinkt.
Die Parameter für die encoder sind in den im posting angehangenen logfiles enthalten.
VMAF, SSIM + PSNR kann man mit diesem Skript und ffmepg ermitteln (jetzt auch als Anhang im original posting):
Die Parameter für die encoder sind in den im posting angehangenen logfiles enthalten.
VMAF, SSIM + PSNR kann man mit diesem Skript und ffmepg ermitteln (jetzt auch als Anhang im original posting):
@echo off
set hybridFolder="C:\Program Files\Hybrid"
set "originalVideo="
set "comparingVideo="
set "cpuThreads=12"
echo ffmpeg VMAF SSIM PSNR Calculator 1.1 & echo.
echo cpuThreads used: '%cpuThreads%'
if not "%cpuThreads%" GTR "1" (echo cpuThreads not defined, enter or hardcode in script & set /p "cpuThreads=cpuThreads? [1-64]")
:HYBRIDFOLDER_CHK
call :REMQUOT hybridFolder %hybridFolder%
call :CHECK_EXIST hybridFolder "%hybridFolder%"
if %checkExist%==0 call :REMQUOT hybridFolder %hybridFolder%
if not exist "%hybridFolder%" goto :HYBRIDFOLDER_CHK
echo hybridFolder: '%hybridFolder%'
:ORIGINALVIDEO_CHK
call :REMQUOT originalVideo %originalVideo%
call :CHECK_EXIST originalVideo "%originalVideo%"
if %checkExist%==0 call :REMQUOT originalVideo %originalVideo%
if not exist "%originalVideo%" goto :ORIGINALVIDEO_CHK
echo originalVideo: '%originalVideo%'
:COMPARINGVIDEO_CHK
call :REMQUOT comparingVideo %comparingVideo%
call :CHECK_EXIST comparingVideo %comparingVideo%
if %checkExist%==0 call :REMQUOT comparingVideo %comparingVideo%
if not exist "%comparingVideo%" goto :COMPARINGVIDEO_CHK
echo comparingVideo: '%comparingVideo%'
for /f "tokens=1 delims=" %%a in ("%comparingVideo%") do (set "comparingVideoFname=%%~na")
cls
echo.
echo originalVideo: '%originalVideo%' comparingVideoFname: '%comparingVideoFname%'
echo.
echo VMAF (cpu intensive), SSIM and PSNR will be calculated with ffmeg, progress can be seen in logfiles
timeout 3
color 0c
echo %time% calculating VMAF score without scaling resolution (easy way)...
"%hybridFolder%\64bit\ffmpeg.exe" -i "%comparingVideo%" -i "%originalVideo%" -lavfi libvmaf="n_threads=%cpuThreads%:log_fmt=csv:log_path='%comparingVideoFname%_VMAF_results.txt'" -f null - 2>"%comparingVideoFname%_VMAF.log"
REM Alternative more complex way with variables for ffmpeg to calculate VMAF, at least 'scale' or one other option must be defined in stream [0:v] and stream [1:v]
REM "%hybridFolder%\64bit\ffmpeg.exe" -i "%comparingVideo%" -i "%originalVideo%" -filter_complex "[0:v]scale=1920x808[main];[1:v]scale=1920x808[ref];[main][ref]libvmaf=n_threads=%cpuThreads%:feature='name=psnr':feature='name=ssim':feature='name=psnr':log_fmt=csv:log_path='%comparingVideoFname%_VMAF_results.txt'" -f null - 2>"%cd%\%comparingVideoFname%_VMAF.log"
REM Another way with variables for ffmpeg to calculate VMAF with phone_model, which results in higher score and absolute path for the logfile
REM "%hybridFolder%\64bit\ffmpeg.exe" -threads 8 -i "%comparingVideo%" -i "%originalVideo%" -filter_complex "[0:v]scale=1920x1080:flags=bicubic,format=pix_fmts=yuv444p,fps=fps=50[main];[1:v]scale=1920x1080:flags=bicubic,format=pix_fmts=yuv444p,fps=fps=50[ref];[main][ref]libvmaf=n_threads=%cpuThreads%:feature='name=psnr':phone_model=1:log_fmt=csv:log_path='C\:/%comparingVideoFname%_VMAF_results.txt'" -f null - >"%comparingVideoFname%_VMAF.log"
echo %time% calculating SSIM score...
"%hybridFolder%\64bit\ffmpeg.exe" -i "%comparingVideo%" -i "%originalVideo%" -lavfi ssim="f='%comparingVideoFname%_SSIM_results.txt'" -f null - 2>"%cd%\%comparingVideoFname%_SSIM.log"
echo %time% calculating PSNR score...
"%hybridFolder%\64bit\ffmpeg.exe" -i "%comparingVideo%" -i "%originalVideo%" -lavfi psnr="f='%comparingVideoFname%_PSNR_results.txt'" -f null - 2>"%cd%\%comparingVideoFname%_PSNR.log"
echo.
color 07
echo %time% done...
pause
EXIT
:REMQUOT
set %1=%~2
goto :EOF
:CHECK_EXIST
set "checkExist=0"
echo.
if not exist "%~2" (
echo %~1 '%~2' doesn't exist, drag 'n drop or hardcode in script!
set /p "%~1=%~1?"
) else (set "checkExist=1")
goto :EOF