mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Make properties on MediaStream classes for deserialization #296
This commit is contained in:
parent
da251e99ad
commit
fc86a64b9e
4 changed files with 23 additions and 23 deletions
|
@ -2,9 +2,9 @@
|
||||||
{
|
{
|
||||||
public class AudioStream : MediaStream
|
public class AudioStream : MediaStream
|
||||||
{
|
{
|
||||||
public int Channels { get; internal set; }
|
public int Channels { get; set; }
|
||||||
public string ChannelLayout { get; internal set; } = null!;
|
public string ChannelLayout { get; set; } = null!;
|
||||||
public int SampleRateHz { get; internal set; }
|
public int SampleRateHz { get; set; }
|
||||||
public string Profile { get; internal set; } = null!;
|
public string Profile { get; set; } = null!;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -163,7 +163,7 @@ private static FFProbeFrames ParseFramesOutput(IProcessResult instance)
|
||||||
NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString
|
NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
return ffprobeAnalysis;
|
return ffprobeAnalysis!;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static FFProbePackets ParsePacketsOutput(IProcessResult instance)
|
private static FFProbePackets ParsePacketsOutput(IProcessResult instance)
|
||||||
|
@ -175,7 +175,7 @@ private static FFProbePackets ParsePacketsOutput(IProcessResult instance)
|
||||||
NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString
|
NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
return ffprobeAnalysis;
|
return ffprobeAnalysis!;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ThrowIfInputFileDoesNotExist(string filePath)
|
private static void ThrowIfInputFileDoesNotExist(string filePath)
|
||||||
|
|
|
@ -5,18 +5,18 @@
|
||||||
|
|
||||||
namespace FFMpegCore
|
namespace FFMpegCore
|
||||||
{
|
{
|
||||||
public class MediaStream
|
public abstract class MediaStream
|
||||||
{
|
{
|
||||||
public int Index { get; internal set; }
|
public int Index { get; set; }
|
||||||
public string CodecName { get; internal set; } = null!;
|
public string CodecName { get; set; } = null!;
|
||||||
public string CodecLongName { get; internal set; } = null!;
|
public string CodecLongName { get; set; } = null!;
|
||||||
public string CodecTagString { get; set; } = null!;
|
public string CodecTagString { get; set; } = null!;
|
||||||
public string CodecTag { get; set; } = null!;
|
public string CodecTag { get; set; } = null!;
|
||||||
public long BitRate { get; internal set; }
|
public long BitRate { get; set; }
|
||||||
public TimeSpan Duration { get; internal set; }
|
public TimeSpan Duration { get; set; }
|
||||||
public string? Language { get; internal set; }
|
public string? Language { get; set; }
|
||||||
public Dictionary<string, bool>? Disposition { get; internal set; }
|
public Dictionary<string, bool>? Disposition { get; set; }
|
||||||
public Dictionary<string, string>? Tags { get; internal set; }
|
public Dictionary<string, string>? Tags { get; set; }
|
||||||
|
|
||||||
public Codec GetCodecInfo() => FFMpeg.GetCodec(CodecName);
|
public Codec GetCodecInfo() => FFMpeg.GetCodec(CodecName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,14 @@ namespace FFMpegCore
|
||||||
{
|
{
|
||||||
public class VideoStream : MediaStream
|
public class VideoStream : MediaStream
|
||||||
{
|
{
|
||||||
public double AvgFrameRate { get; internal set; }
|
public double AvgFrameRate { get; set; }
|
||||||
public int BitsPerRawSample { get; internal set; }
|
public int BitsPerRawSample { get; set; }
|
||||||
public (int Width, int Height) DisplayAspectRatio { get; internal set; }
|
public (int Width, int Height) DisplayAspectRatio { get; set; }
|
||||||
public string Profile { get; internal set; } = null!;
|
public string Profile { get; set; } = null!;
|
||||||
public int Width { get; internal set; }
|
public int Width { get; set; }
|
||||||
public int Height { get; internal set; }
|
public int Height { get; set; }
|
||||||
public double FrameRate { get; internal set; }
|
public double FrameRate { get; set; }
|
||||||
public string PixelFormat { get; internal set; } = null!;
|
public string PixelFormat { get; set; } = null!;
|
||||||
public int Rotation { get; set; }
|
public int Rotation { get; set; }
|
||||||
public double AverageFrameRate { get; set; }
|
public double AverageFrameRate { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue