diff options
Diffstat (limited to 'packages/peertube-runner/server/process/shared/process-vod.ts')
-rw-r--r-- | packages/peertube-runner/server/process/shared/process-vod.ts | 85 |
1 files changed, 46 insertions, 39 deletions
diff --git a/packages/peertube-runner/server/process/shared/process-vod.ts b/packages/peertube-runner/server/process/shared/process-vod.ts index d84ece3cb..22489afd5 100644 --- a/packages/peertube-runner/server/process/shared/process-vod.ts +++ b/packages/peertube-runner/server/process/shared/process-vod.ts | |||
@@ -22,31 +22,34 @@ export async function processWebVideoTranscoding (options: ProcessOptions<Runner | |||
22 | 22 | ||
23 | const outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), `output-${buildUUID()}.mp4`) | 23 | const outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), `output-${buildUUID()}.mp4`) |
24 | 24 | ||
25 | await ffmpegVod.transcode({ | 25 | try { |
26 | type: 'video', | 26 | await ffmpegVod.transcode({ |
27 | 27 | type: 'video', | |
28 | inputPath, | ||
29 | 28 | ||
30 | outputPath, | 29 | inputPath, |
31 | 30 | ||
32 | inputFileMutexReleaser: () => {}, | 31 | outputPath, |
33 | 32 | ||
34 | resolution: payload.output.resolution, | 33 | inputFileMutexReleaser: () => {}, |
35 | fps: payload.output.fps | ||
36 | }) | ||
37 | 34 | ||
38 | const successBody: VODWebVideoTranscodingSuccess = { | 35 | resolution: payload.output.resolution, |
39 | videoFile: outputPath | 36 | fps: payload.output.fps |
40 | } | 37 | }) |
41 | 38 | ||
42 | await server.runnerJobs.success({ | 39 | const successBody: VODWebVideoTranscodingSuccess = { |
43 | jobToken: job.jobToken, | 40 | videoFile: outputPath |
44 | jobUUID: job.uuid, | 41 | } |
45 | runnerToken, | ||
46 | payload: successBody | ||
47 | }) | ||
48 | 42 | ||
49 | await remove(outputPath) | 43 | await server.runnerJobs.success({ |
44 | jobToken: job.jobToken, | ||
45 | jobUUID: job.uuid, | ||
46 | runnerToken, | ||
47 | payload: successBody | ||
48 | }) | ||
49 | } finally { | ||
50 | await remove(inputPath) | ||
51 | await remove(outputPath) | ||
52 | } | ||
50 | } | 53 | } |
51 | 54 | ||
52 | export async function processHLSTranscoding (options: ProcessOptions<RunnerJobVODHLSTranscodingPayload>) { | 55 | export async function processHLSTranscoding (options: ProcessOptions<RunnerJobVODHLSTranscodingPayload>) { |
@@ -105,30 +108,34 @@ export async function processAudioMergeTranscoding (options: ProcessOptions<Runn | |||
105 | 108 | ||
106 | const ffmpegVod = buildFFmpegVOD({ job, server, runnerToken }) | 109 | const ffmpegVod = buildFFmpegVOD({ job, server, runnerToken }) |
107 | 110 | ||
108 | await ffmpegVod.transcode({ | 111 | try { |
109 | type: 'merge-audio', | 112 | await ffmpegVod.transcode({ |
110 | 113 | type: 'merge-audio', | |
111 | audioPath, | ||
112 | inputPath, | ||
113 | 114 | ||
114 | outputPath, | 115 | audioPath, |
116 | inputPath, | ||
115 | 117 | ||
116 | inputFileMutexReleaser: () => {}, | 118 | outputPath, |
117 | 119 | ||
118 | resolution: payload.output.resolution, | 120 | inputFileMutexReleaser: () => {}, |
119 | fps: payload.output.fps | ||
120 | }) | ||
121 | 121 | ||
122 | const successBody: VODAudioMergeTranscodingSuccess = { | 122 | resolution: payload.output.resolution, |
123 | videoFile: outputPath | 123 | fps: payload.output.fps |
124 | } | 124 | }) |
125 | 125 | ||
126 | await server.runnerJobs.success({ | 126 | const successBody: VODAudioMergeTranscodingSuccess = { |
127 | jobToken: job.jobToken, | 127 | videoFile: outputPath |
128 | jobUUID: job.uuid, | 128 | } |
129 | runnerToken, | ||
130 | payload: successBody | ||
131 | }) | ||
132 | 129 | ||
133 | await remove(outputPath) | 130 | await server.runnerJobs.success({ |
131 | jobToken: job.jobToken, | ||
132 | jobUUID: job.uuid, | ||
133 | runnerToken, | ||
134 | payload: successBody | ||
135 | }) | ||
136 | } finally { | ||
137 | await remove(audioPath) | ||
138 | await remove(inputPath) | ||
139 | await remove(outputPath) | ||
140 | } | ||
134 | } | 141 | } |