diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-12 16:55:13 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-12 16:55:13 +0100 |
commit | 6297bae0c1abf0e318fa7557a59e1bdbf26dcc6b (patch) | |
tree | a7d6498424f5b58683f3b209093e230c2f05bb4c /server/lib/live-manager.ts | |
parent | 374e4197386532995dd077df7e3e737dffd71320 (diff) | |
download | PeerTube-6297bae0c1abf0e318fa7557a59e1bdbf26dcc6b.tar.gz PeerTube-6297bae0c1abf0e318fa7557a59e1bdbf26dcc6b.tar.zst PeerTube-6297bae0c1abf0e318fa7557a59e1bdbf26dcc6b.zip |
Fix live infohash of original resolution
Diffstat (limited to 'server/lib/live-manager.ts')
-rw-r--r-- | server/lib/live-manager.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index 31753619c..60ef30d15 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts | |||
@@ -199,13 +199,15 @@ class LiveManager { | |||
199 | ? computeResolutionsToTranscode(resolutionResult.videoFileResolution, 'live') | 199 | ? computeResolutionsToTranscode(resolutionResult.videoFileResolution, 'live') |
200 | : [] | 200 | : [] |
201 | 201 | ||
202 | logger.info('Will mux/transcode live video of original resolution %d.', session.videoHeight, { resolutionsEnabled }) | 202 | const allResolutions = resolutionsEnabled.concat([ session.videoHeight ]) |
203 | |||
204 | logger.info('Will mux/transcode live video of original resolution %d.', session.videoHeight, { allResolutions }) | ||
203 | 205 | ||
204 | const [ videoStreamingPlaylist ] = await VideoStreamingPlaylistModel.upsert({ | 206 | const [ videoStreamingPlaylist ] = await VideoStreamingPlaylistModel.upsert({ |
205 | videoId: video.id, | 207 | videoId: video.id, |
206 | playlistUrl, | 208 | playlistUrl, |
207 | segmentsSha256Url: WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive), | 209 | segmentsSha256Url: WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive), |
208 | p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, resolutionsEnabled), | 210 | p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, allResolutions), |
209 | p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION, | 211 | p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION, |
210 | 212 | ||
211 | type: VideoStreamingPlaylistType.HLS | 213 | type: VideoStreamingPlaylistType.HLS |
@@ -215,10 +217,9 @@ class LiveManager { | |||
215 | sessionId, | 217 | sessionId, |
216 | videoLive, | 218 | videoLive, |
217 | playlist: videoStreamingPlaylist, | 219 | playlist: videoStreamingPlaylist, |
218 | originalResolution: session.videoHeight, | ||
219 | rtmpUrl, | 220 | rtmpUrl, |
220 | fps, | 221 | fps, |
221 | resolutionsEnabled | 222 | allResolutions |
222 | }) | 223 | }) |
223 | } | 224 | } |
224 | 225 | ||
@@ -228,12 +229,10 @@ class LiveManager { | |||
228 | playlist: MStreamingPlaylist | 229 | playlist: MStreamingPlaylist |
229 | rtmpUrl: string | 230 | rtmpUrl: string |
230 | fps: number | 231 | fps: number |
231 | resolutionsEnabled: number[] | 232 | allResolutions: number[] |
232 | originalResolution: number | ||
233 | }) { | 233 | }) { |
234 | const { sessionId, videoLive, playlist, resolutionsEnabled, originalResolution, fps, rtmpUrl } = options | 234 | const { sessionId, videoLive, playlist, allResolutions, fps, rtmpUrl } = options |
235 | const startStreamDateTime = new Date().getTime() | 235 | const startStreamDateTime = new Date().getTime() |
236 | const allResolutions = resolutionsEnabled.concat([ originalResolution ]) | ||
237 | 236 | ||
238 | const user = await UserModel.loadByLiveId(videoLive.id) | 237 | const user = await UserModel.loadByLiveId(videoLive.id) |
239 | if (!this.livesPerUser.has(user.id)) { | 238 | if (!this.livesPerUser.has(user.id)) { |