@Override public Boolean apply(Track track) { return track.hasAudio(); } };
/** * Returns a track or a number of tracks from the media package that together contain audio and video. If no such * combination can be found, e. g. there is no audio or video at all, an empty array is returned. * * @see org.opencastproject.mediapackage.selector.AbstractMediaPackageElementSelector#select(org.opencastproject.mediapackage.MediaPackage, boolean) */ @Override public Collection<Track> select(MediaPackage mediaPackage, boolean withTagsAndFlavors) { // instead of relying on the broken superclass, we'll inspect every track // Collection<Track> candidates = super.select(mediaPackage); Collection<Track> candidates = Arrays.asList(mediaPackage.getTracks()); Set<Track> result = new HashSet<Track>(); boolean foundAudio = false; // Look for a track containing audio for (Track t : candidates) { if (t.hasAudio() && !foundAudio && (audioFlavor == null || audioFlavor.equals(t.getFlavor()))) { result.add(t); foundAudio = true; } } return result; }
foundAudio |= t.hasAudio(); foundVideo |= t.hasVideo(); result.add(t); } else { if (audioFlavor != null && t.hasAudio() && audioFlavor.matches(t.getFlavor()) && !(videoFlavor == null && t.hasVideo())) { foundAudio = true; && !(audioFlavor == null && t.hasAudio())) { foundVideo = true; videoTrack = t;
protected Option<Track> analyze(Job job, Track audioTrack) throws SoxException { if (!audioTrack.hasAudio()) throw new SoxException("No audio stream available"); if (audioTrack.hasVideo())
if (!track.hasAudio()) { throw new WaveformServiceException("Track has no audio");
for (Track sourceTrack : sourceTracks) { if (!sourceTrack.hasAudio()) { logger.info("Skipping waveform extraction of track {} since it has no audio", sourceTrack.getIdentifier()); continue;