2 * Meviz - Various tools collection to work with multimedia. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
7 package eu.svjatoslav.meviz.encoder;
9 import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
10 import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
12 public class BitrateParameter extends Parameter<BitrateParameter.Bitrate, BitrateParameter> {
14 public BitrateParameter(final String description) {
15 super(description, ArgumentCount.SINGLE);
19 public String describeFormat() {
20 return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY / LOSSLESS]";
24 public Bitrate getValue() {
25 return Bitrate.valueOf(arguments.get(0).toUpperCase());
29 public boolean validate(final String value) {
31 Bitrate.valueOf(value.toUpperCase());
32 } catch (final IllegalArgumentException exception) {
40 NONE, LOW, MEDIUM, HIGH, COPY, LOSSLESS