aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/hls.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r--server/lib/hls.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts
index fc1d7e1b0..19044d7c2 100644
--- a/server/lib/hls.ts
+++ b/server/lib/hls.ts
@@ -8,7 +8,7 @@ import { sha256 } from '@shared/extra-utils'
8import { getVideoStreamDimensionsInfo } from '@shared/ffmpeg' 8import { getVideoStreamDimensionsInfo } from '@shared/ffmpeg'
9import { VideoStorage } from '@shared/models' 9import { VideoStorage } from '@shared/models'
10import { getAudioStreamCodec, getVideoStreamCodec } from '../helpers/ffmpeg' 10import { getAudioStreamCodec, getVideoStreamCodec } from '../helpers/ffmpeg'
11import { logger } from '../helpers/logger' 11import { logger, loggerTagsFactory } from '../helpers/logger'
12import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' 12import { doRequest, doRequestAndSaveToFile } from '../helpers/requests'
13import { generateRandomString } from '../helpers/utils' 13import { generateRandomString } from '../helpers/utils'
14import { CONFIG } from '../initializers/config' 14import { CONFIG } from '../initializers/config'
@@ -20,6 +20,8 @@ import { storeHLSFileFromFilename } from './object-storage'
20import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from './paths' 20import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from './paths'
21import { VideoPathManager } from './video-path-manager' 21import { VideoPathManager } from './video-path-manager'
22 22
23const lTags = loggerTagsFactory('hls')
24
23async function updateStreamingPlaylistsInfohashesIfNeeded () { 25async function updateStreamingPlaylistsInfohashesIfNeeded () {
24 const playlistsToUpdate = await VideoStreamingPlaylistModel.listByIncorrectPeerVersion() 26 const playlistsToUpdate = await VideoStreamingPlaylistModel.listByIncorrectPeerVersion()
25 27
@@ -48,7 +50,7 @@ async function updatePlaylistAfterFileChange (video: MVideo, playlist: MStreamin
48 50
49 video.setHLSPlaylist(playlistWithFiles) 51 video.setHLSPlaylist(playlistWithFiles)
50 } catch (err) { 52 } catch (err) {
51 logger.info('Cannot update playlist after file change. Maybe due to concurrent transcoding', { err }) 53 logger.warn('Cannot update playlist after file change. Maybe due to concurrent transcoding', { err })
52 } 54 }
53} 55}
54 56
@@ -95,6 +97,8 @@ function updateMasterHLSPlaylist (video: MVideo, playlistArg: MStreamingPlaylist
95 const masterPlaylistPath = VideoPathManager.Instance.getFSHLSOutputPath(video, playlist.playlistFilename) 97 const masterPlaylistPath = VideoPathManager.Instance.getFSHLSOutputPath(video, playlist.playlistFilename)
96 await writeFile(masterPlaylistPath, masterPlaylists.join('\n') + '\n') 98 await writeFile(masterPlaylistPath, masterPlaylists.join('\n') + '\n')
97 99
100 logger.info('Updating %s master playlist file of video %s', masterPlaylistPath, video.uuid, lTags(video.uuid))
101
98 if (playlist.storage === VideoStorage.OBJECT_STORAGE) { 102 if (playlist.storage === VideoStorage.OBJECT_STORAGE) {
99 playlist.playlistUrl = await storeHLSFileFromFilename(playlist, playlist.playlistFilename) 103 playlist.playlistUrl = await storeHLSFileFromFilename(playlist, playlist.playlistFilename)
100 await remove(masterPlaylistPath) 104 await remove(masterPlaylistPath)