Пример #1
0
        public void Cut_Concat_Effect3Videos_Test()
        {
            const string OutputFile      = OutputFolder + "Cut_Effect_Concat3Videos.avi";
            const string FileToConcat1   = OutputFolder + "1EpisodeToConcat_tmp.avi";
            const string FileToConcat2   = OutputFolder + "2EpisodeToConcat_tmp.avi";
            const string FileToConcat2TW = OutputFolder + "2EpisodeToConcat_tmpTW.avi";
            const string FileToConcat3   = OutputFolder + "3EpisodeToConcat_tmp.avi";

            string source = Path.Combine(this.InputFolder, SampleFiles.RealInputVideoAVI2);

            var ffmpeg      = new FFMpeg(this.temporaryFilesStorage);
            var cutOptions1 = FFMpegCutOptions.BuildSimpleCatOptions(source, FileToConcat1, 100, 20, GlobalExportProgress.Empty);

            ffmpeg.Cut(cutOptions1);
            var cutOptions2 = FFMpegCutOptions.BuildSimpleCatOptions(source, FileToConcat2, 300, 20, GlobalExportProgress.Empty);

            ffmpeg.Cut(cutOptions2);
            var cutOptions3 = FFMpegCutOptions.BuildSimpleCatOptions(source, FileToConcat3, 600, 20, GlobalExportProgress.Empty);

            ffmpeg.Cut(cutOptions3);

            ffmpeg.Concat(OutputFile, "copy", "copy", GlobalExportProgress.Empty, FileToConcat1, FileToConcat2, FileToConcat3);
            ffmpeg.ApplyTimeWarp(OutputFile, new List <TimeWarpRecord> {
                new TimeWarpRecord(23, 32, 2), new TimeWarpRecord(43, 52, 2)
            }, FileToConcat2TW, GlobalExportProgress.Empty);

            Assert.IsTrue(File.Exists(OutputFile));
        }
Пример #2
0
        private void ProcessRenderOptions(VideoRenderOption videoRenderOption, bool plainConcatIsPossible, IGlobalExportProgress globalExportProgress, Size outputSize)
        {
            var tempFile = this.temporaryFilesStorage.GetIntermediateFile(this.OutputExtension);

            var cutOptions = plainConcatIsPossible
                                 ? FFMpegCutOptions.BuildSimpleCatOptions(
                videoRenderOption.FilePath,
                tempFile,
                videoRenderOption.StartSecond,
                videoRenderOption.DurationSeconds,
                globalExportProgress)
                                 : FFMpegCutOptions.BuildCatOptionsWithConvertations(
                videoRenderOption.FilePath,
                tempFile,
                videoRenderOption.StartSecond,
                videoRenderOption.DurationSeconds,
                globalExportProgress,
                outputSize,
                videoRenderOption.OverlayTextTimeTable,
                videoRenderOption.ImagesTimeTable,
                videoRenderOption.TimeWarpSettings);

            this.CutOptions.Add(cutOptions);
            this.FilesToConcat.Add(tempFile);
        }
Пример #3
0
        public void SimpleCut_Test()
        {
            const string OutputFile = OutputFolder + "Simple20SecCut_Medium.mp4";
            var          ffmpeg     = new FFMpeg(this.temporaryFilesStorage);
            var          cutOptions = FFMpegCutOptions.BuildSimpleCatOptions(
                SampleFiles.RealInputVideoMP4,
                OutputFile,
                100,
                20,
                GlobalExportProgress.Empty);

            ffmpeg.Cut(cutOptions);

            Assert.IsTrue(File.Exists(OutputFile));
        }