Search in sources :

Example 1 with MockVideoStream

use of org.fagu.fmv.ffmpeg.MockMovieMetadatas.MockVideoStream in project fmv by f-agu.

the class FFHelperTestCase method testConcatFade.

/**
 * @throws Exception
 */
@Test
@Ignore
public void testConcatFade() throws Exception {
    movieMetadatasSupplier = fileName -> {
        MockMovieMetadatas builder = MockMovieMetadatas.builder();
        builder.audio();
        MockVideoStream mockVideoStreams = builder.video().size(Size.HD720);
        if ("in1.mp4".equals(fileName)) {
            mockVideoStreams.duration(Duration.valueOf(3.1));
        }
        if ("in2.mp4".equals(fileName)) {
            mockVideoStreams.duration(Duration.valueOf(4.8));
        }
        return builder.build();
    };
    File file1 = new File("in1.mp4");
    File file2 = new File("in2.mp4");
    FFHelper.concatFade(file1, file2, Duration.valueOf(2), new File("out.mp4"));
    assertCmd("-i in1.mp4 -i in2.mp4 -filter_complex \"[f_a][f_b] blend=all_mode=addition:repeatlast=1:all_opacity=1.0:all_expr='A*(1-(if(gte(T,3.0998),1,if(lte(T,1.0998),0,min(max((T-1.0998)/2.0,0),1)))))+B*(if(gte(T,3.0998),1,if(lte(T,1.0998),0,min(max((T-1.0998)/2.0,0),1))))',format=yuva422p10le [f_c];[con_d] setsar=ratio=1,format=rgba [f_a];[0] setpts=PTS-STARTPTS [f_e];nullsrc=s=hd720:d=2.8 [f_f];[f_e][f_f] concat=n=2:v=1:a=0 [con_d];[con_g] setsar=ratio=1,format=rgba [f_b];nullsrc=s=hd720:d=1.0998 [f_h];[1] setpts=PTS-STARTPTS [f_i];[f_h][f_i] concat=n=2:v=1:a=0 [con_g];[f_j][f_k] amix=duration=shortest:inputs=3 [ami_l];[con_m] afade=t=out:st=1.0998:d=2.0 [f_j];[0] asetpts=PTS-STARTPTS [f_n];aevalsrc=exprs='0':d=2.8 [f_o];[f_n][f_o] concat=n=2:v=0:a=1 [con_m];[con_p] afade=t=in:st=1.0998:d=2.0 [f_k];aevalsrc=exprs='0':d=1.0998 [f_ba];[1] asetpts=PTS-STARTPTS [f_bb];[f_ba][f_bb] concat=n=2:v=0:a=1 [con_p]\" -map [f_c] -map [ami_l] -y out.mp4");
}
Also used : MockVideoStream(org.fagu.fmv.ffmpeg.MockMovieMetadatas.MockVideoStream) File(java.io.File) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

File (java.io.File)1 MockVideoStream (org.fagu.fmv.ffmpeg.MockMovieMetadatas.MockVideoStream)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1