diff --git a/AudioNodes/Tests/CreateAudioBookTests.cs b/AudioNodes/Tests/CreateAudioBookTests.cs index d04802ff..4203c03e 100644 --- a/AudioNodes/Tests/CreateAudioBookTests.cs +++ b/AudioNodes/Tests/CreateAudioBookTests.cs @@ -1,76 +1,76 @@ -#if(DEBUG) - -using System.Reflection.Metadata; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using FileFlows.AudioNodes.AudioBooks; - -namespace FileFlows.AudioNodes.Tests; - - -[TestClass] -public class CreateAudioBookTests -{ - - [TestMethod] - public void CreateAudioBookTest_01() - { - const string folder = "/home/john/Music/Audio Books/James Dashner (2020) Maze Runner 05.5"; - RunTest(folder); - } - - [TestMethod] - public void CreateAudioBookTest_02() - { - const string folder = @"/home/john/Music/Audio Books/Charlie and the Great Glass Elevator"; - RunTest(folder); - } - - [TestMethod] - public void CreateAudioBookTest_03() - { - const string folder = @"/home/john/Music/Audio Books/Scott Westerfeld - Afterworlds"; - RunTest(folder); - } - - [TestMethod] - public void CreateAudioBookTest_04() - { - const string folder = @"/home/john/Music/Audio Books/Small Town-Lawrence Block"; - RunTest(folder); - } - - [TestMethod] - public void CreateAudioBookTest_05() - { - const string folder = @"/home/john/Music/Audio Books/Shatter City"; - RunTest(folder, 2); - } - - [TestMethod] - public void CreateAudioBookTest_06() - { - const string folder = @"/home/john/Music/Audio Books/Among the Betrayed - Margaret Peterson Haddix (M4B)"; - RunTest(folder, 2); - } - - private void RunTest(string folder, int expected = 1) - { - CreateAudioBook node = new (); - var logger = new TestLogger(); - var args = new FileFlows.Plugin.NodeParameters(folder,logger, true, string.Empty); - args.GetToolPathActual = (string tool) => @"/usr/bin/ffmpeg"; - const string tempPath= @"/home/john/Music/test"; - args.TempPath =tempPath ; - foreach (var file in new DirectoryInfo(tempPath).GetFiles( "*.*")) - { - file.Delete(); - } - - int output = node.Execute(args); - - var log = logger.ToString(); - Assert.AreEqual(expected, output); - - } -} -#endif \ No newline at end of file +// #if(DEBUG) +// +// using System.Reflection.Metadata; +// using Microsoft.VisualStudio.TestTools.UnitTesting; +// using FileFlows.AudioNodes.AudioBooks; +// +// namespace FileFlows.AudioNodes.Tests; +// +// +// [TestClass] +// public class CreateAudioBookTests +// { +// +// [TestMethod] +// public void CreateAudioBookTest_01() +// { +// const string folder = "/home/john/Music/Audio Books/James Dashner (2020) Maze Runner 05.5"; +// RunTest(folder); +// } +// +// [TestMethod] +// public void CreateAudioBookTest_02() +// { +// const string folder = @"/home/john/Music/Audio Books/Charlie and the Great Glass Elevator"; +// RunTest(folder); +// } +// +// [TestMethod] +// public void CreateAudioBookTest_03() +// { +// const string folder = @"/home/john/Music/Audio Books/Scott Westerfeld - Afterworlds"; +// RunTest(folder); +// } +// +// [TestMethod] +// public void CreateAudioBookTest_04() +// { +// const string folder = @"/home/john/Music/Audio Books/Small Town-Lawrence Block"; +// RunTest(folder); +// } +// +// [TestMethod] +// public void CreateAudioBookTest_05() +// { +// const string folder = @"/home/john/Music/Audio Books/Shatter City"; +// RunTest(folder, 2); +// } +// +// [TestMethod] +// public void CreateAudioBookTest_06() +// { +// const string folder = @"/home/john/Music/Audio Books/Among the Betrayed - Margaret Peterson Haddix (M4B)"; +// RunTest(folder, 2); +// } +// +// private void RunTest(string folder, int expected = 1) +// { +// CreateAudioBook node = new (); +// var logger = new TestLogger(); +// var args = new FileFlows.Plugin.NodeParameters(folder,logger, true, string.Empty); +// args.GetToolPathActual = (string tool) => @"/usr/bin/ffmpeg"; +// const string tempPath= @"/home/john/Music/test"; +// args.TempPath =tempPath ; +// foreach (var file in new DirectoryInfo(tempPath).GetFiles( "*.*")) +// { +// file.Delete(); +// } +// +// int output = node.Execute(args); +// +// var log = logger.ToString(); +// Assert.AreEqual(expected, output); +// +// } +// } +// #endif \ No newline at end of file diff --git a/VideoNodes/VideoInfo.cs b/VideoNodes/VideoInfo.cs index 881f74d6..180e51b0 100644 --- a/VideoNodes/VideoInfo.cs +++ b/VideoNodes/VideoInfo.cs @@ -1,131 +1,182 @@ -namespace FileFlows.VideoNodes +namespace FileFlows.VideoNodes; + +/// +/// Metadata about a video file +/// +public class VideoInfo { - public class VideoInfo - { - public string FileName { get; set; } - /// - /// Gets or sets the bitrate in bytes per second - /// - public float Bitrate { get; set; } - public List VideoStreams { get; set; } = new List(); - public List AudioStreams { get; set; } = new List(); - public List SubtitleStreams { get; set; } = new List(); + /// + /// Gets or sets the full filename of the file + /// + public string FileName { get; set; } + /// + /// Gets or sets the bitrate in bytes per second + /// + public float Bitrate { get; set; } + + /// + /// Gets or sets the video streams contained in the file + /// + public List VideoStreams { get; set; } = new List(); + + /// + /// Gets or sets the audio streams contained in the file + /// + public List AudioStreams { get; set; } = new List(); + + /// + /// Gets or sets the subtitle streams contained in the file + /// + public List SubtitleStreams { get; set; } = new List(); - public List Chapters { get; set; } = new List(); - } + /// + /// Gets or sets the chapters in the file + /// + public List Chapters { get; set; } = new List(); +} - public class VideoFileStream - { - /// - /// The original index of the stream in the overall video - /// - public int Index { get; set; } - /// - /// The index of the specific type - /// - public int TypeIndex { get; set; } - /// - /// The stream title (name) - /// - public string Title { get; set; } = ""; +/// +/// Metadata about a stream in a vidoe file +/// +public class VideoFileStream +{ + /// + /// The original index of the stream in the overall video + /// + public int Index { get; set; } + /// + /// The index of the specific type + /// + public int TypeIndex { get; set; } + /// + /// The stream title (name) + /// + public string Title { get; set; } = ""; - /// - /// The bitrate(BPS) of the video stream in bytes per second - /// - public float Bitrate { get; set; } + /// + /// The bitrate(BPS) of the video stream in bytes per second + /// + public float Bitrate { get; set; } - /// - /// The codec of the stream - /// - public string Codec { get; set; } = ""; + /// + /// The codec of the stream + /// + public string Codec { get; set; } = ""; - /// - /// The codec tag of the stream - /// - public string CodecTag { get; set; } = ""; + /// + /// The codec tag of the stream + /// + public string CodecTag { get; set; } = ""; - /// - /// If this stream is an image - /// - public bool IsImage { get; set; } + /// + /// If this stream is an image + /// + public bool IsImage { get; set; } - /// - /// Gets or sets the index string of this track - /// - public string IndexString { get; set; } + /// + /// Gets or sets the index string of this track + /// + public string IndexString { get; set; } - /// - /// Gets or sets if the stream is HDR - /// - public bool HDR { get; set; } + /// + /// Gets or sets the input file index + /// + public int InputFileIndex { get; set; } = 0; +} - /// - /// Gets or sets the input file index - /// - public int InputFileIndex { get; set; } = 0; - } +/// +/// Metadata about a video stream +/// +public class VideoStream : VideoFileStream +{ + /// + /// Gets or sets if the stream is HDR + /// + public bool HDR { get; set; } + + /// + /// Gets or sets if this is dolby vision + /// + public bool DolbyVision { get; set; } + + /// + /// The width of the video stream + /// + public int Width { get; set; } + /// + /// The height of the video stream + /// + public int Height { get; set; } + /// + /// The number of frames per second + /// + public float FramesPerSecond { get; set; } - public class VideoStream : VideoFileStream - { - /// - /// The width of the video stream - /// - public int Width { get; set; } - /// - /// The height of the video stream - /// - public int Height { get; set; } - /// - /// The number of frames per second - /// - public float FramesPerSecond { get; set; } + /// + /// The duration of the stream + /// + public TimeSpan Duration { get; set; } +} - /// - /// The duration of the stream - /// - public TimeSpan Duration { get; set; } - } +/// +/// Metadata about an audio stream in a video file +/// +public class AudioStream : VideoFileStream +{ + /// + /// The language of the stream + /// + public string Language { get; set; } - public class AudioStream : VideoFileStream - { - /// - /// The language of the stream - /// - public string Language { get; set; } + /// + /// The channels of the stream + /// + public float Channels { get; set; } - /// - /// The channels of the stream - /// - public float Channels { get; set; } + /// + /// The duration of the stream + /// + public TimeSpan Duration { get; set; } - /// - /// The duration of the stream - /// - public TimeSpan Duration { get; set; } + /// + /// The sample rate of the audio stream + /// + public int SampleRate { get; set; } +} - /// - /// The sample rate of the audio stream - /// - public int SampleRate { get; set; } - } +/// +/// Metadata about a subtitle stream in a video file +/// +public class SubtitleStream : VideoFileStream +{ + /// + /// The language of the stream + /// + public string Language { get; set; } - public class SubtitleStream : VideoFileStream - { - /// - /// The language of the stream - /// - public string Language { get; set; } + /// + /// If this is a forced subtitle + /// + public bool Forced { get; set; } +} - /// - /// If this is a forced subtitle - /// - public bool Forced { get; set; } - } - - public class Chapter - { - public string Title { get; set; } - public TimeSpan Start { get; set; } - public TimeSpan End { get; set; } - } +/// +/// A chapter in a video file +/// +public class Chapter +{ + /// + /// Gets or sets the title of the stream + /// + public string Title { get; set; } + + /// + /// Gets or sets the start of the chapter + /// + public TimeSpan Start { get; set; } + + /// + /// Gets or sets the end of the chapter + /// + public TimeSpan End { get; set; } } \ No newline at end of file diff --git a/VideoNodes/VideoInfoHelper.cs b/VideoNodes/VideoInfoHelper.cs index 8d0785aa..50aed43e 100644 --- a/VideoNodes/VideoInfoHelper.cs +++ b/VideoNodes/VideoInfoHelper.cs @@ -269,6 +269,8 @@ namespace FileFlows.VideoNodes // "HDR is only the new transfer function" (PQ or HLG) vs.HDR = info.Contains("arib-std-b67") || info.Contains("smpte2084"); + vs.DolbyVision = info.Contains("DOVI configuration record"); + return vs; }