+ logger.error('Cannot copy segment %s to replay directory.', segmentPath, { err, ...this.lTags() })
+ }
+ }
+
+ private async createLivePlaylist (): Promise<MStreamingPlaylistVideo> {
+ const playlist = await VideoStreamingPlaylistModel.loadOrGenerate(this.videoLive.Video)
+
+ playlist.playlistFilename = generateHLSMasterPlaylistFilename(true)
+ playlist.segmentsSha256Filename = generateHlsSha256SegmentsFilename(true)
+
+ playlist.p2pMediaLoaderPeerVersion = P2P_MEDIA_LOADER_PEER_VERSION
+ playlist.type = VideoStreamingPlaylistType.HLS
+
+ playlist.storage = CONFIG.OBJECT_STORAGE.ENABLED
+ ? VideoStorage.OBJECT_STORAGE
+ : VideoStorage.FILE_SYSTEM
+
+ return playlist.save()
+ }
+
+ private createLiveShaStore () {
+ this.liveSegmentShaStore = new LiveSegmentShaStore({
+ videoUUID: this.videoLive.Video.uuid,
+ sha256Path: join(this.outDirectory, this.streamingPlaylist.segmentsSha256Filename),
+ streamingPlaylist: this.streamingPlaylist,
+ sendToObjectStorage: CONFIG.OBJECT_STORAGE.ENABLED
+ })
+ }
+
+ private buildTranscodingWrapper () {
+ const options = {
+ streamingPlaylist: this.streamingPlaylist,
+ videoLive: this.videoLive,
+
+ lTags: this.lTags,
+
+ inputUrl: this.inputUrl,
+
+ toTranscode: this.allResolutions.map(resolution => ({
+ resolution,
+ fps: computeOutputFPS({ inputFPS: this.fps, resolution })
+ })),
+
+ fps: this.fps,
+ bitrate: this.bitrate,
+ ratio: this.ratio,
+ hasAudio: this.hasAudio,
+
+ segmentListSize: VIDEO_LIVE.SEGMENTS_LIST_SIZE,
+ segmentDuration: getLiveSegmentTime(this.videoLive.latencyMode),
+
+ outDirectory: this.outDirectory