mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-16 02:55:44 +00:00
Compare commits
2 commits
a232f043ad
...
533695859b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
533695859b | ||
|
|
6b39f11687 |
4 changed files with 8 additions and 1 deletions
|
|
@ -174,7 +174,9 @@ public static class FFProbe
|
||||||
throw new FormatNullException();
|
throw new FormatNullException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ffprobeAnalysis.OutputData = instance.OutputData;
|
||||||
ffprobeAnalysis.ErrorData = instance.ErrorData;
|
ffprobeAnalysis.ErrorData = instance.ErrorData;
|
||||||
|
|
||||||
return new MediaAnalysis(ffprobeAnalysis);
|
return new MediaAnalysis(ffprobeAnalysis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ public class FFProbeAnalysis
|
||||||
|
|
||||||
[JsonPropertyName("chapters")] public List<Chapter> Chapters { get; set; } = null!;
|
[JsonPropertyName("chapters")] public List<Chapter> Chapters { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonIgnore] public IReadOnlyList<string> OutputData { get; set; } = new List<string>();
|
||||||
|
|
||||||
[JsonIgnore] public IReadOnlyList<string> ErrorData { get; set; } = new List<string>();
|
[JsonIgnore] public IReadOnlyList<string> ErrorData { get; set; } = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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> OutputData { get; }
|
||||||
IReadOnlyList<string> ErrorData { get; }
|
IReadOnlyList<string> ErrorData { get; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,11 @@ internal class MediaAnalysis : IMediaAnalysis
|
||||||
internal MediaAnalysis(FFProbeAnalysis analysis)
|
internal MediaAnalysis(FFProbeAnalysis analysis)
|
||||||
{
|
{
|
||||||
Format = ParseFormat(analysis.Format);
|
Format = ParseFormat(analysis.Format);
|
||||||
Chapters = analysis.Chapters.Select(c => ParseChapter(c)).ToList();
|
Chapters = analysis.Chapters.Select(ParseChapter).ToList();
|
||||||
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();
|
||||||
|
OutputData = analysis.OutputData;
|
||||||
ErrorData = analysis.ErrorData;
|
ErrorData = analysis.ErrorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,6 +30,7 @@ internal class MediaAnalysis : IMediaAnalysis
|
||||||
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> OutputData { get; }
|
||||||
public IReadOnlyList<string> ErrorData { get; }
|
public IReadOnlyList<string> ErrorData { get; }
|
||||||
|
|
||||||
private MediaFormat ParseFormat(Format analysisFormat)
|
private MediaFormat ParseFormat(Format analysisFormat)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue