public void ConvertToAviUtVideo_Invalid_Failure(string source, bool audio) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("ConvertToAvi", source, AviExt); var Encoder = SetupEncoder(); var Result = Encoder.ConvertToAviUtVideo(SrcVideo, Dest, audio, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void Truncate_Invalid_StatusFailed(string source, string destExt, TimeSpan?startPos, TimeSpan?duration) { string Src = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("Truncate", source, destExt); var Muxer = SetupMuxer(); var Result = Muxer.Truncate(Src, Dest, startPos, duration, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void Concatenate_Invalid_StatusFailed(IEnumerable <string> source, string destExt) { List <string> Src = source.Select(x => AppPaths.GetInputFile(x)).ToList(); string Dest = AppPaths.PrepareDestPath("Concatenate", source.First(), destExt); var Muxer = SetupMuxer(); var Result = Muxer.Concatenate(Src, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void EncodeVapourSynthToX265_Invalid_Failure(string source, string encodeArgs) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("EncodeVapourSynthToX265", source, Mp4Ext); var Encoder = SetupEncoder(); var Result = Encoder.EncodeVapourSynthToX265(SrcVideo, Dest, encodeArgs, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void EncodeVapourSynthToFFmpeg_Invalid_Failure(string source, string destExt, string videoCodec, string audioCodec, string encodeArgs) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("EncodeVapourSynthToFFmpeg", source, destExt); var Encoder = SetupEncoder(); var Result = Encoder.EncodeVapourSynthToFFmpeg(SrcVideo, Dest, videoCodec, audioCodec, encodeArgs, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void ExtractVideo_WrongExtension_StatusFailed(string source, string destExt) { string Src = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("ExtractVideo", source, destExt); var Muxer = SetupMuxer(); var Result = Muxer.ExtractVideo(Src, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); Assert.False(File.Exists(Dest)); }
public void ExtractVideo_Valid_Success(string source, string destExt) { string Src = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("ExtractVideo", source, destExt); var Muxer = SetupMuxer(); var Result = Muxer.ExtractVideo(Src, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); Assert.True(File.Exists(Dest)); }
public void EncodeFFmpeg_Valid_Success(string source, string destExt, string videoCodec, string audioCodec, string encodeArgs, int streamCount) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("EncodeFFmpeg", source, destExt); var Encoder = SetupEncoder(); var Result = Encoder.EncodeFFmpeg(SrcVideo, Dest, videoCodec, audioCodec, encodeArgs, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); AssertMedia(Dest, streamCount); }
public void ConvertToAviUtVideo_Valid_Success(string source, bool audio, int streamCount) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("ConvertToAvi", source, AviExt); var Encoder = SetupEncoder(); var Result = Encoder.ConvertToAviUtVideo(SrcVideo, Dest, audio, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); AssertMedia(Dest, streamCount); }
public void EncodeAvisynthToX265_Valid_Success(string source, string encodeArgs) { string SrcVideo = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("EncodeAvisynthToX265", source, Mp4Ext); var Encoder = SetupEncoder(); var Result = Encoder.EncodeAvisynthToX265(SrcVideo, Dest, encodeArgs, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); AssertMedia(Dest, 1); }
public void RunVapourSynthToEncoder_AppX264_Success(string videoFile, string destExt) { string SrcVideo = AppPaths.GetInputFile(videoFile); string Dest = AppPaths.PrepareDestPath("RunVapourSynthToX264", videoFile, destExt); string Args = string.Format(@"--demuxer y4m --preset ultrafast -o ""{0}"" -", Dest); var Manager = SetupManager(); var Result = Manager.RunVapourSynthToEncoder(SrcVideo, Args, EncoderApp.x264); Assert.Equal(CompletionStatus.Success, Result); Assert.True(File.Exists(Dest)); }
public void Muxe_List_Invalid_ReturnsStatusFailed(IEnumerable <MediaStream> fileStreams, string destExt, int streamCount) { string Dest = AppPaths.PrepareDestPath("MuxeFailed", fileStreams.First().Path, destExt); foreach (var item in fileStreams) { item.Path = AppPaths.GetInputFile(item.Path); } var Muxer = SetupMuxer(); var Result = Muxer.Muxe(fileStreams, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Failed, Result); }
public void Muxe_Simple_Valid_Success(string videoFile, string audioFile, string destExt, int streamCount) { string SrcVideo = AppPaths.GetInputFile(videoFile); string SrcAudio = AppPaths.GetInputFile(audioFile); string Dest = AppPaths.PrepareDestPath("Muxe", videoFile, destExt); var Muxer = SetupMuxer(); var Result = Muxer.Muxe(SrcVideo, SrcAudio, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); Assert.True(File.Exists(Dest)); var FileInfo = GetFileInfo(Dest); Assert.Equal(streamCount, FileInfo.FileStreams.Count); }
public void Muxe_List_Valid_Success(IEnumerable <MediaStream> fileStreams, string destExt, int streamCount) { string Dest = AppPaths.PrepareDestPath("MuxeList", fileStreams.First().Path, destExt); foreach (var item in fileStreams) { item.Path = AppPaths.GetInputFile(item.Path); } var Muxer = SetupMuxer(); var Result = Muxer.Muxe(fileStreams, Dest, null, feed.RunCallback); Assert.Equal(CompletionStatus.Success, Result); Assert.True(File.Exists(Dest)); var FileInfo = GetFileInfo(Dest); Assert.Equal(streamCount, FileInfo.FileStreams.Count); }
public void Truncate_Valid_Success(string source, string destExt, TimeSpan?startPos, TimeSpan?duration) { string Src = AppPaths.GetInputFile(source); string Dest = AppPaths.PrepareDestPath("Truncate", source, destExt); var Muxer = SetupMuxer(); IProcessWorker Manager = null; void Started(object s, ProcessStartedEventArgs e) { Manager = e.ProcessWorker; feed.RunCallback(s, e); } var Result = Muxer.Truncate(Src, Dest, startPos, duration, null, Started); Assert.Equal(CompletionStatus.Success, Result); Assert.True(File.Exists(Dest)); var FileInfo = GetFileInfo(Dest); if (duration.HasValue) { Assert.True(Math.Abs((duration.Value - FileInfo.FileDuration).TotalSeconds) < .1, "Truncate did not produce expected file duration."); } }