Prevent exception when sending latest chunks

This commit is contained in:
Chocobozzz 2025-02-20 08:40:42 +01:00
parent 941c35c1ef
commit 0392af3bb8
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 16 additions and 7 deletions

View File

@ -227,7 +227,12 @@ export class ProcessLiveRTMPHLSTranscoding {
// Wait last ffmpeg chunks generation
await wait(1500)
await this.sendPendingChunks()
try {
await this.sendPendingChunks()
} catch (err) {
logger.error(err, 'Cannot send latest chunks after ffmpeg ended')
}
this.ended = true
@ -301,14 +306,18 @@ export class ProcessLiveRTMPHLSTranscoding {
if (this.allPlaylistsCreated) {
const playlistName = this.getPlaylistName(videoChunkFilename)
await this.updatePlaylistContent(playlistName, videoChunkFilename)
try {
await this.updatePlaylistContent(playlistName, videoChunkFilename)
payload = {
...payload,
payload = {
...payload,
masterPlaylistFile: join(this.outputPath, 'master.m3u8'),
resolutionPlaylistFilename: playlistName,
resolutionPlaylistFile: this.buildPlaylistFileParam(playlistName)
masterPlaylistFile: join(this.outputPath, 'master.m3u8'),
resolutionPlaylistFilename: playlistName,
resolutionPlaylistFile: this.buildPlaylistFileParam(playlistName)
}
} catch (err) {
logger.warn(err, `Cannot fetch/update playlist content ${playlistName}`)
}
}