mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-16 11:05:44 +00:00
Compare commits
7 commits
d28864e93a
...
12f2400092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12f2400092 | ||
|
|
25d7ae8374 | ||
|
|
bbfcfaefac | ||
|
|
f31dc2b1cd | ||
|
|
d43ea98e0e | ||
|
|
508cce8827 | ||
|
|
349b6044d1 |
3 changed files with 21 additions and 3 deletions
|
|
@ -1,6 +1,9 @@
|
|||
using System.Reflection;
|
||||
using FFMpegCore.Arguments;
|
||||
using FFMpegCore.Exceptions;
|
||||
using FFMpegCore.Helpers;
|
||||
using FluentAssertions;
|
||||
using Instances.Exceptions;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace FFMpegCore.Test
|
||||
|
|
@ -99,5 +102,12 @@ namespace FFMpegCore.Test
|
|||
var arg = new AudibleEncryptionKeyArgument("62689101");
|
||||
arg.Text.Should().Be($"-activation_bytes 62689101");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Throws_FFMpegException_when_ffmpeg_not_found()
|
||||
{
|
||||
var exception = Assert.ThrowsException<FFMpegException>(() => FFMpegHelper.VerifyFFMpegExists(new FFOptions { BinaryFolder = "./folder/that/does/not/exist" }));
|
||||
Assert.IsInstanceOfType<InstanceFileNotFoundException>(exception.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,16 @@ namespace FFMpegCore.Helpers
|
|||
return;
|
||||
}
|
||||
|
||||
var result = Instance.Finish(GlobalFFOptions.GetFFMpegBinaryPath(ffMpegOptions), "-version");
|
||||
_ffmpegVerified = result.ExitCode == 0;
|
||||
try
|
||||
{
|
||||
var result = Instance.Finish(GlobalFFOptions.GetFFMpegBinaryPath(ffMpegOptions), "-version");
|
||||
_ffmpegVerified = result.ExitCode == 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new FFMpegException(FFMpegExceptionType.Operation, "ffmpeg was not found on your system", e);
|
||||
}
|
||||
|
||||
if (!_ffmpegVerified)
|
||||
{
|
||||
throw new FFMpegException(FFMpegExceptionType.Operation, "ffmpeg was not found on your system");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# [FFMpegCore](https://www.nuget.org/packages/FFMpegCore/)
|
||||
[](https://www.nuget.org/packages/FFMpegCore/)
|
||||
[](https://www.nuget.org/packages/FFMpegCore/)
|
||||
[](https://github.com/rosenbjerg/FFMpegCore/issues)
|
||||
[](https://github.com/rosenbjerg/FFMpegCore/stargazers)
|
||||
[](https://github.com/rosenbjerg/FFMpegCore/blob/master/LICENSE)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue