Fix live infohash of original resolution

This commit is contained in:
Chocobozzz 2020-11-12 16:55:13 +01:00
parent 374e419738
commit 6297bae0c1
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 7 additions and 8 deletions

View File

@ -199,13 +199,15 @@ class LiveManager {
? computeResolutionsToTranscode(resolutionResult.videoFileResolution, 'live') ? computeResolutionsToTranscode(resolutionResult.videoFileResolution, 'live')
: [] : []
logger.info('Will mux/transcode live video of original resolution %d.', session.videoHeight, { resolutionsEnabled }) const allResolutions = resolutionsEnabled.concat([ session.videoHeight ])
logger.info('Will mux/transcode live video of original resolution %d.', session.videoHeight, { allResolutions })
const [ videoStreamingPlaylist ] = await VideoStreamingPlaylistModel.upsert({ const [ videoStreamingPlaylist ] = await VideoStreamingPlaylistModel.upsert({
videoId: video.id, videoId: video.id,
playlistUrl, playlistUrl,
segmentsSha256Url: WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive), segmentsSha256Url: WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive),
p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, resolutionsEnabled), p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, allResolutions),
p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION, p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION,
type: VideoStreamingPlaylistType.HLS type: VideoStreamingPlaylistType.HLS
@ -215,10 +217,9 @@ class LiveManager {
sessionId, sessionId,
videoLive, videoLive,
playlist: videoStreamingPlaylist, playlist: videoStreamingPlaylist,
originalResolution: session.videoHeight,
rtmpUrl, rtmpUrl,
fps, fps,
resolutionsEnabled allResolutions
}) })
} }
@ -228,12 +229,10 @@ class LiveManager {
playlist: MStreamingPlaylist playlist: MStreamingPlaylist
rtmpUrl: string rtmpUrl: string
fps: number fps: number
resolutionsEnabled: number[] allResolutions: number[]
originalResolution: number
}) { }) {
const { sessionId, videoLive, playlist, resolutionsEnabled, originalResolution, fps, rtmpUrl } = options const { sessionId, videoLive, playlist, allResolutions, fps, rtmpUrl } = options
const startStreamDateTime = new Date().getTime() const startStreamDateTime = new Date().getTime()
const allResolutions = resolutionsEnabled.concat([ originalResolution ])
const user = await UserModel.loadByLiveId(videoLive.id) const user = await UserModel.loadByLiveId(videoLive.id)
if (!this.livesPerUser.has(user.id)) { if (!this.livesPerUser.has(user.id)) {