diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /server/lib/live | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip |
esModuleInterop to true
Diffstat (limited to 'server/lib/live')
-rw-r--r-- | server/lib/live/shared/muxing-session.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/live/shared/muxing-session.ts b/server/lib/live/shared/muxing-session.ts index 0c9fb0cb6..a6907142d 100644 --- a/server/lib/live/shared/muxing-session.ts +++ b/server/lib/live/shared/muxing-session.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | import * as Bluebird from 'bluebird' | 2 | import { mapSeries } from 'bluebird' |
3 | import * as chokidar from 'chokidar' | 3 | import { FSWatcher, watch } from 'chokidar' |
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { appendFile, ensureDir, readFile, stat } from 'fs-extra' | 5 | import { appendFile, ensureDir, readFile, stat } from 'fs-extra' |
6 | import { basename, join } from 'path' | 6 | import { basename, join } from 'path' |
@@ -67,8 +67,8 @@ class MuxingSession extends EventEmitter { | |||
67 | 67 | ||
68 | private segmentsToProcessPerPlaylist: { [playlistId: string]: string[] } = {} | 68 | private segmentsToProcessPerPlaylist: { [playlistId: string]: string[] } = {} |
69 | 69 | ||
70 | private tsWatcher: chokidar.FSWatcher | 70 | private tsWatcher: FSWatcher |
71 | private masterWatcher: chokidar.FSWatcher | 71 | private masterWatcher: FSWatcher |
72 | 72 | ||
73 | private readonly isAbleToUploadVideoWithCache = memoizee((userId: number) => { | 73 | private readonly isAbleToUploadVideoWithCache = memoizee((userId: number) => { |
74 | return isAbleToUploadVideo(userId, 1000) | 74 | return isAbleToUploadVideo(userId, 1000) |
@@ -197,7 +197,7 @@ class MuxingSession extends EventEmitter { | |||
197 | } | 197 | } |
198 | 198 | ||
199 | private watchMasterFile (outPath: string) { | 199 | private watchMasterFile (outPath: string) { |
200 | this.masterWatcher = chokidar.watch(outPath + '/' + this.streamingPlaylist.playlistFilename) | 200 | this.masterWatcher = watch(outPath + '/' + this.streamingPlaylist.playlistFilename) |
201 | 201 | ||
202 | this.masterWatcher.on('add', () => { | 202 | this.masterWatcher.on('add', () => { |
203 | this.emit('master-playlist-created', { videoId: this.videoId }) | 203 | this.emit('master-playlist-created', { videoId: this.videoId }) |
@@ -210,7 +210,7 @@ class MuxingSession extends EventEmitter { | |||
210 | private watchTSFiles (outPath: string) { | 210 | private watchTSFiles (outPath: string) { |
211 | const startStreamDateTime = new Date().getTime() | 211 | const startStreamDateTime = new Date().getTime() |
212 | 212 | ||
213 | this.tsWatcher = chokidar.watch(outPath + '/*.ts') | 213 | this.tsWatcher = watch(outPath + '/*.ts') |
214 | 214 | ||
215 | const playlistIdMatcher = /^([\d+])-/ | 215 | const playlistIdMatcher = /^([\d+])-/ |
216 | 216 | ||
@@ -306,7 +306,7 @@ class MuxingSession extends EventEmitter { | |||
306 | } | 306 | } |
307 | 307 | ||
308 | private processSegments (hlsVideoPath: string, segmentPaths: string[]) { | 308 | private processSegments (hlsVideoPath: string, segmentPaths: string[]) { |
309 | Bluebird.mapSeries(segmentPaths, async previousSegment => { | 309 | mapSeries(segmentPaths, async previousSegment => { |
310 | // Add sha hash of previous segments, because ffmpeg should have finished generating them | 310 | // Add sha hash of previous segments, because ffmpeg should have finished generating them |
311 | await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment) | 311 | await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment) |
312 | 312 | ||