Skip to content

Commit

Permalink
Merge pull request #542 from Kaaybi/add-video-stream-level-to-ffprobe…
Browse files Browse the repository at this point in the history
…-analysis

Add video-stream level to FFProbe analysis
  • Loading branch information
rosenbjerg authored Dec 4, 2024
2 parents 71981ad + 4a6abef commit 4eb515d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions FFMpegCore.Test/FFProbeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void Probe_Success()
Assert.AreEqual(1, info.PrimaryVideoStream.SampleAspectRatio.Width);
Assert.AreEqual(1, info.PrimaryVideoStream.SampleAspectRatio.Height);
Assert.AreEqual("yuv420p", info.PrimaryVideoStream.PixelFormat);
Assert.AreEqual(31, info.PrimaryVideoStream.Level);
Assert.AreEqual(1280, info.PrimaryVideoStream.Width);
Assert.AreEqual(720, info.PrimaryVideoStream.Height);
Assert.AreEqual(25, info.PrimaryVideoStream.AvgFrameRate);
Expand Down
3 changes: 3 additions & 0 deletions FFMpegCore/FFProbe/FFProbeAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public class FFProbeStream : ITagsContainer, IDispositionContainer
[JsonPropertyName("pix_fmt")]
public string PixelFormat { get; set; } = null!;

[JsonPropertyName("level")]
public int Level { get; set; }

[JsonPropertyName("sample_rate")]
public string SampleRate { get; set; } = null!;

Expand Down
1 change: 1 addition & 0 deletions FFMpegCore/FFProbe/MediaAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private VideoStream ParseVideoStream(FFProbeStream stream)
Width = stream.Width ?? 0,
Profile = stream.Profile,
PixelFormat = stream.PixelFormat,
Level = stream.Level,
ColorRange = stream.ColorRange,
ColorSpace = stream.ColorSpace,
ColorTransfer = stream.ColorTransfer,
Expand Down
1 change: 1 addition & 0 deletions FFMpegCore/FFProbe/VideoStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class VideoStream : MediaStream
public int Height { get; set; }
public double FrameRate { get; set; }
public string PixelFormat { get; set; } = null!;
public int Level { get; set; }
public int Rotation { get; set; }
public double AverageFrameRate { get; set; }
public string ColorRange { get; set; } = null!;
Expand Down

0 comments on commit 4eb515d

Please sign in to comment.