aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/create-transcoding-job.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/create-transcoding-job.ts')
-rwxr-xr-xscripts/create-transcoding-job.ts9
1 files changed, 5 insertions, 4 deletions
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'
5import { VideoModel } from '../server/models/video/video' 5import { VideoModel } from '../server/models/video/video'
6import { initDatabaseModels } from '../server/initializers/database' 6import { initDatabaseModels } from '../server/initializers/database'
7import { JobQueue } from '../server/lib/job-queue' 7import { JobQueue } from '../server/lib/job-queue'
8import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils' 8import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
9import { VideoState, VideoTranscodingPayload } from '@shared/models' 9import { VideoState, VideoTranscodingPayload } from '@shared/models'
10import { CONFIG } from '@server/initializers/config' 10import { CONFIG } from '@server/initializers/config'
11import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' 11import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc'
@@ -50,13 +50,13 @@ async function run () {
50 if (!video) throw new Error('Video not found.') 50 if (!video) throw new Error('Video not found.')
51 51
52 const dataInput: VideoTranscodingPayload[] = [] 52 const dataInput: VideoTranscodingPayload[] = []
53 const resolution = video.getMaxQualityFile().resolution 53 const maxResolution = video.getMaxQualityFile().resolution
54 54
55 // Generate HLS files 55 // Generate HLS files
56 if (options.generateHls || CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) { 56 if (options.generateHls || CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) {
57 const resolutionsEnabled = options.resolution 57 const resolutionsEnabled = options.resolution
58 ? [ parseInt(options.resolution) ] 58 ? [ parseInt(options.resolution) ]
59 : computeResolutionsToTranscode(resolution, 'vod').concat([ resolution ]) 59 : computeLowerResolutionsToTranscode(maxResolution, 'vod').concat([ maxResolution ])
60 60
61 for (const resolution of resolutionsEnabled) { 61 for (const resolution of resolutionsEnabled) {
62 dataInput.push({ 62 dataInput.push({
@@ -66,7 +66,8 @@ async function run () {
66 isPortraitMode: false, 66 isPortraitMode: false,
67 copyCodecs: false, 67 copyCodecs: false,
68 isNewVideo: false, 68 isNewVideo: false,
69 isMaxQuality: false 69 isMaxQuality: maxResolution === resolution,
70 autoDeleteWebTorrentIfNeeded: false
70 }) 71 })
71 } 72 }
72 } else { 73 } else {