FFMpegCore: report progress when converting

This commit is contained in:
Vlad Jerca 2019-02-26 21:59:43 +02:00
parent aed33a3d5c
commit 7c36ffc873

View file

@ -151,6 +151,8 @@ public VideoInfo Convert(
FFMpegHelper.ExtensionExceptionCheck(output, FileExtension.ForType(type));
FFMpegHelper.ConversionSizeExceptionCheck(source);
_totalTime = source.Duration;
var scale = VideoSize.Original == size ? 1 :
(double)source.Height / (int)size;
@ -201,6 +203,8 @@ public VideoInfo Convert(
break;
}
_totalTime = TimeSpan.MinValue;
if (!RunProcess(container, output))
{
throw new FFMpegException(FFMpegExceptionType.Conversion, $"The video could not be converted to {Enum.GetName(typeof(VideoType), type)}");