mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
Merge pull request #294 from JKamsker/patch-3
Added errordata to analysis
This commit is contained in:
commit
28ad380022
4 changed files with 8 additions and 1 deletions
|
@ -152,6 +152,7 @@ private static IMediaAnalysis ParseOutput(IProcessResult instance)
|
||||||
if (ffprobeAnalysis?.Format == null)
|
if (ffprobeAnalysis?.Format == null)
|
||||||
throw new FormatNullException();
|
throw new FormatNullException();
|
||||||
|
|
||||||
|
ffprobeAnalysis.ErrorData = instance.ErrorData;
|
||||||
return new MediaAnalysis(ffprobeAnalysis);
|
return new MediaAnalysis(ffprobeAnalysis);
|
||||||
}
|
}
|
||||||
private static FFProbeFrames ParseFramesOutput(IProcessResult instance)
|
private static FFProbeFrames ParseFramesOutput(IProcessResult instance)
|
||||||
|
|
|
@ -10,6 +10,9 @@ public class FFProbeAnalysis
|
||||||
|
|
||||||
[JsonPropertyName("format")]
|
[JsonPropertyName("format")]
|
||||||
public Format Format { get; set; } = null!;
|
public Format Format { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public IReadOnlyList<string> ErrorData { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FFProbeStream : ITagsContainer, IDispositionContainer
|
public class FFProbeStream : ITagsContainer, IDispositionContainer
|
||||||
|
|
|
@ -13,5 +13,6 @@ public interface IMediaAnalysis
|
||||||
List<VideoStream> VideoStreams { get; }
|
List<VideoStream> VideoStreams { get; }
|
||||||
List<AudioStream> AudioStreams { get; }
|
List<AudioStream> AudioStreams { get; }
|
||||||
List<SubtitleStream> SubtitleStreams { get; }
|
List<SubtitleStream> SubtitleStreams { get; }
|
||||||
|
IReadOnlyList<string> ErrorData { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ internal MediaAnalysis(FFProbeAnalysis analysis)
|
||||||
VideoStreams = analysis.Streams.Where(stream => stream.CodecType == "video").Select(ParseVideoStream).ToList();
|
VideoStreams = analysis.Streams.Where(stream => stream.CodecType == "video").Select(ParseVideoStream).ToList();
|
||||||
AudioStreams = analysis.Streams.Where(stream => stream.CodecType == "audio").Select(ParseAudioStream).ToList();
|
AudioStreams = analysis.Streams.Where(stream => stream.CodecType == "audio").Select(ParseAudioStream).ToList();
|
||||||
SubtitleStreams = analysis.Streams.Where(stream => stream.CodecType == "subtitle").Select(ParseSubtitleStream).ToList();
|
SubtitleStreams = analysis.Streams.Where(stream => stream.CodecType == "subtitle").Select(ParseSubtitleStream).ToList();
|
||||||
|
ErrorData = analysis.ErrorData ?? new List<string>().AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MediaFormat ParseFormat(Format analysisFormat)
|
private MediaFormat ParseFormat(Format analysisFormat)
|
||||||
|
@ -45,6 +46,7 @@ private MediaFormat ParseFormat(Format analysisFormat)
|
||||||
public List<VideoStream> VideoStreams { get; }
|
public List<VideoStream> VideoStreams { get; }
|
||||||
public List<AudioStream> AudioStreams { get; }
|
public List<AudioStream> AudioStreams { get; }
|
||||||
public List<SubtitleStream> SubtitleStreams { get; }
|
public List<SubtitleStream> SubtitleStreams { get; }
|
||||||
|
public IReadOnlyList<string> ErrorData { get; }
|
||||||
|
|
||||||
private VideoStream ParseVideoStream(FFProbeStream stream)
|
private VideoStream ParseVideoStream(FFProbeStream stream)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue