@Override public Boolean apply(Track track) { return track.hasVideo(); } };
/** * Returns a track or a number of tracks from the media package that together contain video and video. If no such * combination can be found, e. g. there is no video 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); Set<Track> result = new HashSet<Track>(); boolean foundVideo = false; // Look for a track containing video for (Track t : mediaPackage.getTracks()) { if (t.hasVideo() && !foundVideo && (videoFlavor == null || videoFlavor.equals(t.getFlavor()))) { result.add(t); foundVideo = true; } } return result; }
if (audioFlavor == null && videoFlavor == null) { 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; audioTrack = t; result.add(t); if (videoFlavor != null && t.hasVideo() && videoFlavor.matches(t.getFlavor()) && !(audioFlavor == null && t.hasAudio())) { foundVideo = true;
protected Option<Track> analyze(Job job, Track audioTrack) throws SoxException { if (!audioTrack.hasAudio()) throw new SoxException("No audio stream available"); if (audioTrack.hasVideo()) throw new SoxException("It must not have a video stream");
if (!track.hasVideo()) { logger.error("Element {} is not a video track", track.getIdentifier()); throw new TimelinePreviewsException("Element is not a video track");
Job job = null; for (Track track : elements) { if (track.hasVideo()) { logger.info("Skipping track {} since it contains a video stream", track); continue;