video is flow elements

This commit is contained in:
John Andrews
2025-01-28 20:53:48 +13:00
parent 3f73535770
commit a5ee772f8f
18 changed files with 394 additions and 5 deletions

View File

@@ -37,11 +37,7 @@ public class VideoIs8Bit : VideoNode
{
var videoInfo = GetVideoInfo(args);
if (videoInfo == null)
{
args.FailureReason = "Failed to retrieve video info";
args.Logger?.ELog(args.FailureReason);
return -1;
}
return args.Fail("Failed to retrieve video info");
bool is8Bit = videoInfo.VideoStreams?.Any(x => x.Bits == 8) == true;
if (is8Bit)

View File

@@ -0,0 +1,14 @@
namespace FileFlows.VideoNodes;
/// <summary>
/// Video is AV1
/// </summary>
public class VideoIsAV1 : VideoIsCodec
{
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/logical-nodes/video-is-av1";
/// <inheritdoc />
protected override bool CodecMatches(string codec)
=> codec.Contains("av1", StringComparison.InvariantCultureIgnoreCase);
}

View File

@@ -0,0 +1,39 @@
namespace FileFlows.VideoNodes;
/// <summary>
/// Flow element to test a video is a specific codec
/// </summary>
public abstract class VideoIsCodec: VideoNode
{
/// <inheritdoc />
public override int Inputs => 1;
/// <inheritdoc />
public override int Outputs => 2;
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Logic;
/// <inheritdoc />
public override string Icon => "fas fa-question";
/// <summary>
/// Executes the flow element
/// </summary>
/// <param name="args">the arguments</param>
/// <returns>the output to call next</returns>
public override int Execute(NodeParameters args)
{
var videoInfo = GetVideoInfo(args);
if (videoInfo == null)
return args.Fail("Failed to retrieve video info");
var matches = videoInfo.VideoStreams.Any(x => CodecMatches(x.Codec));
args.Logger?.ILog($"Codec is {(matches ? "" : "not ")}a match");
return matches ? 1 : 2;
}
/// <summary>
/// Performs the check if the codec matches, return true if a match, otherwise false
/// </summary>
/// <param name="codec">the codec to test</param>
/// <returns>true if matches, otherwise false</returns>
protected abstract bool CodecMatches(string codec);
}

View File

@@ -0,0 +1,14 @@
namespace FileFlows.VideoNodes;
/// <summary>
/// Video is H264
/// </summary>
public class VideoIsH264 : VideoIsCodec
{
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/logical-nodes/video-is-h264";
/// <inheritdoc />
protected override bool CodecMatches(string codec)
=> codec.ToLowerInvariant() is "h264" or "h.264" or "264";
}

View File

@@ -0,0 +1,14 @@
namespace FileFlows.VideoNodes;
/// <summary>
/// Video is HEVC
/// </summary>
public class VideoIsHevc : VideoIsCodec
{
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/logical-nodes/video-is-hevc";
/// <inheritdoc />
protected override bool CodecMatches(string codec)
=> codec.ToLowerInvariant() is "hevc" or "h265" or "265" or "h.265";
}

View File

@@ -1090,6 +1090,14 @@
"2": "Video ist nicht 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Prüft, ob eine Videodatei AV1 ist",
"Label": "Video ist AV1",
"Outputs": {
"1": "Video ist AV1",
"2": "Video ist nicht AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Prüft, ob eine Videodatei H.264 ist",
"Label": "Video ist H.264",
"Outputs": {
"1": "Video ist H.264",
"2": "Video ist nicht H.264"
}
},
"VideoIsHevc": {
"Description": "Prüft, ob eine Videodatei HEVC ist",
"Label": "Video ist HEVC",
"Outputs": {
"1": "Video ist HEVC",
"2": "Video ist nicht HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Testet ob die Videodatei interlaced ist.",
"Label": "Video ist Interlaced",

View File

@@ -1090,6 +1090,14 @@
"2": "Video is not 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Checks if the video file is encoded in AV1 format.",
"Label": "Video Is AV1",
"Outputs": {
"1": "Video is AV1.",
"2": "Video is not AV1."
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Checks if the video file is encoded in H.264 format.",
"Label": "Video Is H.264",
"Outputs": {
"1": "Video is H.264.",
"2": "Video is not H.264."
}
},
"VideoIsHevc": {
"Description": "Checks if the video file is encoded in HEVC format.",
"Label": "Video Is HEVC",
"Outputs": {
"1": "Video is HEVC.",
"2": "Video is not HEVC."
}
},
"VideoIsInterlaced": {
"Description": "Tests if a video file is interlaced",
"Label": "Video Is Interlaced",

View File

@@ -1090,6 +1090,14 @@
"2": "El video no es de 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Comprueba si un archivo de video es AV1",
"Label": "El video es AV1",
"Outputs": {
"1": "El video es AV1",
"2": "El video no es AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Comprueba si un archivo de video es H.264",
"Label": "El video es H.264",
"Outputs": {
"1": "El video es H.264",
"2": "El video no es H.264"
}
},
"VideoIsHevc": {
"Description": "Comprueba si un archivo de video es HEVC",
"Label": "El video es HEVC",
"Outputs": {
"1": "El video es HEVC",
"2": "El video no es HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Prueba si un archivo de video está entrelazado",
"Label": "El video está entrelazado",

View File

@@ -1090,6 +1090,14 @@
"2": "La vidéo n'est pas de 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Teste si un fichier vidéo est AV1",
"Label": "La vidéo est AV1",
"Outputs": {
"1": "La vidéo est AV1",
"2": "La vidéo n'est pas AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Teste si un fichier vidéo est H.264",
"Label": "La vidéo est H.264",
"Outputs": {
"1": "La vidéo est H.264",
"2": "La vidéo n'est pas H.264"
}
},
"VideoIsHevc": {
"Description": "Teste si un fichier vidéo est HEVC",
"Label": "La vidéo est HEVC",
"Outputs": {
"1": "La vidéo est HEVC",
"2": "La vidéo n'est pas HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Teste si un fichier vidéo est entrelacé",
"Label": "La vidéo est entrelacée",

View File

@@ -1090,6 +1090,14 @@
"2": "Il video non è 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Verifica se un file video è AV1",
"Label": "Il video è AV1",
"Outputs": {
"1": "Il video è AV1",
"2": "Il video non è AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Verifica se un file video è H.264",
"Label": "Il video è H.264",
"Outputs": {
"1": "Il video è H.264",
"2": "Il video non è H.264"
}
},
"VideoIsHevc": {
"Description": "Verifica se un file video è HEVC",
"Label": "Il video è HEVC",
"Outputs": {
"1": "Il video è HEVC",
"2": "Il video non è HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Controlla se un file video è interlacciato.",
"Label": "Il video è interlacciato",

View File

@@ -1090,6 +1090,14 @@
"2": "ビデオは8ビットではありません"
}
},
"VideoIsAV1": {
"Description": "ビデオファイルがAV1であるかをテストします",
"Label": "ビデオはAV1です",
"Outputs": {
"1": "ビデオはAV1です",
"2": "ビデオはAV1ではありません!"
}
},
"VideoIsDolbyVision": {
"Description": "Checks if a video file is Dolby Vision.",
"Label": "Video Is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "The video is not Dolby Vision."
}
},
"VideoIsH264": {
"Description": "ビデオファイルがH.264であるかをテストします",
"Label": "ビデオはH.264です",
"Outputs": {
"1": "ビデオはH.264です",
"2": "ビデオはH.264ではありません!"
}
},
"VideoIsHevc": {
"Description": "ビデオファイルがHEVCであるかをテストします",
"Label": "ビデオはHEVCです",
"Outputs": {
"1": "ビデオはHEVCです",
"2": "ビデオはHEVCではありません!"
}
},
"VideoIsInterlaced": {
"Description": "ビデオファイルがインターレースされているかテストします。",
"Label": "ビデオはインターレースされています",

View File

@@ -1090,6 +1090,14 @@
"2": "비디오는 8-Bit가 아닙니다."
}
},
"VideoIsAV1": {
"Description": "비디오 파일이 AV1인지 테스트합니다",
"Label": "비디오는 AV1입니다",
"Outputs": {
"1": "비디오는 AV1입니다",
"2": "비디오는 AV1이 아닙니다!"
}
},
"VideoIsDolbyVision": {
"Description": "비디오 파일이 Dolby Vision인지 확인합니다.",
"Label": "비디오가 Dolby Vision인지",
@@ -1098,6 +1106,22 @@
"2": "비디오는 Dolby Vision이 아닙니다."
}
},
"VideoIsH264": {
"Description": "비디오 파일이 H.264인지 테스트합니다",
"Label": "비디오는 H.264입니다",
"Outputs": {
"1": "비디오는 H.264입니다",
"2": "비디오는 H.264가 아닙니다!"
}
},
"VideoIsHevc": {
"Description": "비디오 파일이 HEVC인지 테스트합니다",
"Label": "비디오는 HEVC입니다",
"Outputs": {
"1": "비디오는 HEVC입니다",
"2": "비디오는 HEVC가 아닙니다!"
}
},
"VideoIsInterlaced": {
"Description": "비디오 파일이 인터레이스인지 테스트합니다.",
"Label": "비디오 인터레이스",

View File

@@ -1090,6 +1090,14 @@
"2": "Video is geen 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Test of een videobestand AV1 is",
"Label": "Video is AV1",
"Outputs": {
"1": "Video is AV1",
"2": "Video is geen AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Controleert of een videobestand Dolby Vision is.",
"Label": "Video is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "De video is niet Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Test of een videobestand H.264 is",
"Label": "Video is H.264",
"Outputs": {
"1": "Video is H.264",
"2": "Video is geen H.264"
}
},
"VideoIsHevc": {
"Description": "Test of een videobestand HEVC is",
"Label": "Video is HEVC",
"Outputs": {
"1": "Video is HEVC",
"2": "Video is geen HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Test of een videobestand interlaced is",
"Label": "Video Is Interlaced",

View File

@@ -1090,6 +1090,14 @@
"2": "O vídeo não é de 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Testa se um arquivo de vídeo é AV1",
"Label": "O vídeo é AV1",
"Outputs": {
"1": "O vídeo é AV1",
"2": "O vídeo não é AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Controleert of een videobestand Dolby Vision is.",
"Label": "Video is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "De video is niet Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Testa se um arquivo de vídeo é H.264",
"Label": "O vídeo é H.264",
"Outputs": {
"1": "O vídeo é H.264",
"2": "O vídeo não é H.264"
}
},
"VideoIsHevc": {
"Description": "Testa se um arquivo de vídeo é HEVC",
"Label": "O vídeo é HEVC",
"Outputs": {
"1": "O vídeo é HEVC",
"2": "O vídeo não é HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Testa se um arquivo de vídeo é entrelaçado",
"Label": "O vídeo é entrelaçado",

View File

@@ -1090,6 +1090,14 @@
"2": "Видео не 8-битное"
}
},
"VideoIsAV1": {
"Description": "Проверяет, является ли видеофайл AV1",
"Label": "Видео является AV1",
"Outputs": {
"1": "Видео является AV1",
"2": "Видео не является AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Controleert of een videobestand Dolby Vision is.",
"Label": "Video is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "De video is niet Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Проверяет, является ли видеофайл H.264",
"Label": "Видео является H.264",
"Outputs": {
"1": "Видео является H.264",
"2": "Видео не является H.264"
}
},
"VideoIsHevc": {
"Description": "Проверяет, является ли видеофайл HEVC",
"Label": "Видео является HEVC",
"Outputs": {
"1": "Видео является HEVC",
"2": "Видео не является HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Проверяет, является ли видеофайл интерлейсированным",
"Label": "Видео интерлейсированное",

View File

@@ -1090,6 +1090,14 @@
"2": "Videon är inte 8-Bit"
}
},
"VideoIsAV1": {
"Description": "Testar om en videofil är AV1",
"Label": "Videon är AV1",
"Outputs": {
"1": "Videon är AV1",
"2": "Videon är inte AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Controleert of een videobestand Dolby Vision is.",
"Label": "Video is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "De video is niet Dolby Vision."
}
},
"VideoIsH264": {
"Description": "Testar om en videofil är H.264",
"Label": "Videon är H.264",
"Outputs": {
"1": "Videon är H.264",
"2": "Videon är inte H.264"
}
},
"VideoIsHevc": {
"Description": "Testar om en videofil är HEVC",
"Label": "Videon är HEVC",
"Outputs": {
"1": "Videon är HEVC",
"2": "Videon är inte HEVC"
}
},
"VideoIsInterlaced": {
"Description": "Testar om en videofil är mellanlagrad",
"Label": "Video Är Mellanlagrad",

View File

@@ -1090,6 +1090,14 @@
"2": "视频不是8位"
}
},
"VideoIsAV1": {
"Description": "测试视频文件是否为AV1",
"Label": "视频是AV1",
"Outputs": {
"1": "视频是AV1",
"2": "视频不是AV1"
}
},
"VideoIsDolbyVision": {
"Description": "Controleert of een videobestand Dolby Vision is.",
"Label": "Video is Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "De video is niet Dolby Vision."
}
},
"VideoIsH264": {
"Description": "测试视频文件是否为H.264",
"Label": "视频是H.264",
"Outputs": {
"1": "视频是H.264",
"2": "视频不是H.264"
}
},
"VideoIsHevc": {
"Description": "测试视频文件是否为HEVC",
"Label": "视频是HEVC",
"Outputs": {
"1": "视频是HEVC",
"2": "视频不是HEVC"
}
},
"VideoIsInterlaced": {
"Description": "测试视频文件是否为交错",
"Label": "视频是交错",

View File

@@ -1090,6 +1090,14 @@
"2": "視頻不是8位"
}
},
"VideoIsAV1": {
"Description": "測試視頻文件是否為AV1格式",
"Label": "視頻是否為AV1",
"Outputs": {
"1": "視頻為AV1格式",
"2": "視頻不是AV1格式"
}
},
"VideoIsDolbyVision": {
"Description": "測試視頻文件是否為Dolby Vision。",
"Label": "視頻是Dolby Vision",
@@ -1098,6 +1106,22 @@
"2": "視頻不是Dolby Vision。"
}
},
"VideoIsH264": {
"Description": "測試視頻文件是否為H.264格式",
"Label": "視頻是否為H.264",
"Outputs": {
"1": "視頻為H.264格式",
"2": "視頻不是H.264格式"
}
},
"VideoIsHevc": {
"Description": "測試視頻文件是否為HEVC格式",
"Label": "視頻是否為HEVC",
"Outputs": {
"1": "視頻為HEVC格式",
"2": "視頻不是HEVC格式"
}
},
"VideoIsInterlaced": {
"Description": "測試視頻文件是否為交錯",
"Label": "視頻為交錯",