title: How to correctly estimate mp4 H.264 video size?
body: <p>Basically, video size is calculated:</p>
  
  <pre><code>Video Size per Second (bps)
  =
  Frame Rate (fps)
  * Horizontal Pixels
  * Vertical Pixels
  * Bit Depth (bit)
  / Compression Ratio by Codec
  </code></pre>
  
  <p>As I read somewhere, the rule of thumb compression ratio of mp4 video is 50. So for a 720p 24fps 24bit color video (neglecting the audio size for now), the file size is calculated to:</p>
  
  <pre><code>24(fps) * 1280 * 720 * 24(bit) / 50
  = 10616832 (bps) = 10.125 (Mbps)
  </code></pre>
  
  <p>If you calculate the video size of a 1 hour with the above bit rate, you'd get:</p>
  
  <pre><code>10.125(Mbps) * 3600(s) / 8(bit per Byte) / 1024(MB per GB)  = 4.449GB
  </code></pre>
  
  <p>... which doesn't seems right at all. From daily experience, we know that a 1 hour long 720p H.264 mp4 is probably around 1 GB or less. The difference is almost a factor of 5.</p>
  
  <p>I know this formula doesn't include <strong>key-frame interval</strong> to calculation, which from I read matters a lot. I also know the compression ratio here is just a rule of thumb. There might also be factors that I didn't take into consideration. The problem is I have no idea how to fit in these missing factors.</p>
  
  <p>So, is there other way we can more accurately estimate a video size?</p>