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

Support max FPS configuration

This commit is contained in:
Chocobozzz 2024-08-12 16:17:11 +02:00
parent 0bd2474fed
commit bbaf96d60d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
37 changed files with 736 additions and 623 deletions

View file

@ -341,10 +341,14 @@ class LiveManager {
inputLocalUrl,
inputPublicUrl,
fps,
bitrate,
ratio,
inputResolution: resolution,
allResolutions,
hasAudio,
hasVideo,
probe
@ -363,7 +367,10 @@ class LiveManager {
fps: number
bitrate: number
ratio: number
inputResolution: number
allResolutions: number[]
hasAudio: boolean
hasVideo: boolean
probe: FfprobeData
@ -384,7 +391,18 @@ class LiveManager {
videoLive,
user,
...pick(options, [ 'inputLocalUrl', 'inputPublicUrl', 'bitrate', 'ratio', 'fps', 'allResolutions', 'hasAudio', 'hasVideo', 'probe' ])
...pick(options, [
'inputLocalUrl',
'inputPublicUrl',
'inputResolution',
'bitrate',
'ratio',
'fps',
'allResolutions',
'hasAudio',
'hasVideo',
'probe'
])
})
muxingSession.on('live-ready', () => this.publishAndFederateLive({ live: videoLive, ratio, audioOnlyOutput, localLTags }))

View file

@ -72,6 +72,8 @@ class MuxingSession extends EventEmitter {
private readonly inputPublicUrl: string
private readonly fps: number
private readonly inputResolution: number
private readonly allResolutions: number[]
private readonly bitrate: number
@ -125,7 +127,10 @@ class MuxingSession extends EventEmitter {
fps: number
bitrate: number
ratio: number
inputResolution: number
allResolutions: number[]
hasAudio: boolean
hasVideo: boolean
probe: FfprobeData
@ -149,6 +154,7 @@ class MuxingSession extends EventEmitter {
this.hasVideo = options.hasVideo
this.hasAudio = options.hasAudio
this.inputResolution = options.inputResolution
this.allResolutions = options.allResolutions
this.videoUUID = this.videoLive.Video.uuid
@ -547,7 +553,12 @@ class MuxingSession extends EventEmitter {
}
try {
toTranscodeFPS = computeOutputFPS({ inputFPS: this.fps, resolution })
toTranscodeFPS = computeOutputFPS({
inputFPS: this.fps,
resolution,
isOriginResolution: resolution === this.inputResolution,
type: 'live'
})
} catch (err) {
err.liveVideoErrorCode = LiveVideoError.INVALID_INPUT_VIDEO_STREAM
throw err