>>21249743for compressing to a target filesize you absolutely need to use 2-pass and target the bitrate that would give you just under your target filesize
if you target 3mb (max 4chan will accept for webms) you have 24000k to spend, if you target 4mb you have 36000k to spend. tell ffmpeg to aim for (24000/num seconds)k
e.g. a 3:05 clip is is 185 seconds so it would be floor(24000/185)k or 129k. also note 4chan will only accept webms up to 200 seconds long so your max is 3m20s
use -deadline best to sacrifice encode speed for best possible compression
so something like
ffmpeg -y -i input.mp4 -c:v libvpx -b:v XXXk -deadline best -pass 1 out.webm
ffmpeg -y -i input.mp4 -c:v libvpx -b:v XXXk -deadline best -pass 2 out.webm
This will produce a useless mess unless you also reduce the amount of video information with filters like crop, scale, and especially framerate. something like -vf "scale=-1:480,fps=fps=24" to make it a 480p video at 24fps will cut a 1920x1080 video at 60fps down to one twelfth the amount of video data that needs to be compressed