FF-1361 - parsing video bits

This commit is contained in:
John Andrews
2024-02-22 14:17:19 +13:00
parent 011c61830d
commit 65cb4ee398
2 changed files with 11 additions and 13 deletions
+11 -11
View File
@@ -42,7 +42,7 @@ public class VideoInfo
}
/// <summary>
/// Metadata about a stream in a vidoe file
/// Metadata about a stream in a video file
/// </summary>
public class VideoFileStream
{
@@ -93,16 +93,6 @@ public class VideoFileStream
/// Gets or sets the pixel format that should be used to decode this stream
/// </summary>
public string PixelFormat { get; set; }
/// <summary>
/// Gets or sets if this stream is 10 bit
/// </summary>
public bool Is10Bit { get; set; }
/// <summary>
/// Gets or sets if this stream is 12 bit
/// </summary>
public bool Is12Bit { get; set; }
}
/// <summary>
@@ -120,6 +110,16 @@ public class VideoStream : VideoFileStream
/// 0 if unknown
/// </summary>
public int Bits { get; set; }
/// <summary>
/// Gets or sets if this stream is 10 bit
/// </summary>
public bool Is10Bit => Bits == 10;
/// <summary>
/// Gets or sets if this stream is 12 bit
/// </summary>
public bool Is12Bit => Bits == 12;
/// <summary>
/// Gets or sets if this is dolby vision
-2
View File
@@ -257,8 +257,6 @@ public class VideoInfoHelper
vs.Codec = line.Substring(line.IndexOf("Video: ") + "Video: ".Length).Replace(",", "").Trim().Split(' ').First().ToLower();
vs.PixelFormat = GetDecoderPixelFormat(line);
vs.Is10Bit = Regex.IsMatch(line, @"p(0)?10l(b)?e", RegexOptions.IgnoreCase);
vs.Is12Bit = Regex.IsMatch(line, @"p(0)?12l(b)?e", RegexOptions.IgnoreCase);
var dimensions = Regex.Match(line, @"([\d]{3,})x([\d]{3,})");
if (int.TryParse(dimensions.Groups[1].Value, out int width))