Use a loop to get from the values:
"width": 1280,
"height": 720
for /f useback^tokens^=2delims^=^,^ %%i in (`
^2^>^&1 ;ffprobe -v quiet -print_format json -show_format -show_streams -i "%~1" ^
^|%__AppDir__%findstr.exe "\"width\": \"height\":" ^|%__AppDir__%findstr.exe [0-9]
Let's say you add the values inside a loop and get:
720
1280
By adding outputs
720 + 1280 = 2000
By adding your limits:
640 + 800 = 1440
Having this, compare with the sum of in a variable and using:
if (condition)else (condition) it is possible to convert your videos:
if outputs gtr limits (convert video file) else do nothing
if 2000 gtr 1440 (ffmpeg ...) else (exit/b)
@echo off && setlocal
cd /d "%~dp0" && for %%i in (*.mp4)do set "_cnt=" & call %:^) "%%~i"
%:^)
if "%~1"=="" (endlocal && exit /b) else for /f useback^tokens^=2delims^=^,^ %%i in (`
^2^>^&1 ;ffprobe -v quiet -print_format json -show_format -show_streams -i "%~1" ^
^|%__AppDir__%findstr.exe "\"width\": \"height\":" ^|%__AppDir__%findstr.exe [0-9]
`)do call set/a "_cnt+=%%i"
if %_cnt% gtr 1440 (
;ffmpeg -i "%~1" -hide_banner -v error -stats -vf scale=640:800 -preset slow -crf 18 ^
".\videos\%~n1.mp4" & echo\File: "%~1" [Done])else echo\File: "%~1" [Skipped] & exit/b
Note that there is no space or other character at the end of the line ending in ^