Ɛ> Oh look, my first repo ❤
Rusty_Shackleford/FitCheck: A bash and powershell wrapper for FFmpeg that scales CRF to hit a specific size limit
codeberg.org/Rusty_Shackleford…
Works anywhere FFmpeg is available
Video demonstration in readme
#bash #powershell #wrapper #script #loops #codeberg #git #unlicense #video #editing #encoding #transcoding #tool #utility #fediverse #cdn #peertube #windows #linux #macos #ffmpeg #bitrate #videoediting #render

jwz
in reply to Rusty Shackleford • • •So... having the same goal, I originally did something like what you did (multiple -crf passes) but eventually decided that a more accurate and much faster approach was two-pass encoding using -b:v and a -bufsize corresponding to about 30 sec. Is there some reason you rejected that?
(One tricky bit is that -b:v only applies to video, so you have to subtract the size of the audio channels from the overall target size.)
Rusty Shackleford
in reply to jwz • • •@jwz
Trade off: Gain visual consistency & fidelity for compute.
2-pass is great for a targeting size, but -b:v forces a specific bitrate, which can be overkill for a simple video or starve a complex scene.
Even using -maxrate & -bufsize, 2-pass doesn't have a "floor", still uses more bits on simple frames compared to a CRF.
My script ensures that if the video can look better while staying under the limit, it will.
I'm still learning, video is a beast, and I may have misconceptions.
Rusty Shackleford
in reply to jwz • • •Also, my script finalizes your video with a single pass, the previous CRF runs are tests against a segment of video, checks the size, does some math, and if the projected size is over 40mb it bumps CRF again.