X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fmeviz%2Fencoder%2Fconverters%2FAvconvVideo.java;h=12378801d3bd4acd1445cad19493d79fd55c2b7f;hb=e07b29a32091b5291a62158021aed3487ea5cd3a;hp=c63837ad50f1d733a53232d4e74413db218c7b97;hpb=565d9c726de9b50709027f9455d39499a17f4b25;p=meviz.git diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java b/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java index c63837a..1237880 100644 --- a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java @@ -47,27 +47,36 @@ public class AvconvVideo extends AbstractConverter { // convert final StringBuffer codecParams = new StringBuffer(); - codecParams.append("-acodec libmp3lame -vcodec libx264"); + String videoCodec = "libx264 "; - codecParams.append(" -b " + videoBitrate + "k"); - codecParams.append(" -b:a " + audioBitrate + "k"); + if (options.forPortablePlayer) { + videoBitrate = 1000; + audioBitrate = 128; + videoCodec = "libxvid "; + codecParams.append("-s 640x480 "); + } + + codecParams.append("-acodec libmp3lame -vcodec " + videoCodec); + + codecParams.append("-b " + videoBitrate + "k "); + codecParams.append("-b:a " + audioBitrate + "k "); if (options.deinterlace) - codecParams.append(" -filter:v yadif"); + codecParams.append("-filter:v yadif "); return "avconv -i \"" + inputFile.getAbsolutePath() + "\" " - + codecParams.toString() + " \"" + targetFile.getAbsolutePath() + + codecParams.toString() + "\"" + targetFile.getAbsolutePath() + "\""; } @Override public List getSourceFileExtensions() { - return toList("mkv", "mts"); + return toList("mkv", "mts", "mp4", "avi", "mpg", "mpeg", "vob"); } @Override public List getTargetFileExtensions() { - return toList("mp4"); + return toList("mkv", "mts", "mp4", "avi", "mpg", "mpeg", "vob"); } @Override