aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/hls.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-18 14:35:08 +0100
committerChocobozzz <me@florianbigard.com>2021-11-18 15:20:57 +0100
commitad5db1044c8599eaaaa2a578b350777ae996b068 (patch)
tree3e003cccf021152405d49b21c6c91b703c8ae96c /server/lib/hls.ts
parentb46cf4b920984492df598c1b61179acfc7f6f22e (diff)
downloadPeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.gz
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.zst
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.zip
Add ability to run transcoding jobs
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r--server/lib/hls.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts
index 8160e7949..d969549b8 100644
--- a/server/lib/hls.ts
+++ b/server/lib/hls.ts
@@ -37,7 +37,7 @@ async function updateMasterHLSPlaylist (video: MVideo, playlist: MStreamingPlayl
37 for (const file of playlist.VideoFiles) { 37 for (const file of playlist.VideoFiles) {
38 const playlistFilename = getHlsResolutionPlaylistFilename(file.filename) 38 const playlistFilename = getHlsResolutionPlaylistFilename(file.filename)
39 39
40 await VideoPathManager.Instance.makeAvailableVideoFile(playlist, file, async videoFilePath => { 40 await VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(playlist), async videoFilePath => {
41 const size = await getVideoStreamSize(videoFilePath) 41 const size = await getVideoStreamSize(videoFilePath)
42 42
43 const bandwidth = 'BANDWIDTH=' + video.getBandwidthBits(file) 43 const bandwidth = 'BANDWIDTH=' + video.getBandwidthBits(file)
@@ -69,10 +69,11 @@ async function updateSha256VODSegments (video: MVideoUUID, playlist: MStreamingP
69 // For all the resolutions available for this video 69 // For all the resolutions available for this video
70 for (const file of playlist.VideoFiles) { 70 for (const file of playlist.VideoFiles) {
71 const rangeHashes: { [range: string]: string } = {} 71 const rangeHashes: { [range: string]: string } = {}
72 const fileWithPlaylist = file.withVideoOrPlaylist(playlist)
72 73
73 await VideoPathManager.Instance.makeAvailableVideoFile(playlist, file, videoPath => { 74 await VideoPathManager.Instance.makeAvailableVideoFile(fileWithPlaylist, videoPath => {
74 75
75 return VideoPathManager.Instance.makeAvailableResolutionPlaylistFile(playlist, file, async resolutionPlaylistPath => { 76 return VideoPathManager.Instance.makeAvailableResolutionPlaylistFile(fileWithPlaylist, async resolutionPlaylistPath => {
76 const playlistContent = await readFile(resolutionPlaylistPath) 77 const playlistContent = await readFile(resolutionPlaylistPath)
77 const ranges = getRangesFromPlaylist(playlistContent.toString()) 78 const ranges = getRangesFromPlaylist(playlistContent.toString())
78 79