mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
FFMpegCore: report progress when converting
Former-commit-id: 7c36ffc873
This commit is contained in:
parent
9287cb3418
commit
46a77a9440
1 changed files with 4 additions and 0 deletions
|
@ -151,6 +151,8 @@ public VideoInfo Convert(
|
||||||
FFMpegHelper.ExtensionExceptionCheck(output, FileExtension.ForType(type));
|
FFMpegHelper.ExtensionExceptionCheck(output, FileExtension.ForType(type));
|
||||||
FFMpegHelper.ConversionSizeExceptionCheck(source);
|
FFMpegHelper.ConversionSizeExceptionCheck(source);
|
||||||
|
|
||||||
|
_totalTime = source.Duration;
|
||||||
|
|
||||||
var scale = VideoSize.Original == size ? 1 :
|
var scale = VideoSize.Original == size ? 1 :
|
||||||
(double)source.Height / (int)size;
|
(double)source.Height / (int)size;
|
||||||
|
|
||||||
|
@ -201,6 +203,8 @@ public VideoInfo Convert(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_totalTime = TimeSpan.MinValue;
|
||||||
|
|
||||||
if (!RunProcess(container, output))
|
if (!RunProcess(container, output))
|
||||||
{
|
{
|
||||||
throw new FFMpegException(FFMpegExceptionType.Conversion, $"The video could not be converted to {Enum.GetName(typeof(VideoType), type)}");
|
throw new FFMpegException(FFMpegExceptionType.Conversion, $"The video could not be converted to {Enum.GetName(typeof(VideoType), type)}");
|
||||||
|
|
Loading…
Reference in a new issue