Search in sources :

Example 21 with VideoStream

use of org.fagu.fmv.ffmpeg.metadatas.VideoStream in project fmv by f-agu.

the class FFHelperTestCase method testOo_Rotate180.

/**
 * @throws Exception
 */
@Test
public void testOo_Rotate180() throws Exception {
    final MovieMetadatas movieMetadatas = mock(MovieMetadatas.class);
    VideoStream videoStream = mock(VideoStream.class);
    doReturn(videoStream).when(movieMetadatas).getVideoStream();
    doReturn(Rotation.R_180).when(videoStream).rotate();
    movieMetadatasSupplier = fileName -> movieMetadatas;
    File inFile = new File("in.mp4");
    File outFile = new File("out.mp4");
    FFHelper.oo(inFile, outFile);
    if (AutoRotate.isAutoRotateObsolete()) {
        assertCmd("-hide_banner -i in.mp4 -filter:a \"aresample=sample_rate=44100\" -filter:v \"scale=w='if(gt(dar,930/500),930,trunc(oh*dar/2)*2)':h='if(gt(dar,930/500),trunc(ow/dar/2)*2,500)',format=yuv420p\" -movflags +faststart -f mp4 -codec:v libx264 -preset medium -profile:v baseline -level 3.0 -crf 22 -pix_fmt yuv420p -codec:a aac -ac 2 -b:a 128000 -y -metadata:s:v:0 \"rotate=0\" out.mp4");
    } else {
        assertCmd("-hide_banner -i in.mp4 -filter:a \"aresample=sample_rate=44100\" -filter:v \"transpose=dir=clock,transpose=dir=clock,scale=w='if(gt(dar,930/500),930,trunc(oh*dar/2)*2)':h='if(gt(dar,930/500),trunc(ow/dar/2)*2,500)',format=yuv420p\" -movflags +faststart -f mp4 -codec:v libx264 -preset medium -profile:v baseline -level 3.0 -crf 22 -pix_fmt yuv420p -codec:a aac -ac 2 -b:a 128000 -y -metadata:s:v:0 \"rotate=0\" out.mp4");
    }
}
Also used : MovieMetadatas(org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas) MockVideoStream(org.fagu.fmv.ffmpeg.MockMovieMetadatas.MockVideoStream) VideoStream(org.fagu.fmv.ffmpeg.metadatas.VideoStream) File(java.io.File) Test(org.junit.Test)

Aggregations

VideoStream (org.fagu.fmv.ffmpeg.metadatas.VideoStream)21 MovieMetadatas (org.fagu.fmv.ffmpeg.metadatas.MovieMetadatas)11 FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)8 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)8 File (java.io.File)6 AudioStream (org.fagu.fmv.ffmpeg.metadatas.AudioStream)5 Duration (org.fagu.fmv.utils.time.Duration)5 OptionalInt (java.util.OptionalInt)4 FilterComplex (org.fagu.fmv.ffmpeg.filter.FilterComplex)4 AudioGenerator (org.fagu.fmv.ffmpeg.filter.impl.AudioGenerator)4 MixAudioDuration (org.fagu.fmv.ffmpeg.filter.impl.AudioMix.MixAudioDuration)4 Blend (org.fagu.fmv.ffmpeg.filter.impl.Blend)4 Concat (org.fagu.fmv.ffmpeg.filter.impl.Concat)4 Format (org.fagu.fmv.ffmpeg.filter.impl.Format)4 NullSourceVideo (org.fagu.fmv.ffmpeg.filter.impl.NullSourceVideo)4 SetSAR (org.fagu.fmv.ffmpeg.filter.impl.SetSAR)4 OutputProcessor (org.fagu.fmv.ffmpeg.operation.OutputProcessor)4 PixelFormat (org.fagu.fmv.ffmpeg.utils.PixelFormat)4 Size (org.fagu.fmv.utils.media.Size)4 Time (org.fagu.fmv.utils.time.Time)4