mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-18 12:36:44 +00:00
Merge branch 'main' into add-video-stream-level-to-ffprobe-analysis
This commit is contained in:
commit
cf9111881d
7 changed files with 36 additions and 0 deletions
|
@ -54,6 +54,9 @@
|
||||||
<None Update="Resources\input_audio_only_10sec.mp4">
|
<None Update="Resources\input_audio_only_10sec.mp4">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="Resources\input_hdr.mov">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Resources\input_video_only_3sec.mp4">
|
<None Update="Resources\input_video_only_3sec.mp4">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
@ -174,6 +174,18 @@ public async Task Probe_Success_FromStream_Async()
|
||||||
Assert.AreEqual(3, info.Duration.Seconds);
|
Assert.AreEqual(3, info.Duration.Seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod, Timeout(10000)]
|
||||||
|
public void Probe_HDR()
|
||||||
|
{
|
||||||
|
var info = FFProbe.Analyse(TestResources.HdrVideo);
|
||||||
|
|
||||||
|
Assert.IsNotNull(info.PrimaryVideoStream);
|
||||||
|
Assert.AreEqual("tv", info.PrimaryVideoStream.ColorRange);
|
||||||
|
Assert.AreEqual("bt2020nc", info.PrimaryVideoStream.ColorSpace);
|
||||||
|
Assert.AreEqual("arib-std-b67", info.PrimaryVideoStream.ColorTransfer);
|
||||||
|
Assert.AreEqual("bt2020", info.PrimaryVideoStream.ColorPrimaries);
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod, Timeout(10000)]
|
[TestMethod, Timeout(10000)]
|
||||||
public async Task Probe_Success_Subtitle_Async()
|
public async Task Probe_Success_Subtitle_Async()
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,6 +5,7 @@ public static class TestResources
|
||||||
public static readonly string Mp4Video = "./Resources/input_3sec.mp4";
|
public static readonly string Mp4Video = "./Resources/input_3sec.mp4";
|
||||||
public static readonly string Mp4VideoRotation = "./Resources/input_3sec_rotation_90deg.mp4";
|
public static readonly string Mp4VideoRotation = "./Resources/input_3sec_rotation_90deg.mp4";
|
||||||
public static readonly string WebmVideo = "./Resources/input_3sec.webm";
|
public static readonly string WebmVideo = "./Resources/input_3sec.webm";
|
||||||
|
public static readonly string HdrVideo = "./Resources/input_hdr.mov";
|
||||||
public static readonly string Mp4WithoutVideo = "./Resources/input_audio_only_10sec.mp4";
|
public static readonly string Mp4WithoutVideo = "./Resources/input_audio_only_10sec.mp4";
|
||||||
public static readonly string Mp4WithoutAudio = "./Resources/input_video_only_3sec.mp4";
|
public static readonly string Mp4WithoutAudio = "./Resources/input_video_only_3sec.mp4";
|
||||||
public static readonly string RawAudio = "./Resources/audio.raw";
|
public static readonly string RawAudio = "./Resources/audio.raw";
|
||||||
|
|
BIN
FFMpegCore.Test/Resources/input_hdr.mov
Normal file
BIN
FFMpegCore.Test/Resources/input_hdr.mov
Normal file
Binary file not shown.
|
@ -97,6 +97,18 @@ public class FFProbeStream : ITagsContainer, IDispositionContainer
|
||||||
|
|
||||||
[JsonPropertyName("side_data_list")]
|
[JsonPropertyName("side_data_list")]
|
||||||
public List<Dictionary<string, JsonValue>> SideData { get; set; } = null!;
|
public List<Dictionary<string, JsonValue>> SideData { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonPropertyName("color_range")]
|
||||||
|
public string ColorRange { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonPropertyName("color_space")]
|
||||||
|
public string ColorSpace { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonPropertyName("color_transfer")]
|
||||||
|
public string ColorTransfer { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonPropertyName("color_primaries")]
|
||||||
|
public string ColorPrimaries { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Format : ITagsContainer
|
public class Format : ITagsContainer
|
||||||
|
|
|
@ -88,6 +88,10 @@ private VideoStream ParseVideoStream(FFProbeStream stream)
|
||||||
Profile = stream.Profile,
|
Profile = stream.Profile,
|
||||||
PixelFormat = stream.PixelFormat,
|
PixelFormat = stream.PixelFormat,
|
||||||
Level = stream.Level,
|
Level = stream.Level,
|
||||||
|
ColorRange = stream.ColorRange,
|
||||||
|
ColorSpace = stream.ColorSpace,
|
||||||
|
ColorTransfer = stream.ColorTransfer,
|
||||||
|
ColorPrimaries = stream.ColorPrimaries,
|
||||||
Rotation = MediaAnalysisUtils.ParseRotation(stream),
|
Rotation = MediaAnalysisUtils.ParseRotation(stream),
|
||||||
Language = stream.GetLanguage(),
|
Language = stream.GetLanguage(),
|
||||||
Disposition = MediaAnalysisUtils.FormatDisposition(stream.Disposition),
|
Disposition = MediaAnalysisUtils.FormatDisposition(stream.Disposition),
|
||||||
|
|
|
@ -16,6 +16,10 @@ public class VideoStream : MediaStream
|
||||||
public int Level { get; set; }
|
public int Level { get; set; }
|
||||||
public int Rotation { get; set; }
|
public int Rotation { get; set; }
|
||||||
public double AverageFrameRate { get; set; }
|
public double AverageFrameRate { get; set; }
|
||||||
|
public string ColorRange { get; set; } = null!;
|
||||||
|
public string ColorSpace { get; set; } = null!;
|
||||||
|
public string ColorTransfer { get; set; } = null!;
|
||||||
|
public string ColorPrimaries { get; set; } = null!;
|
||||||
|
|
||||||
public PixelFormat GetPixelFormatInfo() => FFMpeg.GetPixelFormat(PixelFormat);
|
public PixelFormat GetPixelFormatInfo() => FFMpeg.GetPixelFormat(PixelFormat);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue