phoboslab/jsmpeg-vnc

Estimating bitrate

roelvz opened this issue · 2 comments

The code uses the width * 1500 to estimate the bitrate. Could you explain why this would be a good estimate?
if( !bit_rate ) { bit_rate = out_width * 1500; } // estimate bit rate based on output size

It's just a guess to provide some default. Higher resolutions require higher bitrates and 1500 bits per pixel worked reasonably well for a few resolutions I tested this with. Of course this completely ignores the image height, which may be problem for portrait-orientation.

I believe I googled for the right way to set a reasonable bitrate for MPEG1 back then, but couldn't find anything. Maybe dig into the ffmpeg source to see how they do it!?

Thanks for the quick answer.

I'm sure there are much more sophisticated estimate methods, but this seems to work fine for me. I was just curious what was the reasoning behind the 1500.