From 391cd2f38fe2fa475064c12c00933865550643c7 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 29 Aug 2023 07:09:53 +0100 Subject: [PATCH] Add HDR to SDR --- .../ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js | 6 +++++- .../ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js index 0f5bd42..2e45bec 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js @@ -7,7 +7,6 @@ var details = function () { return ({ description: 'Convert HDR to SDR', style: { borderColor: '#6efefc', - opacity: 0.5, }, tags: 'video', isStartPlugin: false, @@ -27,6 +26,11 @@ var plugin = function (args) { var lib = require('../../../../../methods/lib')(); // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.streams.forEach(function (stream) { + if (stream.codec_type === 'video') { + stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p'); + } + }); return { outputFileObj: args.inputFileObj, outputNumber: 1, diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts index 4fa3be5..571671e 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts @@ -10,7 +10,6 @@ const details = () :IpluginDetails => ({ description: 'Convert HDR to SDR', style: { borderColor: '#6efefc', - opacity: 0.5, }, tags: 'video', isStartPlugin: false, @@ -31,6 +30,12 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.streams.forEach((stream) => { + if (stream.codec_type === 'video') { + stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p'); + } + }); + return { outputFileObj: args.inputFileObj, outputNumber: 1,