diff options
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r-- | server/lib/hls.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 985f50587..43043315b 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -4,7 +4,7 @@ import { basename, dirname, join } from 'path' | |||
4 | import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' | 4 | import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' |
5 | import { sha256 } from '@shared/extra-utils' | 5 | import { sha256 } from '@shared/extra-utils' |
6 | import { VideoStorage } from '@shared/models' | 6 | import { VideoStorage } from '@shared/models' |
7 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' | 7 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamDimensionsInfo } from '../helpers/ffmpeg' |
8 | import { logger } from '../helpers/logger' | 8 | import { logger } from '../helpers/logger' |
9 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' | 9 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' |
10 | import { generateRandomString } from '../helpers/utils' | 10 | import { generateRandomString } from '../helpers/utils' |
@@ -40,10 +40,10 @@ async function updateMasterHLSPlaylist (video: MVideo, playlist: MStreamingPlayl | |||
40 | const playlistFilename = getHlsResolutionPlaylistFilename(file.filename) | 40 | const playlistFilename = getHlsResolutionPlaylistFilename(file.filename) |
41 | 41 | ||
42 | await VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(playlist), async videoFilePath => { | 42 | await VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(playlist), async videoFilePath => { |
43 | const size = await getVideoStreamSize(videoFilePath) | 43 | const size = await getVideoStreamDimensionsInfo(videoFilePath) |
44 | 44 | ||
45 | const bandwidth = 'BANDWIDTH=' + video.getBandwidthBits(file) | 45 | const bandwidth = 'BANDWIDTH=' + video.getBandwidthBits(file) |
46 | const resolution = `RESOLUTION=${size.width}x${size.height}` | 46 | const resolution = `RESOLUTION=${size?.width || 0}x${size?.height || 0}` |
47 | 47 | ||
48 | let line = `#EXT-X-STREAM-INF:${bandwidth},${resolution}` | 48 | let line = `#EXT-X-STREAM-INF:${bandwidth},${resolution}` |
49 | if (file.fps) line += ',FRAME-RATE=' + file.fps | 49 | if (file.fps) line += ',FRAME-RATE=' + file.fps |