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

- handle all Rosetta DNX properties requiring a number value if not set by mediainfo

parent 8f3a962c
No related branches found
No related tags found
1 merge request!1Fix handle all dnx properties of type number
...@@ -68,6 +68,23 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract ...@@ -68,6 +68,23 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
private boolean isDifferentProfile = true; private boolean isDifferentProfile = true;
private final Map<String,String> attributes = new HashMap<>(); private final Map<String,String> attributes = new HashMap<>();
//static final ExLogger log = ExLogger.getExLogger(SLUBTechnicalMetadataExtractorMediaConchPlugin.class, ExLogger.VALIDATIONSTACK); //static final ExLogger log = ExLogger.getExLogger(SLUBTechnicalMetadataExtractorMediaConchPlugin.class, ExLogger.VALIDATIONSTACK);
private final static ArrayList<String> dnxPropertiesTypeNumber = new ArrayList<String>() {{
// HINT: based on FL 7.1100 mappings for mediainfo (https://github.com/rosetta-format-library/RosettaFormatLibrary/releases/tag/7.1100)
add("audio.duration");
add("audio.sampling_rate");
add("audio.stream_size");
add("general.audio_count");
add("general.menu_count");
add("general.other_count");
add("general.stream_size");
add("general.text_count");
add("general.video_count");
add("video.bit_rate");
add("video.display_aspect_ratio");
add("video.duration");
add("video.extra.max_slices_count");
add("video.frame_count");
}};
/** constructor */ /** constructor */
public SLUBTechnicalMetadataExtractorMediaConchPlugin() { public SLUBTechnicalMetadataExtractorMediaConchPlugin() {
...@@ -357,16 +374,11 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract ...@@ -357,16 +374,11 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
if (attributes.containsKey(attribute)) { if (attributes.containsKey(attribute)) {
return attributes.get(attribute); return attributes.get(attribute);
} }
/* workaround for no-match, because // HINT: Rosetta expects a number of specific DNX properties instead of text
Rosetta expects NUMBER value if key ends with "Count", example: if (dnxPropertiesTypeNumber.contains( attribute.toString() )) {
mediainfo.track.General.MenuCount return "0"; // type NUMBER
mediainfo.track.General.OtherCount
mediainfo.track.General.TextCount
*/
if (attribute.endsWith("Count")) {
return "0";
} }
return "not found"; return "not found"; // type TEXT & STRING
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment