mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge pull request #271 from whereisrich/master
Change Int32 to long for BitRate
This commit is contained in:
commit
bdb12aa48a
2 changed files with 7 additions and 4 deletions
|
@ -52,7 +52,7 @@ private VideoStream ParseVideoStream(FFProbeStream stream)
|
||||||
{
|
{
|
||||||
Index = stream.Index,
|
Index = stream.Index,
|
||||||
AvgFrameRate = MediaAnalysisUtils.DivideRatio(MediaAnalysisUtils.ParseRatioDouble(stream.AvgFrameRate, '/')),
|
AvgFrameRate = MediaAnalysisUtils.DivideRatio(MediaAnalysisUtils.ParseRatioDouble(stream.AvgFrameRate, '/')),
|
||||||
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default,
|
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default,
|
||||||
BitsPerRawSample = !string.IsNullOrEmpty(stream.BitsPerRawSample) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitsPerRawSample) : default,
|
BitsPerRawSample = !string.IsNullOrEmpty(stream.BitsPerRawSample) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitsPerRawSample) : default,
|
||||||
CodecName = stream.CodecName,
|
CodecName = stream.CodecName,
|
||||||
CodecLongName = stream.CodecLongName,
|
CodecLongName = stream.CodecLongName,
|
||||||
|
@ -77,7 +77,7 @@ private AudioStream ParseAudioStream(FFProbeStream stream)
|
||||||
return new AudioStream
|
return new AudioStream
|
||||||
{
|
{
|
||||||
Index = stream.Index,
|
Index = stream.Index,
|
||||||
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default,
|
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default,
|
||||||
CodecName = stream.CodecName,
|
CodecName = stream.CodecName,
|
||||||
CodecLongName = stream.CodecLongName,
|
CodecLongName = stream.CodecLongName,
|
||||||
CodecTag = stream.CodecTag,
|
CodecTag = stream.CodecTag,
|
||||||
|
@ -98,7 +98,7 @@ private SubtitleStream ParseSubtitleStream(FFProbeStream stream)
|
||||||
return new SubtitleStream
|
return new SubtitleStream
|
||||||
{
|
{
|
||||||
Index = stream.Index,
|
Index = stream.Index,
|
||||||
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default,
|
BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default,
|
||||||
CodecName = stream.CodecName,
|
CodecName = stream.CodecName,
|
||||||
CodecLongName = stream.CodecLongName,
|
CodecLongName = stream.CodecLongName,
|
||||||
Duration = MediaAnalysisUtils.ParseDuration(stream),
|
Duration = MediaAnalysisUtils.ParseDuration(stream),
|
||||||
|
@ -135,6 +135,9 @@ public static double ParseDoubleInvariant(string line) =>
|
||||||
public static int ParseIntInvariant(string line) =>
|
public static int ParseIntInvariant(string line) =>
|
||||||
int.Parse(line, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture);
|
int.Parse(line, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
public static long ParseLongInvariant(string line) =>
|
||||||
|
long.Parse(line, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
|
||||||
public static TimeSpan ParseDuration(string duration)
|
public static TimeSpan ParseDuration(string duration)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class MediaStream
|
||||||
public string CodecLongName { get; internal set; } = null!;
|
public string CodecLongName { get; internal 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 int BitRate { get; internal set; }
|
public long BitRate { get; internal set; }
|
||||||
public TimeSpan Duration { get; internal set; }
|
public TimeSpan Duration { get; internal set; }
|
||||||
public string? Language { get; internal set; }
|
public string? Language { get; internal set; }
|
||||||
public Dictionary<string, bool>? Disposition { get; internal set; }
|
public Dictionary<string, bool>? Disposition { get; internal set; }
|
||||||
|
|
Loading…
Reference in a new issue