Beispiel #1
0
        public void CanSplitImages()
        {
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_01.png"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_02.png"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_03.png"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_04.png"));
            var slidetask = MakeSlideShow("long-slideshow.mp4", 0.1m);
            var splittask = new FFMpegVideoSplitTask {
                SourceFile = slidetask.TargetFile, WorkingFolder = dir, FileNameBase = "thumb_"
            };

            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(1)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(11), Duration = TimeSpan.FromSeconds(2)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(0.5)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(12), Duration = TimeSpan.FromSeconds(2)
            });
            splittask.Width  = 100;
            splittask.Height = 100;
            FFMpeg.SplitImages(splittask);
            Assert.True(File.Exists(GetPath("thumb_01.png")));
            Assert.True(File.Exists(GetPath("thumb_02.png")));
            Assert.True(File.Exists(GetPath("thumb_03.png")));
            Assert.True(File.Exists(GetPath("thumb_04.png")));
        }
Beispiel #2
0
        public void CanSplit()
        {
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_01.mp4"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_02.mp4"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_03.mp4"));
            FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_04.mp4"));
            var slidetask = MakeSlideShow("long-slideshow.mp4", 0.1m);
            var splittask = new FFMpegVideoSplitTask {
                SourceFile = slidetask.TargetFile, WorkingFolder = dir
            };

            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(1)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(11), Duration = TimeSpan.FromSeconds(2)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(0.5)
            });
            splittask.Frames.Add(new FFMpegFrame {
                StartTime = TimeSpan.FromSeconds(12), Duration = TimeSpan.FromSeconds(2)
            });
            FFMpeg.Split(splittask);
            Assert.True(File.Exists(GetPath("basis_01.mp4")));
            Assert.True(File.Exists(GetPath("basis_02.mp4")));
            Assert.True(File.Exists(GetPath("basis_03.mp4")));
            Assert.True(File.Exists(GetPath("basis_04.mp4")));
        }
 public void CanSplit() {
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_01.mp4"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_02.mp4"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_03.mp4"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "basis_04.mp4"));
     var slidetask = MakeSlideShow("long-slideshow.mp4",0.1m);
     var splittask = new FFMpegVideoSplitTask {SourceFile = slidetask.TargetFile, WorkingFolder = dir};
     splittask.Frames.Add(new FFMpegFrame{StartTime = TimeSpan.FromSeconds(1),Duration = TimeSpan.FromSeconds(1)});
     splittask.Frames.Add(new FFMpegFrame{StartTime = TimeSpan.FromSeconds(11),Duration = TimeSpan.FromSeconds(2)});
     splittask.Frames.Add(new FFMpegFrame{StartTime = TimeSpan.FromSeconds(1),Duration = TimeSpan.FromSeconds(0.5)});
     splittask.Frames.Add(new FFMpegFrame{StartTime = TimeSpan.FromSeconds(12),Duration = TimeSpan.FromSeconds(2)});
     FFMpeg.Split(splittask);
     Assert.True(File.Exists(GetPath("basis_01.mp4")));
     Assert.True(File.Exists(GetPath("basis_02.mp4")));
     Assert.True(File.Exists(GetPath("basis_03.mp4")));
     Assert.True(File.Exists(GetPath("basis_04.mp4")));
 }
 public void CanSplitImages()
 {
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_01.png"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_02.png"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_03.png"));
     FileSystemHelper.DeleteIfExists(Path.Combine(dir, "thumb_04.png"));
     var slidetask = MakeSlideShow("long-slideshow.mp4", 0.1m);
     var splittask = new FFMpegVideoSplitTask { SourceFile = slidetask.TargetFile, WorkingFolder = dir,FileNameBase = "thumb_"};
     splittask.Frames.Add(new FFMpegFrame { StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(1) });
     splittask.Frames.Add(new FFMpegFrame { StartTime = TimeSpan.FromSeconds(11), Duration = TimeSpan.FromSeconds(2) });
     splittask.Frames.Add(new FFMpegFrame { StartTime = TimeSpan.FromSeconds(1), Duration = TimeSpan.FromSeconds(0.5) });
     splittask.Frames.Add(new FFMpegFrame { StartTime = TimeSpan.FromSeconds(12), Duration = TimeSpan.FromSeconds(2) });
     splittask.Width = 100;
     splittask.Height = 100;
     FFMpeg.SplitImages(splittask);
     Assert.True(File.Exists(GetPath("thumb_01.png")));
     Assert.True(File.Exists(GetPath("thumb_02.png")));
     Assert.True(File.Exists(GetPath("thumb_03.png")));
     Assert.True(File.Exists(GetPath("thumb_04.png")));
 }