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); }