]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/print-transcode-command.ts
Don't use hexa for av01 codec
[github/Chocobozzz/PeerTube.git] / scripts / print-transcode-command.ts
index b75b711a4c7087475d984d9d7e1cdd76aed29f7d..ac60ff8a5832a9677257fec9ca1cd50349c1518d 100644 (file)
@@ -1,11 +1,8 @@
-import { registerTSPaths } from '../server/helpers/register-ts-paths'
-registerTSPaths()
-
-import * as program from 'commander'
-import * as ffmpeg from 'fluent-ffmpeg'
-import { availableEncoders } from '@server/lib/video-transcoding-profiles'
-import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils'
+import { program } from 'commander'
+import ffmpeg from 'fluent-ffmpeg'
 import { exit } from 'process'
+import { buildVODCommand, runCommand, TranscodeVODOptions } from '@server/helpers/ffmpeg'
+import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles'
 
 program
   .arguments('<path>')
@@ -31,22 +28,21 @@ async function run (path: string, cmd: any) {
     inputPath: path,
     outputPath: '/dev/null',
 
-    availableEncoders,
+    availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(),
     profile: 'default',
 
-    resolution: +cmd.resolution,
-    isPortraitMode: false
-  } as TranscodeOptions
+    resolution: +cmd.resolution
+  } as TranscodeVODOptions
 
   let command = ffmpeg(options.inputPath)
                .output(options.outputPath)
 
-  command = await buildx264VODCommand(command, options)
+  command = await buildVODCommand(command, options)
 
   command.on('start', (cmdline) => {
     console.log(cmdline)
     exit()
   })
 
-  await runCommand(command)
+  await runCommand({ command })
 }