2 * Meviz - Various tools collection to work with multimedia. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
6 package eu.svjatoslav.meviz.encoder;
8 import eu.svjatoslav.commons.cli_helper.parameter_parser.ArgumentCount;
9 import eu.svjatoslav.commons.cli_helper.parameter_parser.Parameter;
11 public class BitrateParameter extends Parameter<BitrateParameter.Bitrate, BitrateParameter> {
13 public BitrateParameter(final String description) {
14 super(description, ArgumentCount.SINGLE);
18 public String describeFormat() {
19 return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY / LOSSLESS]";
23 public Bitrate getValue() {
24 return Bitrate.valueOf(arguments.get(0).toUpperCase());
28 public boolean validate(final String value) {
30 Bitrate.valueOf(value.toUpperCase());
31 } catch (final IllegalArgumentException exception) {
39 NONE, LOW, MEDIUM, HIGH, COPY, LOSSLESS