aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/print-transcode-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/print-transcode-command.ts')
-rw-r--r--scripts/print-transcode-command.ts48
1 files changed, 0 insertions, 48 deletions
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts
deleted file mode 100644
index ac60ff8a5..000000000
--- a/scripts/print-transcode-command.ts
+++ /dev/null
@@ -1,48 +0,0 @@
1import { program } from 'commander'
2import ffmpeg from 'fluent-ffmpeg'
3import { exit } from 'process'
4import { buildVODCommand, runCommand, TranscodeVODOptions } from '@server/helpers/ffmpeg'
5import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles'
6
7program
8 .arguments('<path>')
9 .requiredOption('-r, --resolution [resolution]', 'video resolution')
10 .action((path, cmd) => {
11 if (cmd.resolution !== undefined && Number.isNaN(+cmd.resolution)) {
12 console.error('The resolution must be an integer (example: 1080).')
13 process.exit(-1)
14 }
15
16 run(path, cmd)
17 .then(() => process.exit(0))
18 .catch(err => {
19 console.error(err)
20 process.exit(-1)
21 })
22 })
23 .parse(process.argv)
24
25async function run (path: string, cmd: any) {
26 const options = {
27 type: 'video' as 'video',
28 inputPath: path,
29 outputPath: '/dev/null',
30
31 availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(),
32 profile: 'default',
33
34 resolution: +cmd.resolution
35 } as TranscodeVODOptions
36
37 let command = ffmpeg(options.inputPath)
38 .output(options.outputPath)
39
40 command = await buildVODCommand(command, options)
41
42 command.on('start', (cmdline) => {
43 console.log(cmdline)
44 exit()
45 })
46
47 await runCommand({ command })
48}