mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 10:14:12 +01:00
parent
b776422ada
commit
b3032a4ab2
1 changed files with 4 additions and 4 deletions
|
@ -62,13 +62,13 @@ public static async Task<IMediaAnalysis> AnalyseAsync(string filePath, int outpu
|
||||||
throw new FFMpegException(FFMpegExceptionType.File, $"No file found at '{filePath}'");
|
throw new FFMpegException(FFMpegExceptionType.File, $"No file found at '{filePath}'");
|
||||||
|
|
||||||
using var instance = PrepareInstance(filePath, outputCapacity);
|
using var instance = PrepareInstance(filePath, outputCapacity);
|
||||||
await instance.FinishedRunning();
|
await instance.FinishedRunning().ConfigureAwait(false);
|
||||||
return ParseOutput(instance);
|
return ParseOutput(instance);
|
||||||
}
|
}
|
||||||
public static async Task<IMediaAnalysis> AnalyseAsync(Uri uri, int outputCapacity = int.MaxValue)
|
public static async Task<IMediaAnalysis> AnalyseAsync(Uri uri, int outputCapacity = int.MaxValue)
|
||||||
{
|
{
|
||||||
using var instance = PrepareInstance(uri.AbsoluteUri, outputCapacity);
|
using var instance = PrepareInstance(uri.AbsoluteUri, outputCapacity);
|
||||||
await instance.FinishedRunning();
|
await instance.FinishedRunning().ConfigureAwait(false);
|
||||||
return ParseOutput(instance);
|
return ParseOutput(instance);
|
||||||
}
|
}
|
||||||
public static async Task<IMediaAnalysis> AnalyseAsync(Stream stream, int outputCapacity = int.MaxValue)
|
public static async Task<IMediaAnalysis> AnalyseAsync(Stream stream, int outputCapacity = int.MaxValue)
|
||||||
|
@ -81,7 +81,7 @@ public static async Task<IMediaAnalysis> AnalyseAsync(Stream stream, int outputC
|
||||||
var task = instance.FinishedRunning();
|
var task = instance.FinishedRunning();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await pipeArgument.During();
|
await pipeArgument.During().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch(IOException)
|
catch(IOException)
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ public static async Task<IMediaAnalysis> AnalyseAsync(Stream stream, int outputC
|
||||||
{
|
{
|
||||||
pipeArgument.Post();
|
pipeArgument.Post();
|
||||||
}
|
}
|
||||||
var exitCode = await task;
|
var exitCode = await task.ConfigureAwait(false);
|
||||||
if (exitCode != 0)
|
if (exitCode != 0)
|
||||||
throw new FFMpegException(FFMpegExceptionType.Process, $"FFProbe process returned exit status {exitCode}", null, string.Join("\n", instance.ErrorData));
|
throw new FFMpegException(FFMpegExceptionType.Process, $"FFProbe process returned exit status {exitCode}", null, string.Join("\n", instance.ErrorData));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue