diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-21 14:42:43 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-21 14:42:43 +0100 |
commit | 3b01f4c0ac764ecb70efaadfd939ca868c28769c (patch) | |
tree | 99c0cdef6dac0d43dd16c02b8bae3c132037cda6 /server/lib/job-queue/handlers/video-transcoding.ts | |
parent | d44cdcd766fbccbe4b96f34c11a64f0e2168c3b9 (diff) | |
download | PeerTube-3b01f4c0ac764ecb70efaadfd939ca868c28769c.tar.gz PeerTube-3b01f4c0ac764ecb70efaadfd939ca868c28769c.tar.zst PeerTube-3b01f4c0ac764ecb70efaadfd939ca868c28769c.zip |
Support progress for ffmpeg tasks
Diffstat (limited to 'server/lib/job-queue/handlers/video-transcoding.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 20f8c3f50..083cec11a 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -44,20 +44,21 @@ async function processVideoTranscoding (job: Bull.Job) { | |||
44 | videoInputPath, | 44 | videoInputPath, |
45 | resolution: payload.resolution, | 45 | resolution: payload.resolution, |
46 | copyCodecs: payload.copyCodecs, | 46 | copyCodecs: payload.copyCodecs, |
47 | isPortraitMode: payload.isPortraitMode || false | 47 | isPortraitMode: payload.isPortraitMode || false, |
48 | job | ||
48 | }) | 49 | }) |
49 | 50 | ||
50 | await retryTransactionWrapper(onHlsPlaylistGenerationSuccess, video) | 51 | await retryTransactionWrapper(onHlsPlaylistGenerationSuccess, video) |
51 | } else if (payload.type === 'new-resolution') { | 52 | } else if (payload.type === 'new-resolution') { |
52 | await transcodeNewResolution(video, payload.resolution, payload.isPortraitMode || false) | 53 | await transcodeNewResolution(video, payload.resolution, payload.isPortraitMode || false, job) |
53 | 54 | ||
54 | await retryTransactionWrapper(publishNewResolutionIfNeeded, video, payload) | 55 | await retryTransactionWrapper(publishNewResolutionIfNeeded, video, payload) |
55 | } else if (payload.type === 'merge-audio') { | 56 | } else if (payload.type === 'merge-audio') { |
56 | await mergeAudioVideofile(video, payload.resolution) | 57 | await mergeAudioVideofile(video, payload.resolution, job) |
57 | 58 | ||
58 | await retryTransactionWrapper(publishNewResolutionIfNeeded, video, payload) | 59 | await retryTransactionWrapper(publishNewResolutionIfNeeded, video, payload) |
59 | } else { | 60 | } else { |
60 | const transcodeType = await optimizeOriginalVideofile(video) | 61 | const transcodeType = await optimizeOriginalVideofile(video, video.getMaxQualityFile(), job) |
61 | 62 | ||
62 | await retryTransactionWrapper(onVideoFileOptimizerSuccess, video, payload, transcodeType) | 63 | await retryTransactionWrapper(onVideoFileOptimizerSuccess, video, payload, transcodeType) |
63 | } | 64 | } |