mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-30 11:10:22 -06:00
FF-240 - updated setting metadata
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -75,23 +75,21 @@ namespace FileFlows.AudioNodes
|
||||
variables.AddOrUpdate("audio.TotalDiscs", AudioInfo.TotalDiscs < 1 ? 1 : AudioInfo.TotalDiscs);
|
||||
|
||||
|
||||
if (args.OriginalMetadata == null)
|
||||
{
|
||||
args.OriginalMetadata = new Dictionary<string, object>();
|
||||
args.OriginalMetadata.Add("Duration", AudioInfo.Duration);
|
||||
args.OriginalMetadata.Add("Codec", AudioInfo.Codec);
|
||||
args.OriginalMetadata.Add("Bitrate", AudioInfo.Bitrate);
|
||||
args.OriginalMetadata.Add("Channels", AudioInfo.Channels);
|
||||
AddIfSet(args.OriginalMetadata, "Date", AudioInfo.Date);
|
||||
AddIfSet(args.OriginalMetadata, "Frequency", AudioInfo.Frequency);
|
||||
AddIfSet(args.OriginalMetadata, "Encoder", AudioInfo.Encoder);
|
||||
AddIfSet(args.OriginalMetadata, "Genres", AudioInfo.Genres);
|
||||
AddIfSet(args.OriginalMetadata, "Language", AudioInfo.Language);
|
||||
AddIfSet(args.OriginalMetadata, "Title", AudioInfo.Title);
|
||||
AddIfSet(args.OriginalMetadata, "Track", AudioInfo.Track);
|
||||
AddIfSet(args.OriginalMetadata, "Disc", AudioInfo.Disc);
|
||||
AddIfSet(args.OriginalMetadata, "TotalDiscs", AudioInfo.TotalDiscs);
|
||||
}
|
||||
var metadata = new Dictionary<string, object>();
|
||||
metadata.Add("Duration", AudioInfo.Duration);
|
||||
metadata.Add("Codec", AudioInfo.Codec);
|
||||
metadata.Add("Bitrate", AudioInfo.Bitrate);
|
||||
metadata.Add("Channels", AudioInfo.Channels);
|
||||
AddIfSet(metadata, "Date", AudioInfo.Date);
|
||||
AddIfSet(metadata, "Frequency", AudioInfo.Frequency);
|
||||
AddIfSet(metadata, "Encoder", AudioInfo.Encoder);
|
||||
AddIfSet(metadata, "Genres", AudioInfo.Genres);
|
||||
AddIfSet(metadata, "Language", AudioInfo.Language);
|
||||
AddIfSet(metadata, "Title", AudioInfo.Title);
|
||||
AddIfSet(metadata, "Track", AudioInfo.Track);
|
||||
AddIfSet(metadata, "Disc", AudioInfo.Disc);
|
||||
AddIfSet(metadata, "TotalDiscs", AudioInfo.TotalDiscs);
|
||||
args.SetMetadata(metadata);
|
||||
|
||||
args.UpdateVariables(variables);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -45,13 +45,10 @@ public class ComicConverter: Node
|
||||
currentFormat = currentFormat[1..]; // remove the dot
|
||||
currentFormat = currentFormat.ToLower();
|
||||
|
||||
|
||||
if (args.OriginalMetadata == null)
|
||||
{
|
||||
args.OriginalMetadata = new Dictionary<string, object>();
|
||||
args.OriginalMetadata.Add("Format", currentFormat);
|
||||
args.OriginalMetadata.Add("Pages", GetPageCount(currentFormat, args.WorkingFile));
|
||||
}
|
||||
var metadata = new Dictionary<string, object>();
|
||||
metadata.Add("Format", currentFormat);
|
||||
metadata.Add("Pages", GetPageCount(currentFormat, args.WorkingFile));
|
||||
args.SetMetadata(metadata);
|
||||
|
||||
if (currentFormat == Format)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace FileFlows.ComicNodes.Comics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FileFlows.ComicNodes.Comics;
|
||||
|
||||
public class ComicExtractor : Node
|
||||
{
|
||||
@@ -24,6 +26,12 @@ public class ComicExtractor : Node
|
||||
}
|
||||
Helpers.ComicExtractor.Extract(args, args.WorkingFile, dest, halfProgress: false);
|
||||
|
||||
var metadata = new Dictionary<string, object>();
|
||||
metadata.Add("Format", args.WorkingFile.Substring(args.WorkingFile.LastIndexOf(".") + 1));
|
||||
var rgxImages = new Regex(@"\.(jpeg|jpg|jpe|png|bmp|tiff|webp|gif)$");
|
||||
metadata.Add("Pages", Directory.GetFiles(dest, "*.*", SearchOption.AllDirectories).Where(x => rgxImages.IsMatch(x)).Count());
|
||||
args.SetMetadata(metadata);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -16,6 +16,12 @@ public abstract class ImageBaseNode:Node
|
||||
Format = format.Name
|
||||
};
|
||||
|
||||
var metadata = new Dictionary<string, object>();
|
||||
metadata.Add("Format", imageInfo.Format);
|
||||
metadata.Add("Width", imageInfo.Width);
|
||||
metadata.Add("Height", imageInfo.Height);
|
||||
args.SetMetadata(metadata);
|
||||
|
||||
variables ??= new Dictionary<string, object>();
|
||||
if (args.Parameters.ContainsKey(IMAGE_INFO))
|
||||
args.Parameters[IMAGE_INFO] = imageInfo;
|
||||
@@ -58,7 +64,7 @@ public abstract class ImageBaseNode:Node
|
||||
{
|
||||
if (args.Parameters.ContainsKey(IMAGE_INFO) == false)
|
||||
{
|
||||
args.Logger?.WLog("No codec information loaded, use a 'Image File' node first");
|
||||
args.Logger?.WLog("No image information loaded, use a 'Image File' node first");
|
||||
return null;
|
||||
}
|
||||
var result = args.Parameters[IMAGE_INFO] as ImageInfo;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -13,18 +13,33 @@
|
||||
|
||||
List<string> results= new List<string> { "-map", Stream.InputFileIndex + ":s:{sourceTypeIndex}", "-c:s:{index}" };
|
||||
|
||||
if(args.DestinationExtension == "mkv" && Stream.Codec == "mov_text")
|
||||
switch (args.DestinationExtension)
|
||||
{
|
||||
results.Add("srt");
|
||||
}
|
||||
else
|
||||
{
|
||||
results.Add("copy");
|
||||
case "mkv":
|
||||
{
|
||||
if(Stream.Codec == "mov_text")
|
||||
results.Add("srt");
|
||||
else
|
||||
results.Add("copy");
|
||||
}
|
||||
break;
|
||||
case "mp4":
|
||||
{
|
||||
results.Add("mov_text");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
results.Add("copy");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(this.Title) == false)
|
||||
{
|
||||
// first s: means stream speicific, this is suppose to have :s:s
|
||||
// https://stackoverflow.com/a/21059838
|
||||
results.Add($"-metadata:s:s:{args.OutputTypeIndex}");
|
||||
results.Add($"title={(this.Title == FfmpegStream.REMOVED ? "" : this.Title)}");
|
||||
}
|
||||
|
||||
@@ -279,11 +279,7 @@ namespace FileFlows.VideoNodes
|
||||
audio.TypeIndex = int.Parse(Regex.Match(line, @"#([\d]+):([\d]+)").Groups[2].Value) - 1;
|
||||
audio.Codec = parts[0].Substring(parts[0].IndexOf("Audio: ") + "Audio: ".Length).Trim().Split(' ').First().ToLower() ?? "";
|
||||
|
||||
var langSection = Regex.Match(line, @"(?<=(Stream\s#[\d]+:[\d]+))[^:]+");
|
||||
if(langSection.Success)
|
||||
{
|
||||
audio.Language = Regex.Match(langSection.Value, @"(?<=\()[^)]+").Value?.ToLower() ?? string.Empty;
|
||||
}
|
||||
audio.Language = GetLanguage(line);
|
||||
if (info.IndexOf("0 channels") >= 0)
|
||||
{
|
||||
audio.Channels = 0;
|
||||
@@ -340,7 +336,7 @@ namespace FileFlows.VideoNodes
|
||||
SubtitleStream sub = new SubtitleStream();
|
||||
sub.TypeIndex = int.Parse(Regex.Match(line, @"#([\d]+):([\d]+)").Groups[2].Value);
|
||||
sub.Codec = line.Substring(line.IndexOf("Subtitle: ") + "Subtitle: ".Length).Trim().Split(' ').First().ToLower();
|
||||
sub.Language = Regex.Match(line, @"(?<=(Stream\s#[\d]+:[\d]+)\()[^\)]+").Value?.ToLower() ?? "";
|
||||
sub.Language = GetLanguage(line);
|
||||
|
||||
if (rgxTitle.IsMatch(info))
|
||||
sub.Title = rgxTitle.Match(info).Value.Trim();
|
||||
@@ -348,5 +344,16 @@ namespace FileFlows.VideoNodes
|
||||
sub.Forced = info.ToLower().Contains("forced");
|
||||
return sub;
|
||||
}
|
||||
|
||||
private static string GetLanguage(string line)
|
||||
{
|
||||
var langSection = Regex.Match(line, @"(?<=(Stream\s#[\d]+:[\d]+))[^:]+");
|
||||
if (langSection.Success == false)
|
||||
return string.Empty;
|
||||
var lang = Regex.Match(langSection.Value, @"(?<=\()[^)]+").Value?.ToLower() ?? string.Empty;
|
||||
if (lang == "und")
|
||||
return string.Empty;
|
||||
return lang;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>1.0.0.170</FileVersion>
|
||||
<ProductVersion>1.0.0.170</ProductVersion>
|
||||
<FileVersion>1.0.0.171</FileVersion>
|
||||
<ProductVersion>1.0.0.171</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -114,40 +114,38 @@ namespace FileFlows.VideoNodes
|
||||
|
||||
args.UpdateVariables(variables);
|
||||
|
||||
if(args.OriginalMetadata == null)
|
||||
var metadata = new Dictionary<string, object>();
|
||||
metadata.Add("Duration", videoInfo.VideoStreams[0].Duration);
|
||||
foreach (var (stream, i) in videoInfo.VideoStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
args.OriginalMetadata = new Dictionary<string, object>();
|
||||
args.OriginalMetadata.Add("Duration", videoInfo.VideoStreams[0].Duration);
|
||||
foreach (var (stream, i) in videoInfo.VideoStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
string prefix = "Video" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
args.OriginalMetadata.Add(prefix + "Codec", stream.Codec);
|
||||
args.OriginalMetadata.Add(prefix + "Resolution", stream.Width + "x" + stream.Height + (stream.HDR ? " (HDR)" : string.Empty));
|
||||
if(stream.Bitrate > 0)
|
||||
args.OriginalMetadata.Add(prefix + "Bitrate", stream.Bitrate);
|
||||
}
|
||||
foreach (var (stream, i) in videoInfo.AudioStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
string prefix = "Audio" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
args.OriginalMetadata.Add(prefix + "Codec", stream.Codec);
|
||||
args.OriginalMetadata.Add(prefix + "Channels", stream.Channels);
|
||||
if (string.IsNullOrEmpty(stream.Title) == false)
|
||||
args.OriginalMetadata.Add(prefix + "Title", stream.Title);
|
||||
if(string.IsNullOrEmpty(stream.Language) == false)
|
||||
args.OriginalMetadata.Add(prefix + "Language", stream.Language);
|
||||
if (stream.Bitrate > 0)
|
||||
args.OriginalMetadata.Add(prefix + "Bitrate", stream.Bitrate);
|
||||
}
|
||||
foreach (var (strream, i) in videoInfo.SubtitleStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
string prefix = "Audio" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
args.OriginalMetadata.Add(prefix + "Codec", strream.Codec);
|
||||
if (string.IsNullOrEmpty(strream.Title) == false)
|
||||
args.OriginalMetadata.Add(prefix + "Title", strream.Title);
|
||||
if (string.IsNullOrEmpty(strream.Language) == false)
|
||||
args.OriginalMetadata.Add(prefix + "Language", strream.Language);
|
||||
}
|
||||
string prefix = "Video" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
metadata.Add(prefix + "Codec", stream.Codec);
|
||||
metadata.Add(prefix + "Resolution", stream.Width + "x" + stream.Height + (stream.HDR ? " (HDR)" : string.Empty));
|
||||
if(stream.Bitrate > 0)
|
||||
metadata.Add(prefix + "Bitrate", stream.Bitrate);
|
||||
}
|
||||
foreach (var (stream, i) in videoInfo.AudioStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
string prefix = "Audio" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
metadata.Add(prefix + "Codec", stream.Codec);
|
||||
metadata.Add(prefix + "Channels", stream.Channels);
|
||||
if (string.IsNullOrEmpty(stream.Title) == false)
|
||||
metadata.Add(prefix + "Title", stream.Title);
|
||||
if(string.IsNullOrEmpty(stream.Language) == false)
|
||||
metadata.Add(prefix + "Language", stream.Language);
|
||||
if (stream.Bitrate > 0)
|
||||
metadata.Add(prefix + "Bitrate", stream.Bitrate);
|
||||
}
|
||||
foreach (var (strream, i) in videoInfo.SubtitleStreams.Select((value, i) => (value, i)))
|
||||
{
|
||||
string prefix = "Subtitle" + (i == 0 ? "" : " " + (i + 1)) + " ";
|
||||
metadata.Add(prefix + "Codec", strream.Codec);
|
||||
if (string.IsNullOrEmpty(strream.Title) == false)
|
||||
metadata.Add(prefix + "Title", strream.Title);
|
||||
if (string.IsNullOrEmpty(strream.Language) == false)
|
||||
metadata.Add(prefix + "Language", strream.Language);
|
||||
}
|
||||
args.SetMetadata(metadata);
|
||||
}
|
||||
|
||||
protected VideoInfo GetVideoInfo(NodeParameters args, bool refreshIfFileChanged = true)
|
||||
|
||||
Reference in New Issue
Block a user