From 07470ec1538805737ede92a357580d56c5c8efd6 Mon Sep 17 00:00:00 2001 From: Jonas Kamsker <11245306+JKamsker@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:01:40 +0100 Subject: [PATCH 1/2] Update FFProbeAnalysis.cs --- FFMpegCore/FFProbe/FFProbeAnalysis.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FFMpegCore/FFProbe/FFProbeAnalysis.cs b/FFMpegCore/FFProbe/FFProbeAnalysis.cs index 2177307..cbbb9fd 100644 --- a/FFMpegCore/FFProbe/FFProbeAnalysis.cs +++ b/FFMpegCore/FFProbe/FFProbeAnalysis.cs @@ -10,6 +10,9 @@ public class FFProbeAnalysis [JsonPropertyName("format")] public Format Format { get; set; } = null!; + + [JsonIgnore] + public IReadOnlyList ErrorData { get; set; } } public class FFProbeStream : ITagsContainer, IDispositionContainer From 3324cbb528834ef8bf36485c51f47c70635127de Mon Sep 17 00:00:00 2001 From: Jonas Kamsker <11245306+JKamsker@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:03:51 +0100 Subject: [PATCH 2/2] Added errordata to analysis --- FFMpegCore/FFProbe/FFProbe.cs | 1 + FFMpegCore/FFProbe/IMediaAnalysis.cs | 1 + FFMpegCore/FFProbe/MediaAnalysis.cs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/FFMpegCore/FFProbe/FFProbe.cs b/FFMpegCore/FFProbe/FFProbe.cs index 36f050c..d0f056e 100644 --- a/FFMpegCore/FFProbe/FFProbe.cs +++ b/FFMpegCore/FFProbe/FFProbe.cs @@ -163,6 +163,7 @@ private static IMediaAnalysis ParseOutput(Instance instance) if (ffprobeAnalysis?.Format == null) throw new FormatNullException(); + ffprobeAnalysis.ErrorData = instance.ErrorData; return new MediaAnalysis(ffprobeAnalysis); } private static FFProbeFrames ParseFramesOutput(Instance instance) diff --git a/FFMpegCore/FFProbe/IMediaAnalysis.cs b/FFMpegCore/FFProbe/IMediaAnalysis.cs index 7be3b20..5884f74 100644 --- a/FFMpegCore/FFProbe/IMediaAnalysis.cs +++ b/FFMpegCore/FFProbe/IMediaAnalysis.cs @@ -13,5 +13,6 @@ public interface IMediaAnalysis List VideoStreams { get; } List AudioStreams { get; } List SubtitleStreams { get; } + IReadOnlyList ErrorData { get; } } } diff --git a/FFMpegCore/FFProbe/MediaAnalysis.cs b/FFMpegCore/FFProbe/MediaAnalysis.cs index a2db068..bf16544 100644 --- a/FFMpegCore/FFProbe/MediaAnalysis.cs +++ b/FFMpegCore/FFProbe/MediaAnalysis.cs @@ -13,6 +13,7 @@ internal MediaAnalysis(FFProbeAnalysis analysis) VideoStreams = analysis.Streams.Where(stream => stream.CodecType == "video").Select(ParseVideoStream).ToList(); AudioStreams = analysis.Streams.Where(stream => stream.CodecType == "audio").Select(ParseAudioStream).ToList(); SubtitleStreams = analysis.Streams.Where(stream => stream.CodecType == "subtitle").Select(ParseSubtitleStream).ToList(); + ErrorData = analysis.ErrorData ?? new List().AsReadOnly(); } private MediaFormat ParseFormat(Format analysisFormat) @@ -45,7 +46,8 @@ private MediaFormat ParseFormat(Format analysisFormat) public List VideoStreams { get; } public List AudioStreams { get; } public List SubtitleStreams { get; } - + public IReadOnlyList ErrorData { get; } + private VideoStream ParseVideoStream(FFProbeStream stream) { return new VideoStream