From 8c8468f0cda8358811f8e227911f83a3f7811325 Mon Sep 17 00:00:00 2001 From: wizu Date: Mon, 16 Sep 2024 13:10:09 +0200 Subject: [PATCH 1/5] Change -qp to -global_quality --- .../ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts index 3591ce070..aff574390 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts @@ -217,7 +217,7 @@ const plugin = async (args: IpluginInputArgs): Promise => { if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - stream.outputArgs.push('-qp', ffmpegQuality); + stream.outputArgs.push('-global_quality', ffmpegQuality); } else { stream.outputArgs.push('-crf', ffmpegQuality); } From 0614a711e81beb649b25ff39ad7bbbae97254c3e Mon Sep 17 00:00:00 2001 From: wizu Date: Sat, 25 Jan 2025 09:37:58 +0100 Subject: [PATCH 2/5] set global_quality only when qsv --- .../ffmpegCommandSetVideoEncoder/1.0.0/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts index aff574390..6005322d9 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts @@ -217,7 +217,11 @@ const plugin = async (args: IpluginInputArgs): Promise => { if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - stream.outputArgs.push('-global_quality', ffmpegQuality); + if(encoderProperties.encoder == 'hevc_qsv') { + stream.outputArgs.push('-global_quality', ffmpegQuality); + } else { + stream.outputArgs.push('-qp', ffmpegQuality); + } } else { stream.outputArgs.push('-crf', ffmpegQuality); } From f1a292e57af3bbab4db75897e15ad48ec90f330c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:08:48 +0000 Subject: [PATCH 3/5] style: fix lint errors --- .../ffmpegCommandSetVideoEncoder/1.0.0/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts index 6005322d9..1320f65a9 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts @@ -217,10 +217,10 @@ const plugin = async (args: IpluginInputArgs): Promise => { if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - if(encoderProperties.encoder == 'hevc_qsv') { - stream.outputArgs.push('-global_quality', ffmpegQuality); + if (encoderProperties.encoder == 'hevc_qsv') { + stream.outputArgs.push('-global_quality', ffmpegQuality); } else { - stream.outputArgs.push('-qp', ffmpegQuality); + stream.outputArgs.push('-qp', ffmpegQuality); } } else { stream.outputArgs.push('-crf', ffmpegQuality); From 4460303b1b8238b33fc49c53dbf5cba40c607eb6 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:09:48 +0000 Subject: [PATCH 4/5] chore: push compiled changes --- .../ffmpegCommandSetVideoEncoder/1.0.0/index.js | 11 ++++++++--- .../tools/webRequest/1.0.0/index.js | 4 ++-- .../video/runHealthCheck/1.0.0/index.js | 4 ++-- .../video/transcodeVideo/1.0.0/index.js | 4 ++-- FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js | 4 ++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js index 34f90f3e1..9df7de976 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js @@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -248,7 +248,12 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function stream.outputArgs.push('-c:{outputIndex}', encoderProperties.encoder); if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - stream.outputArgs.push('-qp', ffmpegQuality); + if (encoderProperties.encoder == 'hevc_qsv') { + stream.outputArgs.push('-global_quality', ffmpegQuality); + } + else { + stream.outputArgs.push('-qp', ffmpegQuality); + } } else { stream.outputArgs.push('-crf', ffmpegQuality); diff --git a/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js index 3ccf14575..64a1712bb 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js @@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); diff --git a/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js index dfc2d4a94..cf5a694e6 100644 --- a/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js @@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); diff --git a/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js index aa543a011..5a60bad42 100644 --- a/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js @@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); diff --git a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js index 88def6d4d..1211dee56 100644 --- a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js +++ b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js @@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); From 011325dbbb36382ebf196e82bb9db28b0e24d515 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:14:06 +0000 Subject: [PATCH 5/5] style: use strict equality operator --- .../ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js | 2 +- .../ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js index 9df7de976..ee672e2f0 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js @@ -248,7 +248,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function stream.outputArgs.push('-c:{outputIndex}', encoderProperties.encoder); if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - if (encoderProperties.encoder == 'hevc_qsv') { + if (encoderProperties.encoder === 'hevc_qsv') { stream.outputArgs.push('-global_quality', ffmpegQuality); } else { diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts index 1320f65a9..565461d83 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts @@ -217,7 +217,7 @@ const plugin = async (args: IpluginInputArgs): Promise => { if (ffmpegQualityEnabled) { if (encoderProperties.isGpu) { - if (encoderProperties.encoder == 'hevc_qsv') { + if (encoderProperties.encoder === 'hevc_qsv') { stream.outputArgs.push('-global_quality', ffmpegQuality); } else { stream.outputArgs.push('-qp', ffmpegQuality);