private void checkMediaInfoCommand(MediaInfoCommandOthersTypeMap commandsMap, String commandName) throws MediaInfoException { if (!commandsMap.getMap().containsKey(commandName)) { throw new MediaInfoException(commandName, String.format( "%s command must be set in conversion.xml", commandName)); } }
private VirtualTrackInfo getTrackInfo(File outputFile, ContextInfo contextInfo, String essence) throws XmlParsingException, MediaInfoException, FileNotFoundException { // 1. parse output xml FfprobeType mediaInfo = parseOutputFile(outputFile, contextInfo); // 2. check that info is available if (mediaInfo.getStreams() == null || mediaInfo.getStreams().getStream().isEmpty()) { throw new MediaInfoException("No streams output", essence); } StreamType stream = mediaInfo.getStreams().getStream().get(0); // 3. fill info return new VirtualTrackInfo(contextInfo.getSequenceType(), stream); }