From 82d401b1cfd4e0141d55235548aef7d3ed3d6704 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 24 May 2020 19:27:55 +0200 Subject: [PATCH] Add overload to Join Former-commit-id: a778ccd58f6d5e68f4577f8a0157f3945e274c86 --- FFMpegCore.Test/VideoTest.cs | 6 +++--- FFMpegCore/FFMpeg/FFMpeg.cs | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index aafb334..1181875 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -480,10 +480,9 @@ public void Video_Join() try { var input = FFProbe.Analyse(Input.FullName); - File.Copy(input.Path, newInput); - var input2 = FFProbe.Analyse(newInput); + File.Copy(Input.FullName, newInput); - var success = FFMpeg.Join(output, input, input2); + var success = FFMpeg.Join(output, Input.FullName, newInput); Assert.IsTrue(success); Assert.IsTrue(File.Exists(output)); @@ -504,6 +503,7 @@ public void Video_Join() if (File.Exists(newInput)) File.Delete(newInput); } + } [TestMethod] diff --git a/FFMpegCore/FFMpeg/FFMpeg.cs b/FFMpegCore/FFMpeg/FFMpeg.cs index 8d16a19..dfca4e2 100644 --- a/FFMpegCore/FFMpeg/FFMpeg.cs +++ b/FFMpegCore/FFMpeg/FFMpeg.cs @@ -222,6 +222,16 @@ public static bool Join(string output, params MediaAnalysis[] videos) Cleanup(temporaryVideoParts); } } + /// + /// Joins a list of video files. + /// + /// Output video file. + /// List of vides that need to be joined together. + /// Output video information. + public static bool Join(string output, params string[] videos) + { + return Join(output, videos.Select(videoPath => FFProbe.Analyse(videoPath)).ToArray()); + } /// /// Converts an image sequence to a video.