@Override FfprobeType parseOutputFile(File outputFile, ContextInfo contextInfo) throws XmlParsingException, FileNotFoundException { switch (contextInfo.getSequenceType()) { case AUDIO: outputFile = audioMediaInfoXml; break; case VIDEO: outputFile = videoMediaInfoXml; break; default: throw new RuntimeException(); } return super.parseOutputFile(outputFile, contextInfo); }
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); }
@Override FfprobeType parseOutputFile(File outputFile, ContextInfo contextInfo) throws XmlParsingException, FileNotFoundException { try { switch (contextInfo.getSequenceType()) { case AUDIO: outputFile = contextInfo.getResourceUuid().getUuid().contains("-0-") ? MediaInfoUtils.getCorrectMediaInfoAudio() : MediaInfoUtils.getCorrectMediaInfoAudio2(); break; case VIDEO: outputFile = contextInfo.getResourceUuid().getUuid().contains("-0-") ? MediaInfoUtils.getCorrectMediaInfoVideo() : MediaInfoUtils.getCorrectMediaInfoVideo2(); break; default: throw new RuntimeException(); } } catch (URISyntaxException e) { throw new RuntimeException(e); } return super.parseOutputFile(outputFile, contextInfo); } };
@Override FfprobeType parseOutputFile(File outputFile, ContextInfo contextInfo) throws XmlParsingException, FileNotFoundException { try { switch (contextInfo.getSequenceType()) { case AUDIO: outputFile = contextInfo.getResourceUuid().getUuid().endsWith("-0-0") ? MediaInfoUtils.getCorrectMediaInfoAudio() : MediaInfoUtils.getCorrectMediaInfoAudio2(); break; case VIDEO: outputFile = contextInfo.getResourceUuid().getUuid().endsWith("-0-0") ? MediaInfoUtils.getCorrectMediaInfoVideo() : MediaInfoUtils.getCorrectMediaInfoVideo2(); break; default: throw new RuntimeException(); } } catch (URISyntaxException e) { throw new RuntimeException(e); } return super.parseOutputFile(outputFile, contextInfo); } };
@Override FfprobeType parseOutputFile(File outputFile, ContextInfo contextInfo) throws XmlParsingException, FileNotFoundException { try { switch (contextInfo.getSequenceType()) { case AUDIO: outputFile = contextInfo.getResourceUuid().getUuid().contains("-0-") ? MediaInfoUtils.getCorrectMediaInfoAudio() : MediaInfoUtils.getCorrectMediaInfoAudio3(); break; case VIDEO: outputFile = contextInfo.getResourceUuid().getUuid().contains("-0-") ? MediaInfoUtils.getCorrectMediaInfoVideo() : MediaInfoUtils.getCorrectMediaInfoVideo2(); break; default: throw new RuntimeException(); } } catch (URISyntaxException e) { throw new RuntimeException(e); } return super.parseOutputFile(outputFile, contextInfo); } };