diff --git a/FFMpegCore/FFMpeg/Exceptions/FFMpegException.cs b/FFMpegCore/FFMpeg/Exceptions/FFMpegException.cs index b094a02..fc154ac 100644 --- a/FFMpegCore/FFMpeg/Exceptions/FFMpegException.cs +++ b/FFMpegCore/FFMpeg/Exceptions/FFMpegException.cs @@ -13,7 +13,6 @@ public enum FFMpegExceptionType public class FFMpegException : Exception { - public FFMpegException(FFMpegExceptionType type, string? message = null, Exception? innerException = null, string ffmpegErrorOutput = "", string ffmpegOutput = "") : base(message, innerException) { diff --git a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs index a1186d0..5961ed3 100644 --- a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs +++ b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs @@ -77,13 +77,13 @@ void OnCancelEvent(object sender, EventArgs args) CancelEvent -= OnCancelEvent; } - return HandleCompletion(throwOnError, errorCode, instance.ErrorData); + return HandleCompletion(throwOnError, errorCode, instance.ErrorData, instance.OutputData); } - private bool HandleCompletion(bool throwOnError, int errorCode, IReadOnlyList errorData) + private bool HandleCompletion(bool throwOnError, int errorCode, IReadOnlyList errorData, IReadOnlyList outputData) { if (throwOnError && errorCode != 0) - throw new FFMpegException(FFMpegExceptionType.Conversion, string.Join("\n", errorData)); + throw new FFMpegException(FFMpegExceptionType.Conversion, "FFMpeg exited with non-zero exitcode.", null, string.Join("\n", errorData), string.Join("\n", outputData)); _onPercentageProgress?.Invoke(100.0); if (_totalTimespan.HasValue) _onTimeProgress?.Invoke(_totalTimespan.Value); @@ -123,7 +123,7 @@ await Task.WhenAll(instance.FinishedRunning().ContinueWith(t => CancelEvent -= OnCancelEvent; } - return HandleCompletion(throwOnError, errorCode, instance.ErrorData); + return HandleCompletion(throwOnError, errorCode, instance.ErrorData, instance.OutputData); } private Instance PrepareInstance(out CancellationTokenSource cancellationTokenSource) diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index 09960a1..43247f7 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -9,9 +9,9 @@ 3.0.0.0 3.0.0.0 3.0.0.0 - - Include ffmpeg output data in exception + - Also include ffmpeg output data on non-zero exit code 8 - 3.2.3 + 3.2.4 MIT Malte Rosenbjerg, Vlad Jerca ffmpeg ffprobe convert video audio mediafile resize analyze muxing