3 ms·
For anyone disappointed that Handbrake doesn't allow you to specify a final file size and automagically figure out the rest, calculating this is straightforward
by CharlesW 3y ago
For anyone disappointed that Handbrake doesn't allow you to specify a final file size and automagically figure out the rest, calculating this is straightforward.
average bitrate [kbps] = target size [kilobits] ÷ length [seconds]
Example: You have 2'48" file that you need to be 5GB or less.
- 2'48" is 10,080s
- 5GB = 40,000,000 kb
- average bitrate = 40,000,000 kb ÷ 10,080s = 3,968 kbps
- If audio is 256 kbps, average video bitrate should be 3,712 kbps or less
If anyone from the Handbrake team is reading, thank you for all of your work on Handbrake. <3
- deleted 3y ago[deleted]
- abdusco 3y agoThis calculation only works if you encode at constant bitrate. I usually encode at constant quality. The output size heavily depends on the input video. So, I wrote a wrapper in python that parses the HandbrakeCLI output estimates the final size based on percent completed & the current output file size. Then I can stop early if I realize the file is gonna be huge / the output quality is so shitty that I have to bump the quality factor.
- CharlesW 3y ago> This calculation only works if you encode at constant bitrate. This will need to be your average bitrate over the entire file, but the bitrate doesn’t have to be constant. It can (and ideally should) vary widely between static scenes and action sequences, for example.
- illiac786 3y agoAverage bitrate would only be possible with a 2pass encoding though, I believe.