@echo off
chcp 65001 >nul
cd /d "%~dp0"
set "outdir=compressed_%RANDOM%"
mkdir "%outdir%"
echo current folder:%cd%
echo file will saved in:%outdir%
echo processing all mp4 file...
echo.
for %%f in (*.mp4) do (
echo processing: %%f
ffmpeg -i "%%f" -vf "scale=-2:320" -c:v libx264 -crf 28 -preset slow -c:a aac -b:a 64k -movflags +faststart "%outdir%\%%~nf_new%%~xf"
echo.
)
echo.
echo all done!
echo file saved in:%outdir%
pause
Create a Notepad file, paste the content above into it, then save the file with a .bat extension. Place this batch file in your media folder and double-click to run it. Videos will be compressed to 320p (parameters can be adjusted manually). Actual test result: a 1-minute video takes up roughly 1 to 2 megabytes of storage.