public class BitrateParameter extends Parameter<BitrateParameter> {
static public enum bitrate {
- LOW, MEDIUM, HIGH, COPY
+ NONE, LOW, MEDIUM, HIGH, COPY
}
public BitrateParameter(final String description) {
@Override
public String describeFormat() {
- return "Target bitrate [LOW / MEDIUM / HIGH / COPY]";
+ return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY ]";
};
@Override
final StringBuffer codecParams, final String videoCodec,
final String audioCodec) {
- codecParams.append("-acodec " + audioCodec + " -vcodec " + videoCodec
- + " ");
+ if (audioCodec == null)
+ codecParams.append("-an ");
+ else
+ codecParams.append("-acodec " + audioCodec + " ");
+
+ codecParams.append("-vcodec " + videoCodec + " ");
if (videoBitrate != -1)
codecParams.append("-b " + videoBitrate + "k ");
case COPY:
return -1;
+ case NONE:
+ return -1;
+
default:
throw new RuntimeException("Audio bitrate: " + bitRate
+ " is not supported.");
if (options.getAudioBitrate() == bitrate.COPY)
audioCodec = "copy";
+ if (options.getAudioBitrate() == bitrate.NONE)
+ audioCodec = null;
+
if (options.forPortablePlayer) {
videoBitrate = 1000;
audioBitrate = 128;