public void exportVideo(File selectedFile, long startTimestamp, long endTimestamp, ProgressMonitorInterface monitor) { long startVideoTimestamp = getVideoTimestamp(startTimestamp); long endVideoTimestamp = getVideoTimestamp(endTimestamp); try { VideoConverter.convert(videoFile, selectedFile, startVideoTimestamp, endVideoTimestamp, 8000, monitor); } catch (IOException e) { e.printStackTrace(); } }
public void exportVideo(File selectedFile, long startTimestamp, long endTimestamp, ProgressMonitorInterface monitor) { long startVideoTimestamp = getVideoTimestamp(startTimestamp); long endVideoTimestamp = getVideoTimestamp(endTimestamp); try { VideoConverter.convert(videoFile, selectedFile, startVideoTimestamp, endVideoTimestamp, monitor); } catch (IOException e) { e.printStackTrace(); } }
long startVideoTimestamp = getVideoTimestamp(startTimestamp); long endVideoTimestamp = getVideoTimestamp(endTimestamp);
public void cropVideo(File outputFile, File timestampFile, long startTimestamp, long endTimestamp, ProgressMonitorInterface monitor) throws IOException { long startVideoTimestamp = getVideoTimestamp(startTimestamp); long endVideoTimestamp = getVideoTimestamp(endTimestamp); int framerate = VideoConverter.crop(videoFile, outputFile, startVideoTimestamp, endVideoTimestamp, monitor); PrintWriter timestampWriter = new PrintWriter(timestampFile); timestampWriter.println(1); timestampWriter.println(framerate); long pts = 0; /* * PTS gets reorderd to be monotonically increaseing starting from 0 */ for (int i = 0; i < robotTimestamps.length; i++) { long robotTimestamp = robotTimestamps[i]; if (robotTimestamp >= startTimestamp && robotTimestamp <= endTimestamp) { timestampWriter.print(robotTimestamp); timestampWriter.print(" "); timestampWriter.println(pts); pts++; } else if (robotTimestamp > endTimestamp) { break; } } timestampWriter.close(); }
public synchronized void showVideoFrame(long timestamp) { if (timestamp >= currentlyShowingRobottimestamp && timestamp < upcomingRobottimestamp) { return; } long videoTimestamp = getVideoTimestamp(timestamp); if (currentlyShowingIndex + 1 < robotTimestamps.length) { upcomingRobottimestamp = robotTimestamps[currentlyShowingIndex + 1]; } else { upcomingRobottimestamp = currentlyShowingRobottimestamp; } try { demuxer.seekToPTS(videoTimestamp); YUVPicture nextFrame = demuxer.getNextFrame(); viewer.update(nextFrame); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
videoTimestamp = getVideoTimestamp(timestamp);