]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/create-transcoding-job.ts
Purge entire video from redundancy
[github/Chocobozzz/PeerTube.git] / scripts / create-transcoding-job.ts
index 7ee0050e39e5837857203612fb9259cbf77eadf7..ca9e2a99ab3e41c91d345a687aec3cba4683ab55 100755 (executable)
@@ -5,7 +5,7 @@ import * as 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/ffmpeg-utils'
+import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
 import { VideoTranscodingPayload } from '@shared/models'
 
 program
@@ -43,11 +43,11 @@ async function run () {
   if (program.generateHls) {
     const resolutionsEnabled = program.resolution
       ? [ program.resolution ]
-      : computeResolutionsToTranscode(videoFileResolution).concat([ videoFileResolution ])
+      : computeResolutionsToTranscode(videoFileResolution, 'vod').concat([ videoFileResolution ])
 
     for (const resolution of resolutionsEnabled) {
       dataInput.push({
-        type: 'hls',
+        type: 'new-resolution-to-hls',
         videoUUID: video.uuid,
         resolution,
         isPortraitMode: false,
@@ -56,14 +56,14 @@ async function run () {
     }
   } else if (program.resolution !== undefined) {
     dataInput.push({
-      type: 'new-resolution' as 'new-resolution',
+      type: 'new-resolution-to-webtorrent',
       videoUUID: video.uuid,
       isNewVideo: false,
       resolution: program.resolution
     })
   } else {
     dataInput.push({
-      type: 'optimize' as 'optimize',
+      type: 'optimize-to-webtorrent',
       videoUUID: video.uuid,
       isNewVideo: false
     })