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

Correctly display broken muxing session

Can happen when we stream an audio stream only
This commit is contained in:
Chocobozzz 2023-10-30 11:57:39 +01:00
parent ad801093b9
commit 543fbd1ffe
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 58 additions and 20 deletions

View file

@ -14,7 +14,7 @@ import { removeHLSFileObjectStorageByPath, storeHLSFileFromContent, storeHLSFile
import { VideoFileModel } from '@server/models/video/video-file.js'
import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist.js'
import { MStreamingPlaylistVideo, MUserId, MVideoLiveVideo } from '@server/types/models/index.js'
import { VideoStorage, VideoStreamingPlaylistType } from '@peertube/peertube-models'
import { LiveVideoError, VideoStorage, VideoStreamingPlaylistType } from '@peertube/peertube-models'
import {
generateHLSMasterPlaylistFilename,
generateHlsSha256SegmentsFilename,
@ -490,10 +490,21 @@ class MuxingSession extends EventEmitter {
inputLocalUrl: this.inputLocalUrl,
inputPublicUrl: this.inputPublicUrl,
toTranscode: this.allResolutions.map(resolution => ({
resolution,
fps: computeOutputFPS({ inputFPS: this.fps, resolution })
})),
toTranscode: this.allResolutions.map(resolution => {
let toTranscodeFPS: number
try {
toTranscodeFPS = computeOutputFPS({ inputFPS: this.fps, resolution })
} catch (err) {
err.liveVideoErrorCode = LiveVideoError.INVALID_INPUT_VIDEO_STREAM
throw err
}
return {
resolution,
fps: toTranscodeFPS
}
}),
fps: this.fps,
bitrate: this.bitrate,