[FFmpeg-user] calculating size of encoded video

John Saturday stozher at gmail.com
Sat Feb 25 23:58:30 CET 2012


Hi Carlo,

Video bitrate for MP4 (H264):

video_bitrate = q * With * Height * Framerate / 1000 [kbps]

q = 0.14 to 0.16  (I have prefer in my works quality 0.18)

time * ( video_bitrate + audio_bitrate) / (8*1024) = size [MB]

8 bits per byte 1024 - from kilobits to megabytes

>From your example command:

video_bitrate = 0.18*320*240*(30/1.001)/1000 = 414.31

414.31/40 = 10.36 ~ 10 -> 10*40 = 400 kbps

video bitrate: "-b:v 400k"
audio bitrate: "-a:b 128k"

30 min MP4: (30*60)*(400+128)/(8*1024) = 116 MB

That's all formulas...


More information about the ffmpeg-user mailing list