NullParameter testParameter = parser.add(
new NullParameter("Simulate file encoding.")).addAliases("-t",
- "--test");
+ "--test");
NullParameter recursiveParameter = parser.add(
new NullParameter("Enable recursive mode.")).addAliases("-r",
NullParameter forPortableParameter = parser.add(
new NullParameter("Encode for portable player.")).addAliases("-p",
- "--portable");
+ "--portable");
StringParameters inputPatternParameter = parser
.add(new StringParameters("File input pattern."))
BitrateParameter audioBitrateParameter = parser.add(
new BitrateParameter("Audio bitrate")).addAliases("-a",
- "--audio-bitrate");
+ "--audio-bitrate");
/**
* @return {@link EncodingOptions} if commandline arguments were
options.forPortablePlayer = forPortableParameter.isParameterSpecified();
if (videoBitrateParameter.isParameterSpecified())
- try {
- options.setVideoBitrate(videoBitrateParameter.getValue());
- } catch (final Exception e) {
- System.out
- .println("Invalid video bitrate. Valid values are: LOW, MEDIUM, HIGH.");
- return null;
- }
+ options.setVideoBitrate(videoBitrateParameter.getValue());
+
+ if (audioBitrateParameter.isParameterSpecified())
+ options.setAudioBitrate(audioBitrateParameter.getValue());
return options;
}