From 485ef67b86615d4253450b2dcd09c629cf589ab8 Mon Sep 17 00:00:00 2001 From: dravenst Date: Wed, 5 Apr 2023 01:17:51 -0600 Subject: [PATCH] feat: add vaapi support thumbsup and downsize (#284) Added hwaccel option for vaapi Added video hwaccel option to enable vaapi for video encoding. Confirmed check of bitrate with hwaccel --- README.md | 1 + src/cli/options.js | 6 ++++++ src/steps/actions.js | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce9c19f..2c585aa 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Output options: --video-quality Quality of the converted video (percent) [number] [default: 75] --video-bitrate Bitrate of the converted videos (e.g. 120k) [string] [default: null] --video-format Video output format [choices: "mp4", "webm"] [default: "mp4"] + --video-hwaccel Use Hardware acceleration, requires bitrate too [choices: ["none", "vaapi"] [default: "none"] --video-stills Where the video still frame is taken [choices: "seek", "middle"] [default: "seek"] --video-stills-seek Number of seconds where the still frame is taken [number] [default: 1] --photo-preview How lightbox photos are generated [choices: "resize", "copy", "symlink", "link"] [default: "resize"] diff --git a/src/cli/options.js b/src/cli/options.js index 3abda4e..b86bd86 100644 --- a/src/cli/options.js +++ b/src/cli/options.js @@ -104,6 +104,12 @@ const OPTIONS = { choices: ['mp4', 'webm'], 'default': 'mp4' }, + 'video-hwaccel': { + group: 'Output options:', + description: 'Use Hardware acceleration, requires bitrate too', + choices: ['none', 'vaapi'], + 'default': 'none' + }, 'video-stills': { group: 'Output options:', description: 'Where the video still frame is taken', diff --git a/src/steps/actions.js b/src/steps/actions.js index 2888e9f..673d719 100644 --- a/src/steps/actions.js +++ b/src/steps/actions.js @@ -33,7 +33,8 @@ exports.createMap = function (opts) { const videoOpts = { format: opts.videoFormat, quality: opts.videoQuality, - bitrate: opts.videoBitrate + bitrate: opts.videoBitrate, + hwaccel: opts.videoHwaccel } return { 'fs:copy': (task, done) => fs.copy(task.src, task.dest, done),