Media info.pl
Revision as of 10:28, 7 February 2022 by Drn@ecs.soton.ac.uk (talk | contribs)
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
media_info.pl contains triggers and functions for automatically setting media information of uploaded files. First it has the function $c->{guess_doc_type}
which attempts to guess the document type. Initially from some hard-coded tests for common file extensions for documents of types: text, slideshow, archive or spreadsheet. Then it will use $c->{mimemap}
generated by mime_types.pl. If it finds nothing it will return document type other.
This file also contains four EP_TRIGGER_MEDIA_INFO
trigger functions:
- Tests that the uploaded file is of a recognizable MIME type and sets the document object's mime_type field.
- If an audio/video file use FFMPEG to extract information to set the document object's media_duration, media_width, media_height, media_video_codec/media_audio_codec, and media_aspect_ratio.
- Uses the
$c->{mimemap}
to set the document object's mime_type field if not already set. - Uses the
$c->{guess_doc_type}
function to set the document object's mime_type field, if not already set.