aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live/shared/muxing-session.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-06 13:35:25 +0200
committerChocobozzz <me@florianbigard.com>2021-08-06 14:13:26 +0200
commit679c12e69c9f3a2d003ee3abe8b8da49f25b2bd3 (patch)
tree03abf589275db05e5b1fa1c89f57049cd807324a /server/lib/live/shared/muxing-session.ts
parentc826f34a45757b324a20f71665b44ed10e6953b5 (diff)
downloadPeerTube-679c12e69c9f3a2d003ee3abe8b8da49f25b2bd3.tar.gz
PeerTube-679c12e69c9f3a2d003ee3abe8b8da49f25b2bd3.tar.zst
PeerTube-679c12e69c9f3a2d003ee3abe8b8da49f25b2bd3.zip
Improve target bitrate calculation
Diffstat (limited to 'server/lib/live/shared/muxing-session.ts')
-rw-r--r--server/lib/live/shared/muxing-session.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/live/shared/muxing-session.ts b/server/lib/live/shared/muxing-session.ts
index 62708b14b..a80abc843 100644
--- a/server/lib/live/shared/muxing-session.ts
+++ b/server/lib/live/shared/muxing-session.ts
@@ -54,9 +54,11 @@ class MuxingSession extends EventEmitter {
54 private readonly streamingPlaylist: MStreamingPlaylistVideo 54 private readonly streamingPlaylist: MStreamingPlaylistVideo
55 private readonly rtmpUrl: string 55 private readonly rtmpUrl: string
56 private readonly fps: number 56 private readonly fps: number
57 private readonly bitrate: number
58 private readonly allResolutions: number[] 57 private readonly allResolutions: number[]
59 58
59 private readonly bitrate: number
60 private readonly ratio: number
61
60 private readonly videoId: number 62 private readonly videoId: number
61 private readonly videoUUID: string 63 private readonly videoUUID: string
62 private readonly saveReplay: boolean 64 private readonly saveReplay: boolean
@@ -85,6 +87,7 @@ class MuxingSession extends EventEmitter {
85 rtmpUrl: string 87 rtmpUrl: string
86 fps: number 88 fps: number
87 bitrate: number 89 bitrate: number
90 ratio: number
88 allResolutions: number[] 91 allResolutions: number[]
89 }) { 92 }) {
90 super() 93 super()
@@ -96,7 +99,10 @@ class MuxingSession extends EventEmitter {
96 this.streamingPlaylist = options.streamingPlaylist 99 this.streamingPlaylist = options.streamingPlaylist
97 this.rtmpUrl = options.rtmpUrl 100 this.rtmpUrl = options.rtmpUrl
98 this.fps = options.fps 101 this.fps = options.fps
102
99 this.bitrate = options.bitrate 103 this.bitrate = options.bitrate
104 this.ratio = options.bitrate
105
100 this.allResolutions = options.allResolutions 106 this.allResolutions = options.allResolutions
101 107
102 this.videoId = this.videoLive.Video.id 108 this.videoId = this.videoLive.Video.id
@@ -122,6 +128,7 @@ class MuxingSession extends EventEmitter {
122 resolutions: this.allResolutions, 128 resolutions: this.allResolutions,
123 fps: this.fps, 129 fps: this.fps,
124 bitrate: this.bitrate, 130 bitrate: this.bitrate,
131 ratio: this.ratio,
125 132
126 availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(), 133 availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(),
127 profile: CONFIG.LIVE.TRANSCODING.PROFILE 134 profile: CONFIG.LIVE.TRANSCODING.PROFILE