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.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts
index 463cdfad3..179fb4fa6 100755
--- a/scripts/create-transcoding-job.ts
+++ b/scripts/create-transcoding-job.ts
@@ -8,6 +8,7 @@ import { JobQueue } from '../server/lib/job-queue'
8 8
9program 9program
10 .option('-v, --video [videoUUID]', 'Video UUID') 10 .option('-v, --video [videoUUID]', 'Video UUID')
11 .option('-r, --resolution [resolution]', 'Video resolution (integer)')
11 .parse(process.argv) 12 .parse(process.argv)
12 13
13if (program['video'] === undefined) { 14if (program['video'] === undefined) {
@@ -15,6 +16,11 @@ if (program['video'] === undefined) {
15 process.exit(-1) 16 process.exit(-1)
16} 17}
17 18
19if (program.resolution !== undefined && Number.isNaN(+program.resolution)) {
20 console.error('The resolution must be an integer (example: 1080).')
21 process.exit(-1)
22}
23
18run() 24run()
19 .then(() => process.exit(0)) 25 .then(() => process.exit(0))
20 .catch(err => { 26 .catch(err => {
@@ -30,7 +36,12 @@ async function run () {
30 36
31 const dataInput = { 37 const dataInput = {
32 videoUUID: video.uuid, 38 videoUUID: video.uuid,
33 isNewVideo: false 39 isNewVideo: false,
40 resolution: undefined
41 }
42
43 if (program.resolution !== undefined) {
44 dataInput.resolution = program.resolution
34 } 45 }
35 46
36 await JobQueue.Instance.init() 47 await JobQueue.Instance.init()