From ad5db1044c8599eaaaa2a578b350777ae996b068 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Nov 2021 14:35:08 +0100 Subject: Add ability to run transcoding jobs --- scripts/create-transcoding-job.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index 29c398822..244c38fcd 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts @@ -5,7 +5,7 @@ import { program } from 'commander' import { VideoModel } from '../server/models/video/video' import { initDatabaseModels } from '../server/initializers/database' import { JobQueue } from '../server/lib/job-queue' -import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils' +import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils' import { VideoState, VideoTranscodingPayload } from '@shared/models' import { CONFIG } from '@server/initializers/config' import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' @@ -50,13 +50,13 @@ async function run () { if (!video) throw new Error('Video not found.') const dataInput: VideoTranscodingPayload[] = [] - const resolution = video.getMaxQualityFile().resolution + const maxResolution = video.getMaxQualityFile().resolution // Generate HLS files if (options.generateHls || CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) { const resolutionsEnabled = options.resolution ? [ parseInt(options.resolution) ] - : computeResolutionsToTranscode(resolution, 'vod').concat([ resolution ]) + : computeLowerResolutionsToTranscode(maxResolution, 'vod').concat([ maxResolution ]) for (const resolution of resolutionsEnabled) { dataInput.push({ @@ -66,7 +66,8 @@ async function run () { isPortraitMode: false, copyCodecs: false, isNewVideo: false, - isMaxQuality: false + isMaxQuality: maxResolution === resolution, + autoDeleteWebTorrentIfNeeded: false }) } } else { -- cgit v1.2.3