1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Support live session in server

This commit is contained in:
Chocobozzz 2022-05-03 11:38:07 +02:00
parent 86c5229b4d
commit 26e3e98ff0
No known key found for this signature in database
GPG key ID: 583A612D890159BE
29 changed files with 814 additions and 66 deletions

View file

@ -28,7 +28,7 @@ interface MuxingSessionEvents {
'quota-exceeded': ({ videoId: number }) => void
'ffmpeg-end': ({ videoId: number }) => void
'ffmpeg-error': ({ sessionId: string }) => void
'ffmpeg-error': ({ videoId: string }) => void
'after-cleanup': ({ videoId: number }) => void
}
@ -164,7 +164,11 @@ class MuxingSession extends EventEmitter {
this.onFFmpegError({ err, stdout, stderr, outPath: this.outDirectory, ffmpegShellCommand })
})
this.ffmpegCommand.on('end', () => this.onFFmpegEnded(this.outDirectory))
this.ffmpegCommand.on('end', () => {
this.emit('ffmpeg-end', ({ videoId: this.videoId }))
this.onFFmpegEnded(this.outDirectory)
})
this.ffmpegCommand.run()
}
@ -197,7 +201,7 @@ class MuxingSession extends EventEmitter {
logger.error('Live transcoding error.', { err, stdout, stderr, ffmpegShellCommand, ...this.lTags() })
this.emit('ffmpeg-error', ({ sessionId: this.sessionId }))
this.emit('ffmpeg-error', ({ videoId: this.videoId }))
}
private onFFmpegEnded (outPath: string) {