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?

  • Encoding to a specific size is hard, sometimes, data is just not more compressabale than it is already. Try to aim below the bitrate that you want. If it doesn't at all want to go lower, you'll have to lower resolution, bitdepth or framerate Mar 4, 2022 at 9:11
  • @TimothyLukasH. It does go lower when I aim for lower sizes, so it's definitely compressable.
    – Anton
    Mar 4, 2022 at 10:57
  • Then you'll have to just set a lower target. There's no way to foce VBR to a specific size. Otherwise you'll have to use CBR (Constant Bitrate) but that may be negative on image quality. Mar 5, 2022 at 16:37
  • Quality is not that much of a deal, honestly. I'm fine with that.
    – Anton
    Mar 7, 2022 at 2:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.