diff options
author | Chocobozzz <me@florianbigard.com> | 2022-02-11 10:51:33 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-02-28 10:42:19 +0100 |
commit | c729caf6cc34630877a0e5a1bda1719384cd0c8a (patch) | |
tree | 1d2e13722e518c73d2c9e6f0969615e29d51cf8c /server/lib/hls.ts | |
parent | a24bf4dc659cebb65d887862bf21d7a35e9ec791 (diff) | |
download | PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.gz PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.zst PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.zip |
Add basic video editor support
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 |