From: Svjatoslav Agejenko Date: Wed, 24 Dec 2014 20:17:50 +0000 (+0200) Subject: possibility to remove audio from video X-Git-Tag: meviz-1.0~38 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=489059f9f31e2f09aa09ae255fb33ad370fa8463;p=meviz.git possibility to remove audio from video --- diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java b/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java index 18c3a2c..ec88b61 100755 --- a/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java @@ -15,7 +15,7 @@ import eu.svjatoslav.commons.commandline.parameterparser.Parameter; public class BitrateParameter extends Parameter { static public enum bitrate { - LOW, MEDIUM, HIGH, COPY + NONE, LOW, MEDIUM, HIGH, COPY } public BitrateParameter(final String description) { @@ -24,7 +24,7 @@ public class BitrateParameter extends Parameter { @Override public String describeFormat() { - return "Target bitrate [LOW / MEDIUM / HIGH / COPY]"; + return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY ]"; }; @Override 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 87a7880..f0d80bf 100644 --- a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java @@ -23,8 +23,12 @@ public class AvconvVideo extends AbstractConverter { final StringBuffer codecParams, final String videoCodec, final String audioCodec) { - codecParams.append("-acodec " + audioCodec + " -vcodec " + videoCodec - + " "); + if (audioCodec == null) + codecParams.append("-an "); + else + codecParams.append("-acodec " + audioCodec + " "); + + codecParams.append("-vcodec " + videoCodec + " "); if (videoBitrate != -1) codecParams.append("-b " + videoBitrate + "k "); @@ -50,6 +54,9 @@ public class AvconvVideo extends AbstractConverter { case COPY: return -1; + case NONE: + return -1; + default: throw new RuntimeException("Audio bitrate: " + bitRate + " is not supported."); @@ -75,6 +82,9 @@ public class AvconvVideo extends AbstractConverter { if (options.getAudioBitrate() == bitrate.COPY) audioCodec = "copy"; + if (options.getAudioBitrate() == bitrate.NONE) + audioCodec = null; + if (options.forPortablePlayer) { videoBitrate = 1000; audioBitrate = 128;