2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.encoder.converters;
14 import eu.svjatoslav.meviz.encoder.EncodingOptions;
16 public class Mkv2Mp4 implements Converter {
19 public String getCommand(final File inputFile, final File targetFile,
20 final EncodingOptions options) {
25 switch (options.videoBitrate) {
42 throw new RuntimeException("Video bitrate: " + options.videoBitrate
43 + " is not supported.");
47 final StringBuffer codecParams = new StringBuffer();
49 codecParams.append("-acodec libmp3lame -vcodec libx264");
51 codecParams.append(" -b " + videoBitrate + "k");
52 codecParams.append(" -b:a " + audioBitrate + "k");
54 if (options.deinterlace) {
55 codecParams.append(" -filter:v yadif");
58 return "avconv -i \"" + inputFile.getAbsolutePath() + "\" "
59 + codecParams.toString() + " \"" + targetFile.getAbsolutePath()
64 public String getSourceFileExtension() {
69 public String getTargetFileExtension() {
74 public boolean isTerminalMandatory() {