aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-transcoding.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-transcoding.ts')
-rw-r--r--server/lib/video-transcoding.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index dbc22816c..11098dca3 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -1,4 +1,4 @@
1import { CONFIG, HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION } from '../initializers' 1import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSERVER } from '../initializers'
2import { join } from 'path' 2import { join } from 'path'
3import { getVideoFileFPS, transcode } from '../helpers/ffmpeg-utils' 3import { getVideoFileFPS, transcode } from '../helpers/ffmpeg-utils'
4import { ensureDir, move, remove, stat } from 'fs-extra' 4import { ensureDir, move, remove, stat } from 'fs-extra'
@@ -9,6 +9,7 @@ import { VideoModel } from '../models/video/video'
9import { updateMasterHLSPlaylist, updateSha256Segments } from './hls' 9import { updateMasterHLSPlaylist, updateSha256Segments } from './hls'
10import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' 10import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
11import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type' 11import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
12import { CONFIG } from '../initializers/config'
12 13
13async function optimizeVideofile (video: VideoModel, inputVideoFileArg?: VideoFileModel) { 14async function optimizeVideofile (video: VideoModel, inputVideoFileArg?: VideoFileModel) {
14 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR 15 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR
@@ -111,12 +112,12 @@ async function generateHlsPlaylist (video: VideoModel, resolution: VideoResoluti
111 await updateMasterHLSPlaylist(video) 112 await updateMasterHLSPlaylist(video)
112 await updateSha256Segments(video) 113 await updateSha256Segments(video)
113 114
114 const playlistUrl = CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) 115 const playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid)
115 116
116 await VideoStreamingPlaylistModel.upsert({ 117 await VideoStreamingPlaylistModel.upsert({
117 videoId: video.id, 118 videoId: video.id,
118 playlistUrl, 119 playlistUrl,
119 segmentsSha256Url: CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid), 120 segmentsSha256Url: WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid),
120 p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, video.VideoFiles), 121 p2pMediaLoaderInfohashes: VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(playlistUrl, video.VideoFiles),
121 p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION, 122 p2pMediaLoaderPeerVersion: P2P_MEDIA_LOADER_PEER_VERSION,
122 123