mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 00:24: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)
|
||||
throw new FormatNullException();
|
||||
|
||||
ffprobeAnalysis.ErrorData = instance.ErrorData;
|
||||
return new MediaAnalysis(ffprobeAnalysis);
|
||||
}
|
||||
private static FFProbeFrames ParseFramesOutput(IProcessResult instance)
|
||||
|
|
|
@ -10,6 +10,9 @@ public class FFProbeAnalysis
|
|||
|
||||
[JsonPropertyName("format")]
|
||||
public Format Format { get; set; } = null!;
|
||||
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<string> ErrorData { get; set; }
|
||||
}
|
||||
|
||||
public class FFProbeStream : ITagsContainer, IDispositionContainer
|
||||
|
|
|
@ -13,5 +13,6 @@ public interface IMediaAnalysis
|
|||
List<VideoStream> VideoStreams { get; }
|
||||
List<AudioStream> AudioStreams { 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();
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue