public String getQualityFormat(String quality) { MPEG2EncodingParams params = MPEG2EncodingParams.getQuality(quality); if (params != null && params.outputstreamtype != null) { switch (params.outputstreamtype.intValue()) { case MPEG2EncodingParams.STREAMOUTPUT_CUSTOM_DIVX: return "DivX"; case MPEG2EncodingParams.STREAMOUTPUT_CUSTOM_MPEG4: return "MPEG-4"; case MPEG2EncodingParams.STREAMOUTPUT_DVD: return "DVD"; case MPEG2EncodingParams.STREAMOUTPUT_MPEG1: return "MPEG-1"; case MPEG2EncodingParams.STREAMOUTPUT_PROGRAM: if (quality.startsWith("SVCD")) return "SVCD"; return "MPEG-2 PS"; case MPEG2EncodingParams.STREAMOUTPUT_TRANSPORT: return "MPEG-2 TS"; case MPEG2EncodingParams.STREAMOUTPUT_VCD: return "VCD"; default: return "MPEG-2"; } } return "MPEG-2"; }
public long getQualityOverallBitrate(String quality) { MPEG2EncodingParams params = MPEG2EncodingParams.getQuality(quality); if (params != null && params.overallbitrate != null && params.overallbitrate.intValue() > 0) { return params.overallbitrate.intValue(); } else if (params != null) { int totalBitrate = 0; if (params.videobitrate != null) totalBitrate += params.videobitrate.intValue(); if (params.audiobitrate != null) totalBitrate += params.audiobitrate.intValue() * 1000; // For stream overhead totalBitrate = Math.round(totalBitrate * 1.05f); if (totalBitrate > 1000) return totalBitrate; else return 4000000; } else return 4000000; }