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
private boolean isDifferentProfile = true;
private final Map<String,String> attributes = new HashMap<>();
//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 */
public SLUBTechnicalMetadataExtractorMediaConchPlugin() {
......@@ -357,16 +374,11 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
if (attributes.containsKey(attribute)) {
return attributes.get(attribute);
}
/* workaround for no-match, because
Rosetta expects NUMBER value if key ends with "Count", example:
mediainfo.track.General.MenuCount
mediainfo.track.General.OtherCount
mediainfo.track.General.TextCount
*/
if (attribute.endsWith("Count")) {
return "0";
// HINT: Rosetta expects a number of specific DNX properties instead of text
if (dnxPropertiesTypeNumber.contains( attribute.toString() )) {
return "0"; // type NUMBER
}
return "not found";
return "not found"; // type TEXT & STRING
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment