Search in sources :

Example 1 with FileMediaOutput

use of org.fagu.fmv.ffmpeg.ioe.FileMediaOutput in project fmv by f-agu.

the class MetadataVersion method add.

/**
 * @param outputProcessor
 */
public static void add(OutputProcessor outputProcessor) {
    String tagName = null;
    MediaOutput mediaOutput = outputProcessor.getMediaOutput();
    if (mediaOutput instanceof FileMediaOutput) {
        String extension = FilenameUtils.getExtension(((FileMediaOutput) mediaOutput).getFile().getName());
        tagName = tagForFormat(extension);
    }
    if (tagName != null) {
        outputProcessor.metadataStream(Type.VIDEO, tagName, "fmvversion:" + getVersion());
    }
}
Also used : FileMediaOutput(org.fagu.fmv.ffmpeg.ioe.FileMediaOutput) FileMediaOutput(org.fagu.fmv.ffmpeg.ioe.FileMediaOutput)

Example 2 with FileMediaOutput

use of org.fagu.fmv.ffmpeg.ioe.FileMediaOutput in project fmv by f-agu.

the class MetadataVersionTestCase method test.

/**
 */
@Test
public void test() {
    OutputProcessor outputProcessor = mock(OutputProcessor.class);
    FileMediaOutput fileMediaOutput = mock(FileMediaOutput.class);
    doReturn(fileMediaOutput).when(outputProcessor).getMediaOutput();
    doReturn(new File("x.mp4")).when(fileMediaOutput).getFile();
    MetadataVersion.add(outputProcessor);
    verify(outputProcessor).metadataStream(eq(Type.VIDEO), eq("comment"), anyString());
}
Also used : FileMediaOutput(org.fagu.fmv.ffmpeg.ioe.FileMediaOutput) File(java.io.File) Test(org.junit.Test)

Aggregations

FileMediaOutput (org.fagu.fmv.ffmpeg.ioe.FileMediaOutput)2 File (java.io.File)1 Test (org.junit.Test)1