1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 15:58:52 -05:00

Refactor system exec

This commit is contained in:
Reinhard Pointner 2019-03-15 22:44:39 +07:00
parent ed0aa79f9f
commit 504bb1132d
2 changed files with 9 additions and 1 deletions

View File

@ -20,10 +20,14 @@ import com.cedarsoftware.util.io.JsonWriter;
public class FFProbe implements MediaCharacteristics {
protected String getFFProbeCommand() {
public String getFFProbeCommand() {
return System.getProperty("net.filebot.media.ffprobe", "ffprobe");
}
public String version() throws IOException {
return execute(getFFProbeCommand(), "-show_program_version", "-hide_banner").toString();
}
protected Map<String, Object> parse(File file) throws IOException, InterruptedException {
String[] command = { getFFProbeCommand(), "-show_streams", "-show_format", "-print_format", "json", "-v", "error", file.getCanonicalPath() };

View File

@ -192,6 +192,10 @@ public class AcoustIDClient implements MusicIdentificationService {
return System.getProperty("net.filebot.AcoustID.fpcalc", "fpcalc");
}
public String version() throws IOException {
return execute(getChromaprintCommand(), "-version").toString();
}
public Map<ChromaprintField, String> fpcalc(File file) throws IOException, InterruptedException {
Map<ChromaprintField, String> fields = new EnumMap<ChromaprintField, String>(ChromaprintField.class);