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