INNER CODE UNIT · Java
AudioVideoUtils
microshow/RxFFmpeg · rxffmpeg/src/main/java/io/microshow/rxffmpeg/AudioVideoUtils.java:11
public class AudioVideoUtils {
/**
* 根据视频的宽X高计算出一个合适的码率
*
* @param wxh 宽X高的值
* @return
*/
public static int getFitBitRate(int wxh) {
if (wxh <= 480 * 480) {
return 1000 * 1024;
} else if (wxh <= 640 * 480) {
return 1500 * 1024;
} else if (wxh <= 800 * 480) {
return 1800 * 1024;
} else if (wxh <= 960 * 544) {
return 2 * 1024 * 1024;
} else if (wxh <= 1280 * 720) {