Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mediaconch_plugin4rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
mediaconch_plugin4rosetta
Commits
bda17832
Commit
bda17832
authored
3 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- added getProfile()
- improved main-output
parent
bfa6ddd6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/slub/rosetta/dps/repository/plugin/SLUBTechnicalMetadataExtractorMediaConchPlugin.java
+41
-7
41 additions, 7 deletions
...lugin/SLUBTechnicalMetadataExtractorMediaConchPlugin.java
with
41 additions
and
7 deletions
java/org/slub/rosetta/dps/repository/plugin/SLUBTechnicalMetadataExtractorMediaConchPlugin.java
+
41
−
7
View file @
bda17832
...
...
@@ -34,6 +34,8 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.io.OutputStreamWriter
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
...
...
@@ -81,6 +83,18 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
);
}
@Override
public
String
getProfile
()
{
String
xmlstring
=
""
;
try
{
xmlstring
=
Files
.
readString
(
Path
.
of
(
this
.
mediaconch_profile_path
));
}
catch
(
IOException
e
)
{
//log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e);
System
.
out
.
println
(
"ERROR: mediaconch profile not available, path="
+
this
.
mediaconch_profile_path
+
", "
+
e
.
getMessage
());
}
return
xmlstring
;
}
@Override
public
void
extract
(
String
filePath
)
throws
Exception
{
if
(
StringUtils
.
isEmptyString
(
mediaconch_binary_path
))
{
...
...
@@ -261,11 +275,7 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
return
Collections
.
unmodifiableList
(
extractionErrors
);
}
/* following list is build using:
(find ./ -name "*.mkv" -exec ffprobe -print_format flat -v error -show_format -show_streams -show_entries stream=r_frame_rate \{\} \; ) \
| cut -d "=" -f 1 | sort | uniq \
| sed -e "s/\(.*\)/available.add(\"\1\");/g"
*/
/* base is the property file from original mediainfo-plugin of FL woorking group */
@Override
public
List
<
String
>
getSupportedAttributeNames
()
{
//return new ArrayList<String>(attributes.keySet());
...
...
@@ -399,8 +409,8 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
}
@Override
public
Integer
getImageCount
()
{
return
1
;
//baseline tiff holds exact one
public
Integer
getImageCount
()
{
// only relevant for image extractors
return
0
;
}
@Override
...
...
@@ -418,6 +428,7 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
initp
.
put
(
"mediaconch_profile_path"
,
"/etc/mediaconch/profile.xml"
);
initp
.
put
(
"mediainfo_binary_path"
,
"/usr/bin/mediainfo"
);
plugin
.
initParams
(
initp
);
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"Agent: '"
+
plugin
.
getAgent
()
+
"'"
);
System
.
out
.
println
();
for
(
String
file
:
args
)
{
...
...
@@ -429,6 +440,29 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
System
.
out
.
println
(
"RESULT: "
+
plugin
.
isValid
());
System
.
out
.
println
(
"ERRORMESSAGE: "
+
plugin
.
getExtractionErrors
());
}
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getAgentName:"
);
System
.
out
.
println
(
plugin
.
getAgentName
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getAgent:"
);
System
.
out
.
println
(
plugin
.
getAgent
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getSupportedAttributeNames:"
);
System
.
out
.
println
(
plugin
.
getSupportedAttributeNames
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getFormatName:"
);
System
.
out
.
println
(
plugin
.
getFormatName
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getFormatVersion:"
);
System
.
out
.
println
(
plugin
.
getFormatVersion
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getMimeType:"
);
System
.
out
.
println
(
plugin
.
getMimeType
());
System
.
out
.
println
(
"----------------------------------"
);
System
.
out
.
println
(
"getProfile:"
);
System
.
out
.
println
(
plugin
.
getProfile
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment