diff --git a/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js index d436e35..f25604c 100644 --- a/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js @@ -27,16 +27,22 @@ var details = function () { return ({ exports.details = details; // eslint-disable-next-line @typescript-eslint/no-unused-vars var plugin = function (args) { + var _a, _b; var lib = require('../../../../../methods/lib')(); // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); var is10Bit = false; - for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { - var stream = args.variables.ffmpegCommand.streams[i]; - if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { - is10Bit = true; + if (Array.isArray((_b = (_a = args === null || args === void 0 ? void 0 : args.inputFileObj) === null || _a === void 0 ? void 0 : _a.ffProbeData) === null || _b === void 0 ? void 0 : _b.streams)) { + for (var i = 0; i < args.inputFileObj.ffProbeData.streams.length; i += 1) { + var stream = args.inputFileObj.ffProbeData.streams[i]; + if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { + is10Bit = true; + } } } + else { + throw new Error('File has not stream data'); + } return { outputFileObj: args.inputFileObj, outputNumber: is10Bit ? 1 : 2, diff --git a/FlowPlugins/CommunityFlowPlugins/video/checkHdr/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/checkHdr/1.0.0/index.js index 286d38f..7aa6137 100644 --- a/FlowPlugins/CommunityFlowPlugins/video/checkHdr/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/video/checkHdr/1.0.0/index.js @@ -27,19 +27,25 @@ var details = function () { return ({ exports.details = details; // eslint-disable-next-line @typescript-eslint/no-unused-vars var plugin = function (args) { + var _a, _b; var lib = require('../../../../../methods/lib')(); // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); var isHdr = false; - for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { - var stream = args.variables.ffmpegCommand.streams[i]; - if (stream.codec_type === 'video' - && stream.transfer_characteristics === 'smpte2084' - && stream.color_primaries === 'bt2020' - && stream.color_range === 'tv') { - isHdr = true; + if (Array.isArray((_b = (_a = args === null || args === void 0 ? void 0 : args.inputFileObj) === null || _a === void 0 ? void 0 : _a.ffProbeData) === null || _b === void 0 ? void 0 : _b.streams)) { + for (var i = 0; i < args.inputFileObj.ffProbeData.streams.length; i += 1) { + var stream = args.inputFileObj.ffProbeData.streams[i]; + if (stream.codec_type === 'video' + && stream.transfer_characteristics === 'smpte2084' + && stream.color_primaries === 'bt2020' + && stream.color_range === 'tv') { + isHdr = true; + } } } + else { + throw new Error('File has not stream data'); + } return { outputFileObj: args.inputFileObj, outputNumber: isHdr ? 1 : 2, diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts index 88ac7e9..7791a6a 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts @@ -36,11 +36,15 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { let is10Bit = false; - for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { - const stream = args.variables.ffmpegCommand.streams[i]; - if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { - is10Bit = true; + if (Array.isArray(args?.inputFileObj?.ffProbeData?.streams)) { + for (let i = 0; i < args.inputFileObj.ffProbeData.streams.length; i += 1) { + const stream = args.inputFileObj.ffProbeData.streams[i]; + if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { + is10Bit = true; + } } + } else { + throw new Error('File has not stream data'); } return { diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/checkHdr/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/checkHdr/1.0.0/index.ts index ec9353d..68742f7 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/video/checkHdr/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/video/checkHdr/1.0.0/index.ts @@ -36,16 +36,20 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { let isHdr = false; - for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { - const stream = args.variables.ffmpegCommand.streams[i]; - if ( - stream.codec_type === 'video' - && stream.transfer_characteristics === 'smpte2084' - && stream.color_primaries === 'bt2020' - && stream.color_range === 'tv' - ) { - isHdr = true; + if (Array.isArray(args?.inputFileObj?.ffProbeData?.streams)) { + for (let i = 0; i < args.inputFileObj.ffProbeData.streams.length; i += 1) { + const stream = args.inputFileObj.ffProbeData.streams[i]; + if ( + stream.codec_type === 'video' + && stream.transfer_characteristics === 'smpte2084' + && stream.color_primaries === 'bt2020' + && stream.color_range === 'tv' + ) { + isHdr = true; + } } + } else { + throw new Error('File has not stream data'); } return {