Search in sources :

Example 1 with MediaOutput

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

the class FFMPEGExecutorBuilderTestCase method testOutput.

/**
 */
@Test
public void testOutput() {
    MediaOutput output = mockOutput("/path/file");
    ffmpegExecutorBuilder.addMediaOutput(output);
    assertArgs("/path/file");
}
Also used : MediaOutput(org.fagu.fmv.ffmpeg.operation.MediaOutput) Test(org.junit.Test)

Example 2 with MediaOutput

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

the class FFMPEGExecutorBuilder method mux.

/**
 * @param muxer
 * @return
 */
public OutputProcessor mux(Muxer<?> muxer) {
    MediaOutput mediaOutput = muxer.getMediaOutput();
    OutputProcessor outputProcessor = addMediaOutput(mediaOutput);
    muxer.eventAdded(outputProcessor, mediaOutput);
    outputProcessor.format(muxer.name());
    return outputProcessor;
}
Also used : MediaOutput(org.fagu.fmv.ffmpeg.operation.MediaOutput) FileMediaOutput(org.fagu.fmv.ffmpeg.ioe.FileMediaOutput) OutputProcessor(org.fagu.fmv.ffmpeg.operation.OutputProcessor)

Example 3 with MediaOutput

use of org.fagu.fmv.ffmpeg.operation.MediaOutput 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 4 with MediaOutput

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

the class FFMPEGExecutorBuilderTestCase method mockOutput.

/**
 * @param location
 * @return
 */
private MediaOutput mockOutput(String location) {
    MediaOutput output = mock(MediaOutput.class);
    doReturn(location).when(output).toString();
    return output;
}
Also used : MediaOutput(org.fagu.fmv.ffmpeg.operation.MediaOutput)

Example 5 with MediaOutput

use of org.fagu.fmv.ffmpeg.operation.MediaOutput 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

MediaOutput (org.fagu.fmv.ffmpeg.operation.MediaOutput)5 OutputProcessor (org.fagu.fmv.ffmpeg.operation.OutputProcessor)3 Test (org.junit.Test)3 FileMediaOutput (org.fagu.fmv.ffmpeg.ioe.FileMediaOutput)1 Duration (org.fagu.fmv.utils.time.Duration)1