From 304c3aace09cf8a96ec381dabc21725398e87b55 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 1 Jan 2019 14:10:47 +0200 Subject: [PATCH] Use FFMpeg instead of Avconv --- .../java/eu/svjatoslav/meviz/encoder/FormatsRegistry.java | 4 ++-- .../encoder/converters/{AvconvAudio.java => FFMpegAudio.java} | 4 ++-- .../encoder/converters/{AvconvVideo.java => FFMpegVideo.java} | 4 ++-- src/main/java/eu/svjatoslav/meviz/grabmemcard/Main.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/main/java/eu/svjatoslav/meviz/encoder/converters/{AvconvAudio.java => FFMpegAudio.java} (91%) rename src/main/java/eu/svjatoslav/meviz/encoder/converters/{AvconvVideo.java => FFMpegVideo.java} (97%) diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/FormatsRegistry.java b/src/main/java/eu/svjatoslav/meviz/encoder/FormatsRegistry.java index 0ceffeb..b106cba 100755 --- a/src/main/java/eu/svjatoslav/meviz/encoder/FormatsRegistry.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/FormatsRegistry.java @@ -21,7 +21,7 @@ public class FormatsRegistry { public FormatsRegistry() { // video conversion registerEncoder(new Ffmpeg2theora()); - registerEncoder(new AvconvVideo()); + registerEncoder(new FFMpegVideo()); // image conversion registerEncoder(new Convert()); @@ -32,7 +32,7 @@ public class FormatsRegistry { // audio conversion registerEncoder(new Ogg2Wav()); registerEncoder(new Flac()); - registerEncoder(new AvconvAudio()); + registerEncoder(new FFMpegAudio()); registerEncoder(new Midi2Wav()); } diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvAudio.java b/src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegAudio.java similarity index 91% rename from src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvAudio.java rename to src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegAudio.java index ae6cd28..11a787b 100755 --- a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvAudio.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegAudio.java @@ -14,7 +14,7 @@ import eu.svjatoslav.meviz.encoder.EncodingOptions; import java.io.File; import java.util.List; -public class AvconvAudio extends AbstractConverter { +public class FFMpegAudio extends AbstractConverter { private static final String[] SUPPORTED_FORMATS = new String[]{"ogg", "wav", "mp3", "m4a", "flac"}; @@ -24,7 +24,7 @@ public class AvconvAudio extends AbstractConverter { final String codecParams = "-b:a 192k"; - return "avconv -i \"" + inputFile.getAbsolutePath() + "\" " + return "ffmpeg -i \"" + inputFile.getAbsolutePath() + "\" " + codecParams + " \"" + targetFile.getAbsolutePath() + "\""; } diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java b/src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegVideo.java similarity index 97% rename from src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java rename to src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegVideo.java index e8ed780..3cc3da9 100644 --- a/src/main/java/eu/svjatoslav/meviz/encoder/converters/AvconvVideo.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/converters/FFMpegVideo.java @@ -15,7 +15,7 @@ import eu.svjatoslav.meviz.encoder.EncodingOptions; import java.io.File; import java.util.List; -public class AvconvVideo extends AbstractConverter { +public class FFMpegVideo extends AbstractConverter { private String constructCodecParamsString(final EncodingOptions options, final int videoBitrate, final int audioBitrate, @@ -111,7 +111,7 @@ public class AvconvVideo extends AbstractConverter { codecParams.append(constructCodecParamsString(options, videoBitrate, audioBitrate, videoCodec, audioCodec)); - return "avconv -i \"" + inputFile.getAbsolutePath() + "\" " + return "ffmpeg -i \"" + inputFile.getAbsolutePath() + "\" " + codecParams.toString() + "\"" + targetFile.getAbsolutePath() + "\""; } diff --git a/src/main/java/eu/svjatoslav/meviz/grabmemcard/Main.java b/src/main/java/eu/svjatoslav/meviz/grabmemcard/Main.java index 4000e7e..aa8c42b 100755 --- a/src/main/java/eu/svjatoslav/meviz/grabmemcard/Main.java +++ b/src/main/java/eu/svjatoslav/meviz/grabmemcard/Main.java @@ -17,7 +17,7 @@ import eu.svjatoslav.meviz.encoder.EncodingOptions; import eu.svjatoslav.meviz.encoder.EncodingPlan; import eu.svjatoslav.meviz.encoder.EncodingTask; import eu.svjatoslav.meviz.encoder.converters.AbstractConverter; -import eu.svjatoslav.meviz.encoder.converters.AvconvVideo; +import eu.svjatoslav.meviz.encoder.converters.FFMpegVideo; import java.io.File; import java.io.IOException; @@ -94,7 +94,7 @@ public class Main implements Module { final File targetDirectory = getTargetDirectory(); targetDirectory.mkdirs(); - final AbstractConverter converter = new AvconvVideo(); + final AbstractConverter converter = new FFMpegVideo(); final EncodingPlan encodingPlan = new EncodingPlan(); final String userName = System.getProperty("user.name"); -- 2.20.1