Search in sources :

Example 6 with MediaInput

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

the class FFMPEGExecutorBuilderTestCase method mockInput.

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

Example 7 with MediaInput

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

the class FFMPEGExecutorBuilderTestCase method testInput.

/**
 */
@Test
public void testInput() {
    MediaInput input = mockInput("/path/file");
    ffmpegExecutorBuilder.addMediaInput(input);
    assertArgs("-i", "/path/file");
}
Also used : MediaInput(org.fagu.fmv.ffmpeg.operation.MediaInput) Test(org.junit.Test)

Example 8 with MediaInput

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

the class FFMPEGExecutorBuilderTestCase method testInputProcessor_format.

/**
 */
@Test
public void testInputProcessor_format() {
    MediaInput input = mockInput("/path/file");
    InputProcessor inputProcessor = ffmpegExecutorBuilder.addMediaInput(input);
    inputProcessor.format("forMAT");
    assertArgs("-f", "forMAT", "-i", "/path/file");
}
Also used : InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor) MediaInput(org.fagu.fmv.ffmpeg.operation.MediaInput) Test(org.junit.Test)

Example 9 with MediaInput

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

the class FFHelper method videoMetadatas.

/**
 * @param inFile
 * @return
 * @throws IOException
 */
public static MovieMetadatas videoMetadatas(File inFile) throws IOException {
    MediaInput input = new FileMediaInput(inFile);
    InfoOperation infoOperation = new InfoOperation(input);
    FFExecutor<MovieMetadatas> executor = new FFExecutor<>(infoOperation);
    Executed<MovieMetadatas> execute = executor.execute();
    return execute.getResult();
}
Also used : MovieMetadatas(org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas) FFExecutor(org.fagu.fmv.ffmpeg.executor.FFExecutor) FileMediaInput(org.fagu.fmv.ffmpeg.ioe.FileMediaInput) FileMediaInput(org.fagu.fmv.ffmpeg.ioe.FileMediaInput) MediaInput(org.fagu.fmv.ffmpeg.operation.MediaInput) InfoOperation(org.fagu.fmv.ffmpeg.operation.InfoOperation)

Example 10 with MediaInput

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

the class FFMPEGExecutorBuilder method demux.

/**
 * @param muxer
 * @return
 */
public InputProcessor demux(Demuxer<?> demuxer) {
    MediaInput mediaInput = demuxer.getMediaInput();
    InputProcessor inputProcessor = addMediaInput(mediaInput);
    demuxer.eventAdded(inputProcessor, mediaInput);
    inputProcessor.format(demuxer.name());
    return inputProcessor;
}
Also used : InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor) IntMediaInput(org.fagu.fmv.ffmpeg.ioe.IntMediaInput) MediaInput(org.fagu.fmv.ffmpeg.operation.MediaInput) FileMediaInput(org.fagu.fmv.ffmpeg.ioe.FileMediaInput)

Aggregations

MediaInput (org.fagu.fmv.ffmpeg.operation.MediaInput)15 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)11 Test (org.junit.Test)7 FFExecutor (org.fagu.fmv.ffmpeg.executor.FFExecutor)2 FilterComplex (org.fagu.fmv.ffmpeg.filter.FilterComplex)2 FilterInput (org.fagu.fmv.ffmpeg.filter.FilterInput)2 GeneratedSource (org.fagu.fmv.ffmpeg.filter.GeneratedSource)2 FileMediaInput (org.fagu.fmv.ffmpeg.ioe.FileMediaInput)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 FFExecutorFactory (org.fagu.fmv.ffmpeg.executor.FFExecutorFactory)1 FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 Filter (org.fagu.fmv.ffmpeg.filter.Filter)1 In (org.fagu.fmv.ffmpeg.filter.FilterComplexBase.In)1 FilterNaming (org.fagu.fmv.ffmpeg.filter.FilterNaming)1 IOKey (org.fagu.fmv.ffmpeg.filter.IOKey)1 OutputKey (org.fagu.fmv.ffmpeg.filter.OutputKey)1 IntMediaInput (org.fagu.fmv.ffmpeg.ioe.IntMediaInput)1 MovieMetadatas (org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas)1