@echo off
set BENCHNAME=%1
if %BENCHNAME%x==x goto Syntax
goto Proceed

:Syntax
echo Start this benchmark by executing: run #unique string for filename#
echo or:
set /P BENCHNAME=Enter the unique string (e.g. CPU name) now: %=%
set UNIQUE_FILENAME="%~dp0\H264Benchmark_%COMPUTERNAME%_%BENCHNAME%.txt"

:Proceed
echo ###################### > %UNIQUE_FILENAME%
echo ### H264 benchmark ### >> %UNIQUE_FILENAME%
echo ###################### >> %UNIQUE_FILENAME%
echo Result multithreaded: >> %UNIQUE_FILENAME%
echo Result singlethreaded: >> %UNIQUE_FILENAME%
echo. >> %UNIQUE_FILENAME%

echo ### System information ### >> %UNIQUE_FILENAME%
set PROCESSOR_IDENTIFIER >> %UNIQUE_FILENAME%
set PROCESSOR_ARCHITECTURE >> %UNIQUE_FILENAME%
set NUMBER_OF_PROCESSORS >> %UNIQUE_FILENAME%
echo. >> %UNIQUE_FILENAME%

echo ########################## >> %UNIQUE_FILENAME%
echo ### Start of benchmark ### >> %UNIQUE_FILENAME%
echo. >> %UNIQUE_FILENAME%
echo Performing silent benchmark. Please stand by...

echo ########################### >> %UNIQUE_FILENAME%
echo ### Start multithreaded ### >> %UNIQUE_FILENAME%
echo ### %time%         ### >> %UNIQUE_FILENAME%
"%~dp0\ffmpeg\ffmpeg.exe" -i H264Test.mov -coder 1 -level 42 -crf 24 -flags +loop -me_method hex -g 50 -sc_threshold 30 -vf hqdn3d -acodec libvo_aacenc -ab 128k -qmin 2 -qmax 28 -vcodec libx264 -pix_fmt yuvj422p -f mp4 -y Output.mp4 2>> %UNIQUE_FILENAME%
echo ### End multithreaded ### >> %UNIQUE_FILENAME%
echo ### %time%       ### >> %UNIQUE_FILENAME%
echo ######################### >> %UNIQUE_FILENAME%
echo. >> %UNIQUE_FILENAME%

echo ############################ >> %UNIQUE_FILENAME%
echo ### Start singlethreaded ### >> %UNIQUE_FILENAME%
echo ### %time%          ### >> %UNIQUE_FILENAME%
"%~dp0\ffmpeg\ffmpeg.exe" -i H264Test.mov -coder 1 -level 42 -crf 24 -flags +loop -me_method hex -g 50 -sc_threshold 30 -vf hqdn3d -acodec libvo_aacenc -ab 128k -qmin 2 -qmax 28 -vcodec libx264 -pix_fmt yuvj422p -f mp4 -y -threads 1 Output.mp4 2>> %UNIQUE_FILENAME%
echo ### End singlethreaded ### >> %UNIQUE_FILENAME%
echo ### %time%        ### >> %UNIQUE_FILENAME%
echo ########################## >> %UNIQUE_FILENAME%
echo. >> %UNIQUE_FILENAME%

echo ### End of benchmark ### >> %UNIQUE_FILENAME%
echo ######################## >> %UNIQUE_FILENAME%
goto End

:End
