more elegant commandline handling
[meviz.git] / src / main / java / eu / svjatoslav / meviz / encoder / converters / AvconvVideo.java
index db6ab4d..2cda2d8 100644 (file)
@@ -42,7 +42,7 @@ public class AvconvVideo extends AbstractConverter {
                int videoBitrate = -1;
                int audioBitrate = -1;
 
-               switch (options.videoBitrate) {
+               switch (options.getVideoBitrate()) {
                case LOW:
                        videoBitrate = 1000;
                        audioBitrate = 128;
@@ -62,7 +62,7 @@ public class AvconvVideo extends AbstractConverter {
                        break;
 
                default:
-                       throw new RuntimeException("Video bitrate: " + options.videoBitrate
+                       throw new RuntimeException("Video bitrate: " + options.getVideoBitrate()
                                        + " is not supported.");
                }
 
@@ -72,7 +72,7 @@ public class AvconvVideo extends AbstractConverter {
                String videoCodec = "libx264";
                String audioCodec = "libmp3lame";
 
-               if (options.videoBitrate == bitrate.COPY) {
+               if (options.getVideoBitrate() == bitrate.COPY) {
                        videoCodec = "copy";
                        audioCodec = "copy";
                }
@@ -88,8 +88,8 @@ public class AvconvVideo extends AbstractConverter {
                                codecParams, videoCodec, audioCodec);
 
                return "avconv -i \"" + inputFile.getAbsolutePath() + "\" "
-               + codecParams.toString() + "\"" + targetFile.getAbsolutePath()
-               + "\"";
+                               + codecParams.toString() + "\"" + targetFile.getAbsolutePath()
+                               + "\"";
        }
 
        @Override
@@ -99,7 +99,7 @@ public class AvconvVideo extends AbstractConverter {
 
        @Override
        public List<String> getTargetFileExtensions() {
-               return toList("mkv", "mts", "mp4", "avi", "mpg", "mpeg", "vob");
+               return toList("mkv", "mts", "mp4", "avi", "mpg", "mpeg", "vob", "m4v");
        }
 
        @Override