Skip to content
Snippets Groups Projects
Commit 5f17fc73 authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- disabled metadata extraction (with ffprobe)

parent 92999ddb
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@
<x_options></x_options>
</x_field>
<!--
<x_field>
<field_name>ffprobe_binary_path</field_name>
<label>Path to ffprobe</label>
......@@ -44,6 +45,7 @@
<css_class>width40</css_class>
<x_options></x_options>
</x_field>
-->
</x_fields>
</fr:x_form>
</pl:initParameters>
......
......@@ -41,7 +41,7 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
private String mediaconch_binary_path;
private String mediaconch_profile_path;
private String ffprobe_binary_path;
//~ private String ffprobe_binary_path;
private List<String> extractionErrors = new ArrayList<String>();
private List<String> validationLog = new ArrayList<String>();
......@@ -63,12 +63,12 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
public void initParams(Map<String, String> initp) {
this.mediaconch_binary_path = initp.get("mediaconch_binary_path").trim();
this.mediaconch_profile_path = initp.get("mediaconch_profile_path").trim();
this.ffprobe_binary_path = initp.get("ffprobe_binary_path").trim();
//~ this.ffprobe_binary_path = initp.get("ffprobe_binary_path").trim();
System.out.println("SLUBTechnicalMetadataExtractorMediaConchPlugin instantiated with "
+ " mediaconch_binary_path=" + mediaconch_binary_path
+ " mediaconch_profile_path=" + mediaconch_profile_path
+ " ffprobe_binary_path=" + ffprobe_binary_path
//~ + " ffprobe_binary_path=" + ffprobe_binary_path
);
}
......@@ -99,10 +99,10 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
//log.error("No mediaconch_config_path defined. Please set the plugin parameter to hold your mediaconch_config_path.");
throw new Exception("mediaconch_profile_path not found");
}
if (StringUtils.isEmptyString(ffprobe_binary_path)) {
//~ if (StringUtils.isEmptyString(ffprobe_binary_path)) {
throw new Exception("ffprobe_binary_path (part of ffmpeg) not found");
}
//~ throw new Exception("ffprobe_binary_path (part of ffmpeg) not found");
//~ }
// mediaconch validation
......@@ -140,30 +140,30 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
the separator is "="
*/
try {
String execstring = this.ffprobe_binary_path + " -print_format flat -v error -show_format -show_streams -show_entries stream=r_frame_rate" + filePath;
System.out.println("executing: " + execstring);
Process p = Runtime.getRuntime().exec(execstring);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line=reader.readLine();
String response="";
while (line != null) {
System.out.println(line);
parse_ffprobe_flat_output(line.trim());
response+=line;
line = reader.readLine();
}
attributes.put("ffprobe-log", response.trim());
} catch (IOException e) {
//log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e);
} catch (InterruptedException e) {
e.printStackTrace();
}
//~ try {
//~ String execstring = this.ffprobe_binary_path + " -print_format flat -v error -show_format -show_streams -show_entries stream=r_frame_rate" + filePath;
//~ System.out.println("executing: " + execstring);
//~ Process p = Runtime.getRuntime().exec(execstring);
//~ p.waitFor();
//~ BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
//~ String line=reader.readLine();
//~ String response="";
//~ while (line != null) {
//~ System.out.println(line);
//~ parse_ffprobe_flat_output(line.trim());
//~ response+=line;
//~ line = reader.readLine();
//~ }
//~ attributes.put("ffprobe-log", response.trim());
//~ } catch (IOException e) {
//~ //log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e);
//~ } catch (InterruptedException e) {
//~ e.printStackTrace();
//~ }
}
public String getAgentName()
......@@ -381,7 +381,7 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
Map<String, String> initp = new HashMap<String, String>();
initp.put( "mediaconch_binary_path", "/usr/bin/mediaconch");
initp.put( "mediaconch_profile_path", "/etc/mediaconch/profile.xml");
initp.put( "ffprobe_binary_path", "/usr/bin/ffprobe");
//~ initp.put( "ffprobe_binary_path", "/usr/bin/ffprobe");
plugin.initParams( initp );
System.out.println("Agent: '" + plugin.getAgent() + "'");
System.out.println();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment