use of org.opencastproject.inspection.ffmpeg.api.MediaAnalyzer in project opencast by opencast.
the class MediaInspector method getFileMetadata.
/**
* Asks the media analyzer to extract the file's metadata.
*
* @param file
* the file
* @return the file container metadata
* @throws MediaInspectionException
* if metadata extraction fails
*/
private MediaContainerMetadata getFileMetadata(File file, boolean accurateFrameCount) throws MediaInspectionException {
if (file == null)
throw new IllegalArgumentException("file to analyze cannot be null");
try {
MediaAnalyzer analyzer = new FFmpegAnalyzer(accurateFrameCount);
analyzer.setConfig(map(Tuple.<String, Object>tuple(FFmpegAnalyzer.FFPROBE_BINARY_CONFIG, ffprobePath)));
return analyzer.analyze(file);
} catch (MediaAnalyzerException e) {
throw new MediaInspectionException(e);
}
}
Aggregations