mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-15 18:45:44 +00:00
Compare commits
11 commits
7f85dcf593
...
b074aa6f84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b074aa6f84 | ||
|
|
ea8c493f8a | ||
|
|
bd55ec2a51 | ||
|
|
cd258991bd | ||
|
|
5082e6503e | ||
|
|
48ccd3e291 | ||
|
|
b8de2fc545 | ||
|
|
91bbfa850e | ||
|
|
7c71a70a0c | ||
|
|
0c467e3a05 | ||
|
|
65e8ba85e3 |
7 changed files with 41 additions and 46 deletions
|
|
@ -682,4 +682,25 @@ public class ArgumentBuilderTest
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
Assert.ThrowsExactly<FileNotFoundException>(() => argument.Pre());
|
Assert.ThrowsExactly<FileNotFoundException>(() => argument.Pre());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Concat_Escape()
|
||||||
|
{
|
||||||
|
var arg = new DemuxConcatArgument([@"Heaven's River\05 - Investigation.m4b"]);
|
||||||
|
CollectionAssert.AreEquivalent(new[] { @"file 'Heaven'\''s River\05 - Investigation.m4b'" }, arg.Values.ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Audible_Aaxc_Test()
|
||||||
|
{
|
||||||
|
var arg = new AudibleEncryptionKeyArgument("123", "456");
|
||||||
|
Assert.AreEqual("-audible_key 123 -audible_iv 456", arg.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Audible_Aax_Test()
|
||||||
|
{
|
||||||
|
var arg = new AudibleEncryptionKeyArgument("62689101");
|
||||||
|
Assert.AreEqual("-activation_bytes 62689101", arg.Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
[assembly: Parallelize]
|
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using FFMpegCore.Arguments;
|
namespace FFMpegCore.Test;
|
||||||
|
|
||||||
namespace FFMpegCore.Test;
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class FFMpegArgumentProcessorTest
|
public class FFMpegArgumentProcessorTest
|
||||||
|
|
@ -13,9 +11,9 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Processor_GlobalOptions_GetUsed()
|
public void ZZZ_Processor_GlobalOptions_GetUsed()
|
||||||
{
|
{
|
||||||
var globalWorkingDir = "Whatever1";
|
var globalWorkingDir = "Whatever";
|
||||||
var processor = CreateArgumentProcessor();
|
var processor = CreateArgumentProcessor();
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -45,9 +43,9 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Processor_Options_CanBeOverridden_And_Configured()
|
public void ZZZ_Processor_Options_CanBeOverridden_And_Configured()
|
||||||
{
|
{
|
||||||
var globalConfig = "Whatever2";
|
var globalConfig = "Whatever";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -59,14 +57,14 @@ public class FFMpegArgumentProcessorTest
|
||||||
var overrideOptions = new FFOptions { WorkingDirectory = "override" };
|
var overrideOptions = new FFOptions { WorkingDirectory = "override" };
|
||||||
|
|
||||||
GlobalFFOptions.Configure(new FFOptions { WorkingDirectory = globalConfig, TemporaryFilesFolder = globalConfig, BinaryFolder = globalConfig });
|
GlobalFFOptions.Configure(new FFOptions { WorkingDirectory = globalConfig, TemporaryFilesFolder = globalConfig, BinaryFolder = globalConfig });
|
||||||
var configuredOptions = processor.GetConfiguredOptions(overrideOptions);
|
var options = processor.GetConfiguredOptions(overrideOptions);
|
||||||
|
|
||||||
Assert.AreEqual(configuredOptions.WorkingDirectory, overrideOptions.WorkingDirectory);
|
Assert.AreEqual(options.WorkingDirectory, overrideOptions.WorkingDirectory);
|
||||||
Assert.AreEqual(configuredOptions.TemporaryFilesFolder, overrideOptions.TemporaryFilesFolder);
|
Assert.AreEqual(options.TemporaryFilesFolder, overrideOptions.TemporaryFilesFolder);
|
||||||
Assert.AreEqual(configuredOptions.BinaryFolder, overrideOptions.BinaryFolder);
|
Assert.AreEqual(options.BinaryFolder, overrideOptions.BinaryFolder);
|
||||||
|
|
||||||
Assert.AreEqual(sessionTempDir, configuredOptions.TemporaryFilesFolder);
|
Assert.AreEqual(sessionTempDir, options.TemporaryFilesFolder);
|
||||||
Assert.AreNotEqual(globalConfig, configuredOptions.BinaryFolder);
|
Assert.AreNotEqual(globalConfig, options.BinaryFolder);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -75,9 +73,9 @@ public class FFMpegArgumentProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Options_Global_And_Session_Options_Can_Differ()
|
public void ZZZ_Options_Global_And_Session_Options_Can_Differ()
|
||||||
{
|
{
|
||||||
var globalWorkingDir = "Whatever3";
|
var globalWorkingDir = "Whatever";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -97,25 +95,4 @@ public class FFMpegArgumentProcessorTest
|
||||||
GlobalFFOptions.Configure(new FFOptions());
|
GlobalFFOptions.Configure(new FFOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Concat_Escape()
|
|
||||||
{
|
|
||||||
var arg = new DemuxConcatArgument([@"Heaven's River\05 - Investigation.m4b"]);
|
|
||||||
CollectionAssert.AreEquivalent(new[] { @"file 'Heaven'\''s River\05 - Investigation.m4b'" }, arg.Values.ToArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Audible_Aaxc_Test()
|
|
||||||
{
|
|
||||||
var arg = new AudibleEncryptionKeyArgument("123", "456");
|
|
||||||
Assert.AreEqual("-audible_key 123 -audible_iv 456", arg.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void Audible_Aax_Test()
|
|
||||||
{
|
|
||||||
var arg = new AudibleEncryptionKeyArgument("62689101");
|
|
||||||
Assert.AreEqual("-activation_bytes 62689101", arg.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<Nullable>disable</Nullable>
|
<Nullable>disable</Nullable>
|
||||||
<LangVersion>default</LangVersion>
|
<LangVersion>default</LangVersion>
|
||||||
|
<OrderTestsByNameInClass>true</OrderTestsByNameInClass>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,16 @@ public class FFMpegOptionsTest
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Options_Set_Programmatically()
|
public void ZZZ_Options_Set_Programmatically()
|
||||||
{
|
{
|
||||||
var original = GlobalFFOptions.Current;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "Whatever" });
|
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "Whatever" });
|
||||||
Assert.AreEqual(
|
Assert.AreEqual("Whatever", GlobalFFOptions.Current.BinaryFolder);
|
||||||
"Whatever",
|
|
||||||
GlobalFFOptions.Current.BinaryFolder
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
GlobalFFOptions.Configure(original);
|
GlobalFFOptions.Configure(new FFOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -824,7 +824,6 @@ public class VideoTest
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
var dataReceived = false;
|
var dataReceived = false;
|
||||||
|
|
||||||
GlobalFFOptions.Configure(opt => opt.Encoding = Encoding.UTF8);
|
|
||||||
var success = FFMpegArguments
|
var success = FFMpegArguments
|
||||||
.FromFileInput(TestResources.Mp4Video)
|
.FromFileInput(TestResources.Mp4Video)
|
||||||
.WithGlobalOptions(options => options
|
.WithGlobalOptions(options => options
|
||||||
|
|
@ -832,6 +831,7 @@ public class VideoTest
|
||||||
.OutputToFile(outputFile, false, opt => opt
|
.OutputToFile(outputFile, false, opt => opt
|
||||||
.WithDuration(TimeSpan.FromSeconds(2)))
|
.WithDuration(TimeSpan.FromSeconds(2)))
|
||||||
.NotifyOnError(_ => dataReceived = true)
|
.NotifyOnError(_ => dataReceived = true)
|
||||||
|
.Configure(opt => opt.Encoding = Encoding.UTF8)
|
||||||
.ProcessSynchronously();
|
.ProcessSynchronously();
|
||||||
|
|
||||||
Assert.IsTrue(dataReceived);
|
Assert.IsTrue(dataReceived);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"RootDirectory": ""
|
"BinaryFolder": ""
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue