1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

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.
This commit is contained in:
Girish Ramakrishnan 2020-10-15 17:30:19 -07:00 committed by Chocobozzz
parent e0f31bc9ce
commit 313921b50f
3 changed files with 7 additions and 6 deletions

View file

@ -270,7 +270,8 @@ type TranscodeOptions =
function transcode (options: TranscodeOptions) {
return new Promise<void>(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') {