Hi,
I had a look at the following issue about video mpegs not being
correctly identified. http://opencast.jira.com/browse/MH-8288
Though the immediate solution was quite simple it raised some
questions about whether mimetype identification was being done correctly
and needs reviewing. I've no experience in this area so please correct me.
The MediaInspectionServiceImpl is meant to make use of Apache Tika for
initial inspection of files. I don't know anything about Tika but it
seemed to attempt to get the mimetype in rather an odd way. The
extractContentType() fn gives the input file as a stream to a Tika
parser which then returns a metadata object from which the mimetype is
obtained by querying the Content type of the httpheader in the meta
data. OK that may work.
However in inspectTrack() which calls extractContentType() there is a
comment saying the library doesn't detect audio and video metadata!?
Indeed in the issue I was looking at it returned application/octet-stream.
The code then defaults to using opencasts own MimeType class which
matches the mimetype by file extension (this is where the original
problem was with the extension associated wih multiple mimetypes).
This may a way of using Tika but there is a more direct method using
Tika MimeTypes class. It looks that the Tika library should be quite
capable of detecting the mimetype correcty from the file. Could just
replace the opencast mimetype[s] classes altogether?
Regards
James
--
------------------------------------------------------------------------
James S. Perrin
Media Technologies Team
Devonshire House, University Precinct
The University of Manchester
Oxford Road, Manchester, M13 9PL
t: +44 (0) 161 275 6945
e: [email protected]
w: www.manchester.ac.uk/researchcomputing
------------------------------------------------------------------------
"The test of intellect is the refusal to belabour the obvious"
- Alfred Bester
------------------------------------------------------------------------
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn
To unsubscribe please email
[email protected]
_______________________________________________