List of usage examples for java.time Duration multipliedBy
public Duration multipliedBy(long multiplicand)
From source file:Main.java
public static void main(String[] args) { Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON); System.out.println(duration.getSeconds()); duration = duration.multipliedBy(2); System.out.println(duration.getSeconds()); }
From source file:ddf.content.plugin.video.VideoThumbnailPlugin.java
private byte[] createGifThumbnailWithDuration(final String videoFilePath, final Duration duration) throws IOException, InterruptedException { final Duration durationFraction = duration.dividedBy(THUMBNAIL_COUNT); // Start numbering files with 1 to match FFmpeg's convention. for (int clipNum = FFMPEG_FILE_NUMBERING_START; clipNum <= THUMBNAIL_COUNT; ++clipNum) { final String thumbnailPath = String.format(getThumbnailFilePath(), clipNum); final String seek = durationToString(durationFraction.multipliedBy(clipNum - 1)); final CommandLine command = getFFmpegCreateThumbnailCommand(videoFilePath, thumbnailPath, seek, 1); final DefaultExecuteResultHandler resultHandler = executeFFmpeg(command, 15, null); resultHandler.waitFor();//from ww w. j av a 2 s. c om } return createGifFromThumbnailFiles(); }