public void crop(File selectedDirectory, long startTimestamp, long endTimestamp, ProgressMonitorInterface monitor) throws IOException { for (int i = 0; i < videos.size(); i++) { String video = videos.get(i); if (monitor != null) { monitor.setNote("Cropping video " + video); monitor.setProgress(50 + ((int) (50.0 * ((double) i / (double) videos.size())))); } File timestampFile = new File(selectedDirectory, logProperties.getTimestampFile(video)); File videoFile = new File(selectedDirectory, logProperties.getVideoFile(video)); players.get(video).cropVideo(videoFile, timestampFile, startTimestamp, endTimestamp, monitor); } }
public VideoDataPlayer(String name, File dataDirectory, LogProperties logProperties) throws IOException { this.name = name; this.interlaced = logProperties.getInterlaced(name); this.hasTimebase = logProperties.hasTimebase(); if (!hasTimebase) { System.err.println("Video data is using timestamps instead of frame numbers. Falling back to seeking based on timestamp."); } videoFile = new File(dataDirectory, logProperties.getVideoFile(name)); if (!videoFile.exists()) { throw new IOException("Cannot find video: " + videoFile); } File timestampFile = new File(dataDirectory, logProperties.getTimestampFile(name)); parseTimestampData(timestampFile); demuxer = new MP4VideoDemuxer(videoFile); viewer = new HideableMediaFrame(name, demuxer.getWidth(), demuxer.getHeight()); }