mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
parent
391f564ffa
commit
b30a23fc58
2 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using FFMpegCore.Enums;
|
||||
|
||||
namespace FFMpegCore.Test.Resources
|
||||
|
@ -44,7 +45,7 @@ public static string OutputLocation(this FileInfo file, string type, string keyw
|
|||
string originalLocation = file.Directory.FullName,
|
||||
outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToLowerInvariant());
|
||||
|
||||
return $"{originalLocation}{Path.DirectorySeparatorChar}{outputFile}";
|
||||
return $"{originalLocation}{Path.DirectorySeparatorChar}{Guid.NewGuid()}_{outputFile}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -566,7 +566,7 @@ public void Video_With_Only_Audio_Should_Extract_Metadata()
|
|||
var video = FFProbe.Analyse(VideoLibrary.LocalVideoAudioOnly.FullName);
|
||||
Assert.AreEqual(null, video.PrimaryVideoStream);
|
||||
Assert.AreEqual("aac", video.PrimaryAudioStream.CodecName);
|
||||
Assert.AreEqual(3, video.Duration.TotalSeconds, 0.5);
|
||||
Assert.AreEqual(10, video.Duration.TotalSeconds, 0.5);
|
||||
// Assert.AreEqual(1.25, video.Size);
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ public void Video_Duration()
|
|||
{
|
||||
FFMpegArguments
|
||||
.FromFileInput(VideoLibrary.LocalVideo)
|
||||
.OutputToFile(output, false, opt => opt.WithDuration(TimeSpan.FromSeconds(video.Duration.TotalSeconds - 5)))
|
||||
.OutputToFile(output, false, opt => opt.WithDuration(TimeSpan.FromSeconds(video.Duration.TotalSeconds - 2)))
|
||||
.ProcessSynchronously();
|
||||
|
||||
Assert.IsTrue(File.Exists(output));
|
||||
|
@ -589,7 +589,7 @@ public void Video_Duration()
|
|||
Assert.AreEqual(video.Duration.Days, outputVideo.Duration.Days);
|
||||
Assert.AreEqual(video.Duration.Hours, outputVideo.Duration.Hours);
|
||||
Assert.AreEqual(video.Duration.Minutes, outputVideo.Duration.Minutes);
|
||||
Assert.AreEqual(video.Duration.Seconds - 5, outputVideo.Duration.Seconds);
|
||||
Assert.AreEqual(video.Duration.Seconds - 2, outputVideo.Duration.Seconds);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue