I'm using guide provided at this page to compress videos to specific size with ffmpeg. The sizes I'm aiming are relatively small (8mb wanted compared to 50mb original) and when I'm trying to compress video by inputting the calculated bitrate according to the guide into ffmpeg the result sometimes overshoots the target size and it's not fine for me. One solution could probably be to target sizes smaller (-0.5mb from wanted), but that's not really what I want it to be.
I assume that some bit of file is dedicated to store some metadata which is not important for me. My strategy is to guess what the size of that metadata will be and target the wanted size minus the size of metadata.
Of course, there could be something else that may increase filesize. So, the question is, how to compress video with ffmpeg to target size with more precision?