From 084f8b3a58d8e64d9bfd21c740e72958736b39fa Mon Sep 17 00:00:00 2001 From: BobSilent Date: Thu, 18 Nov 2021 14:00:18 +0100 Subject: [PATCH] Update Docu Former-commit-id: f7ad3394596b159c2786ffe01198ef3c6ff74098 --- FFMpegCore.Examples/Program.cs | 14 ++++++++++++-- README.md | 12 +++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/FFMpegCore.Examples/Program.cs b/FFMpegCore.Examples/Program.cs index 256ef3c..a718a21 100644 --- a/FFMpegCore.Examples/Program.cs +++ b/FFMpegCore.Examples/Program.cs @@ -98,7 +98,7 @@ IEnumerable CreateFrames(int count) yield return GetNextFrame(); //method of generating new frames } } - + var videoFramesSource = new RawVideoPipeSource(CreateFrames(64)) //pass IEnumerable or IEnumerator to constructor of RawVideoPipeSource { FrameRate = 30 //set source frame rate @@ -115,10 +115,20 @@ await FFMpegArguments GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "/tmp" }); // or GlobalFFOptions.Configure(options => options.BinaryFolder = "./bin"); - + // or individual, per-run options await FFMpegArguments .FromFileInput(inputPath) .OutputToFile(outputPath) .ProcessAsynchronously(true, new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "/tmp" }); + + // or combined, setting global defaults and adapting per-run options + GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "./globalTmp", WorkingDirectory = "./" }); + + await FFMpegArguments + .FromFileInput(inputPath) + .OutputToFile(outputPath) + .Configure(options => options.WorkingDirectory = "./CurrentRunWorkingDir") + .Configure(options => options.TemporaryFilesFolder = "./CurrentRunTmpFolder") + .ProcessAsynchronously(); } \ No newline at end of file diff --git a/README.md b/README.md index a8ab510..2c55520 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,17 @@ await FFMpegArguments .FromFileInput(inputPath) .OutputToFile(outputPath) .ProcessAsynchronously(true, new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "/tmp" }); -``` + +// or combined, setting global defaults and adapting per-run options +GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "./globalTmp", WorkingDirectory = "./" }); + +await FFMpegArguments + .FromFileInput(inputPath) + .OutputToFile(outputPath) + .Configure(options => options.WorkingDirectory = "./CurrentRunWorkingDir") + .Configure(options => options.TemporaryFilesFolder = "./CurrentRunTmpFolder") + .ProcessAsynchronously(); + ``` ### Option 2