AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
539 stars 116 forks source link

Possible to predict compressed file size #149

Closed vedraj360 closed 1 year ago

vedraj360 commented 1 year ago

Is it possible to know what will be the size of file after compression before compressing it.

tutankhamen-1 commented 1 year ago

Yes, you can get a fairly accurate estimate. File size in GB = bitrate in Mbps duration in minutes 0.0075

vedraj360 commented 1 year ago

Hi thanks for the reply but can you explain a bit more what is 0.0075 here and duration in minutes how to calculate as it will depend on the device I guess

tutankhamen-1 commented 1 year ago

The duration in minutes refers to the length of the video. You can read more about this formula here:

https://blog.frame.io/2017/03/06/calculate-video-bitrates/

vedraj360 commented 1 year ago

Cool, Thanks for the help. Appreciated 👍