Add overload to Join

This commit is contained in:
Malte Rosenbjerg 2020-05-24 19:27:55 +02:00
parent ac6b203f39
commit a778ccd58f
2 changed files with 13 additions and 3 deletions

View file

@ -480,10 +480,9 @@ public void Video_Join()
try try
{ {
var input = FFProbe.Analyse(Input.FullName); var input = FFProbe.Analyse(Input.FullName);
File.Copy(input.Path, newInput); File.Copy(Input.FullName, newInput);
var input2 = FFProbe.Analyse(newInput);
var success = FFMpeg.Join(output, input, input2); var success = FFMpeg.Join(output, Input.FullName, newInput);
Assert.IsTrue(success); Assert.IsTrue(success);
Assert.IsTrue(File.Exists(output)); Assert.IsTrue(File.Exists(output));
@ -504,6 +503,7 @@ public void Video_Join()
if (File.Exists(newInput)) if (File.Exists(newInput))
File.Delete(newInput); File.Delete(newInput);
} }
} }
[TestMethod] [TestMethod]

View file

@ -222,6 +222,16 @@ public static bool Join(string output, params MediaAnalysis[] videos)
Cleanup(temporaryVideoParts); Cleanup(temporaryVideoParts);
} }
} }
/// <summary>
/// Joins a list of video files.
/// </summary>
/// <param name="output">Output video file.</param>
/// <param name="videos">List of vides that need to be joined together.</param>
/// <returns>Output video information.</returns>
public static bool Join(string output, params string[] videos)
{
return Join(output, videos.Select(videoPath => FFProbe.Analyse(videoPath)).ToArray());
}
/// <summary> /// <summary>
/// Converts an image sequence to a video. /// Converts an image sequence to a video.