Search in sources :

Example 21 with OutputProcessor

use of org.fagu.fmv.ffmpeg.operation.OutputProcessor in project fmv by f-agu.

the class RipperTestCase method ffMPEGExecutorBuilder.

/**
 * @return
 * @throws IOException
 */
private FFMPEGExecutorBuilder ffMPEGExecutorBuilder() throws IOException {
    FFMPEGExecutorBuilder builder = mock(FFMPEGExecutorBuilder.class);
    doReturn(builder).when(builder).hideBanner();
    doReturn(builder).when(builder).noStats();
    InputProcessor inputProcessor = mock(InputProcessor.class);
    doReturn(inputProcessor).when(builder).addMediaInputFile(any(File.class));
    MovieMetadatas movieMetadatas = mock(MovieMetadatas.class);
    doReturn(movieMetadatas).when(inputProcessor).getMovieMetadatas();
    OutputProcessor outputProcessor = mock(OutputProcessor.class);
    doReturn(outputProcessor).when(builder).addMediaOutputFile(any(File.class));
    doReturn(outputProcessor).when(outputProcessor).codec(any(Coder.class));
    return builder;
}
Also used : Coder(org.fagu.fmv.ffmpeg.coder.Coder) FFMPEGExecutorBuilder(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder) MovieMetadatas(org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas) OutputProcessor(org.fagu.fmv.ffmpeg.operation.OutputProcessor) InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor) File(java.io.File)

Example 22 with OutputProcessor

use of org.fagu.fmv.ffmpeg.operation.OutputProcessor in project fmv by f-agu.

the class FFMPEGExecutorBuilderTestCase method testOutputProcessor_duration.

// ======================== OUTPUT PROCESSOR ========================
/**
 */
@Test
public void testOutputProcessor_duration() {
    MediaOutput output = mockOutput("/path/file");
    OutputProcessor outputProcessor = ffmpegExecutorBuilder.addMediaOutput(output);
    outputProcessor.duration(new Duration(1, 2, 3.4));
    assertArgs("-t", "01:02:03.400", "/path/file");
}
Also used : MediaOutput(org.fagu.fmv.ffmpeg.operation.MediaOutput) OutputProcessor(org.fagu.fmv.ffmpeg.operation.OutputProcessor) Duration(org.fagu.fmv.utils.time.Duration) Test(org.junit.Test)

Example 23 with OutputProcessor

use of org.fagu.fmv.ffmpeg.operation.OutputProcessor in project fmv by f-agu.

the class FFMPEGExecutorBuilderTestCase method testOutputProcessor_format.

/**
 */
@Test
public void testOutputProcessor_format() {
    MediaOutput output = mockOutput("/path/file");
    OutputProcessor outputProcessor = ffmpegExecutorBuilder.addMediaOutput(output);
    outputProcessor.format("forMAT");
    assertArgs("-f", "forMAT", "/path/file");
}
Also used : MediaOutput(org.fagu.fmv.ffmpeg.operation.MediaOutput) OutputProcessor(org.fagu.fmv.ffmpeg.operation.OutputProcessor) Test(org.junit.Test)

Aggregations

OutputProcessor (org.fagu.fmv.ffmpeg.operation.OutputProcessor)23 FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)19 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)13 MovieMetadatas (org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas)11 File (java.io.File)7 FilterComplex (org.fagu.fmv.ffmpeg.filter.FilterComplex)5 VideoStream (org.fagu.fmv.ffmpeg.metadatas.VideoStream)5 Stream (org.fagu.fmv.ffmpeg.metadatas.Stream)4 Duration (org.fagu.fmv.utils.time.Duration)4 OptionalInt (java.util.OptionalInt)3 AudioStream (org.fagu.fmv.ffmpeg.metadatas.AudioStream)3 SubtitleStream (org.fagu.fmv.ffmpeg.metadatas.SubtitleStream)3 MediaOutput (org.fagu.fmv.ffmpeg.operation.MediaOutput)3 Progress (org.fagu.fmv.ffmpeg.operation.Progress)3 IOException (java.io.IOException)2 StringJoiner (java.util.StringJoiner)2 Executable (org.fagu.fmv.core.exec.Executable)2 Source (org.fagu.fmv.core.exec.Source)2 AudioGenerator (org.fagu.fmv.ffmpeg.filter.impl.AudioGenerator)2 MixAudioDuration (org.fagu.fmv.ffmpeg.filter.impl.AudioMix.MixAudioDuration)2