From 313921b50fda6bfd2942e45e3c9a0547ff01880b Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 15 Oct 2020 17:30:19 -0700 Subject: Fix transcoding errors in readonly docker containers ffmpeg seems to create some temporary files in the cwd. When PeerTube is run in a read-only docker container, this causes all transcoding to fail. As a workaround, we set the cwd to the configured tmp dir. --- server/helpers/ffmpeg-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 7bfd5d44a..02c66cd01 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts @@ -270,7 +270,8 @@ type TranscodeOptions = function transcode (options: TranscodeOptions) { return new Promise(async (res, rej) => { try { - let command = ffmpeg(options.inputPath, { niceness: FFMPEG_NICE.TRANSCODING }) + // we set cwd explicitly because ffmpeg appears to create temporary files when trancoding which fails in read-only file systems + let command = ffmpeg(options.inputPath, { niceness: FFMPEG_NICE.TRANSCODING, cwd: CONFIG.STORAGE.TMP_DIR }) .output(options.outputPath) if (options.type === 'quick-transcode') { -- cgit v1.2.3