Added errordata to analysis

This commit is contained in:
Jonas Kamsker 2022-01-12 01:03:51 +01:00
parent 07470ec153
commit 3324cbb528
3 changed files with 5 additions and 1 deletions

View file

@ -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)

View file

@ -13,5 +13,6 @@ public interface IMediaAnalysis
List<VideoStream> VideoStreams { get; }
List<AudioStream> AudioStreams { get; }
List<SubtitleStream> SubtitleStreams { get; }
IReadOnlyList<string> ErrorData { get; }
}
}

View file

@ -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<string>().AsReadOnly();
}
private MediaFormat ParseFormat(Format analysisFormat)
@ -45,7 +46,8 @@ private MediaFormat ParseFormat(Format analysisFormat)
public List<VideoStream> VideoStreams { get; }
public List<AudioStream> AudioStreams { get; }
public List<SubtitleStream> SubtitleStreams { get; }
public IReadOnlyList<string> ErrorData { get; }
private VideoStream ParseVideoStream(FFProbeStream stream)
{
return new VideoStream