I have this script which I am working on to encode a video into smaller file size:
echo off set arg1=%1 set _filename=%~n1 set _extension=%~x1 shift ffmpeg -i %arg1% -c:v h264_amf -crf 18 -preset slow -c:a aac -b:a 128k -movflags +faststart -vf scale=-2:480,format=yuv420p %_filename%.480P%_extension%
It accepts one argument which is the video file and outputs a new file.
Testing with a video file size of 815,050 KB the output was even bigger 1,554,650 KB specifically.
h264_amf for the reason I am encoding on a machine with AMD GPU on Windows.
My goal here is to convert a ton of videos to about 500MB (or lower if the input size is lower than 500MB) each regardless of the quality since it will be played in a AI-enhancing video player so quality of the output is not important.
What's the correct ffmpeg parameters to achieve this?