aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish@cloudron.io>2020-10-15 17:30:19 -0700
committerChocobozzz <chocobozzz@cpy.re>2020-10-23 14:51:44 +0200
commit313921b50fda6bfd2942e45e3c9a0547ff01880b (patch)
tree6bea5d919245474b485a8d15df9212895782b42a /server/helpers/ffmpeg-utils.ts
parente0f31bc9ce4b45fd4ee1d541a2e573497ca3253d (diff)
downloadPeerTube-313921b50fda6bfd2942e45e3c9a0547ff01880b.tar.gz
PeerTube-313921b50fda6bfd2942e45e3c9a0547ff01880b.tar.zst
PeerTube-313921b50fda6bfd2942e45e3c9a0547ff01880b.zip
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.
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts3
1 files changed, 2 insertions, 1 deletions
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 =
270function transcode (options: TranscodeOptions) { 270function transcode (options: TranscodeOptions) {
271 return new Promise<void>(async (res, rej) => { 271 return new Promise<void>(async (res, rej) => {
272 try { 272 try {
273 let command = ffmpeg(options.inputPath, { niceness: FFMPEG_NICE.TRANSCODING }) 273 // we set cwd explicitly because ffmpeg appears to create temporary files when trancoding which fails in read-only file systems
274 let command = ffmpeg(options.inputPath, { niceness: FFMPEG_NICE.TRANSCODING, cwd: CONFIG.STORAGE.TMP_DIR })
274 .output(options.outputPath) 275 .output(options.outputPath)
275 276
276 if (options.type === 'quick-transcode') { 277 if (options.type === 'quick-transcode') {