Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Remove unnecessary transcoding job error

Chocobozzzcd2c3dcdc4a6
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts
index f3b169b32e..f6c96790ea 100644
--- a/scripts/print-transcode-command.ts
+++ b/scripts/print-transcode-command.ts
@@ -48,5 +48,5 @@ async function run (path: string, cmd: any) {
exit()
})
- await runCommand(command)
+ await runCommand({ command })
}
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index 33c625c9ef..6200259666 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -69,7 +69,7 @@ function convertWebPToJPG (path: string, destination: string): Promise<void> {
const command = ffmpeg(path, { niceness: FFMPEG_NICE.THUMBNAIL })
.output(destination)
- return runCommand(command)
+ return runCommand({ command, silent: true })
}
function processGIF (
@@ -82,7 +82,7 @@ function processGIF (
.size(`${newSize.width}x${newSize.height}`)
.output(destination)
- return runCommand(command)
+ return runCommand({ command })
}
async function generateImageFromVideoFile (fromPath: string, folder: string, imageName: string, size: { width: number, height: number }) {
@@ -201,7 +201,7 @@ async function transcode (options: TranscodeOptions) {
command = await builders[options.type](command, options)
- await runCommand(command, options.job)
+ await runCommand({ command, job: options.job })
await fixHLSPlaylistIfNeeded(options)
}
@@ -649,10 +649,17 @@ function getFFmpeg (input: string, type: 'live' | 'vod') {
return command
}
-async function runCommand (command: ffmpeg.FfmpegCommand, job?: Job) {
+async function runCommand (options: {
+ command: ffmpeg.FfmpegCommand
+ silent?: boolean // false
+ job?: Job
+}) {
+ const { command, silent = false, job } = options
+
return new Promise<void>((res, rej) => {
command.on('error', (err, stdout, stderr) => {
- logger.error('Error in transcoding job.', { stdout, stderr })
+ if (silent !== true) logger.error('Error in ffmpeg.', { stdout, stderr })
+
rej(err)
})