From 7c36ffc87365f13962946ad7e09917fab66a2f9f Mon Sep 17 00:00:00 2001 From: Vlad Jerca Date: Tue, 26 Feb 2019 21:59:43 +0200 Subject: [PATCH] FFMpegCore: report progress when converting --- FFMpegCore/FFMPEG/FFMpeg.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FFMpegCore/FFMPEG/FFMpeg.cs b/FFMpegCore/FFMPEG/FFMpeg.cs index c1d453c..3f6350a 100644 --- a/FFMpegCore/FFMPEG/FFMpeg.cs +++ b/FFMpegCore/FFMPEG/FFMpeg.cs @@ -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)}");