diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-23 16:23:52 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-25 10:07:51 +0100 |
commit | 9252a33d115bba85adcfbc18ab3725924642871c (patch) | |
tree | 94365b67fc25cb0d9ce046a820d07344742179f6 /server/lib/live-manager.ts | |
parent | daf6e4801052d3ca6be2fafd20bae2323b1ce175 (diff) | |
download | PeerTube-9252a33d115bba85adcfbc18ab3725924642871c.tar.gz PeerTube-9252a33d115bba85adcfbc18ab3725924642871c.tar.zst PeerTube-9252a33d115bba85adcfbc18ab3725924642871c.zip |
Export encoders options in a dedicated struct
Diffstat (limited to 'server/lib/live-manager.ts')
-rw-r--r-- | server/lib/live-manager.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index 4d2e9b1b3..b9e5d4561 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts | |||
@@ -4,7 +4,7 @@ import { FfmpegCommand } from 'fluent-ffmpeg' | |||
4 | import { ensureDir, stat } from 'fs-extra' | 4 | import { ensureDir, stat } from 'fs-extra' |
5 | import { basename } from 'path' | 5 | import { basename } from 'path' |
6 | import { isTestInstance } from '@server/helpers/core-utils' | 6 | import { isTestInstance } from '@server/helpers/core-utils' |
7 | import { runLiveMuxing, runLiveTranscoding } from '@server/helpers/ffmpeg-utils' | 7 | import { getLiveMuxingCommand, getLiveTranscodingCommand } from '@server/helpers/ffmpeg-utils' |
8 | import { computeResolutionsToTranscode, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' | 8 | import { computeResolutionsToTranscode, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' |
9 | import { logger } from '@server/helpers/logger' | 9 | import { logger } from '@server/helpers/logger' |
10 | import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config' | 10 | import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config' |
@@ -264,8 +264,8 @@ class LiveManager { | |||
264 | const deleteSegments = videoLive.saveReplay === false | 264 | const deleteSegments = videoLive.saveReplay === false |
265 | 265 | ||
266 | const ffmpegExec = CONFIG.LIVE.TRANSCODING.ENABLED | 266 | const ffmpegExec = CONFIG.LIVE.TRANSCODING.ENABLED |
267 | ? runLiveTranscoding(rtmpUrl, outPath, allResolutions, fps, deleteSegments) | 267 | ? getLiveTranscodingCommand(rtmpUrl, outPath, allResolutions, fps, deleteSegments) |
268 | : runLiveMuxing(rtmpUrl, outPath, deleteSegments) | 268 | : getLiveMuxingCommand(rtmpUrl, outPath, deleteSegments) |
269 | 269 | ||
270 | logger.info('Running live muxing/transcoding for %s.', videoUUID) | 270 | logger.info('Running live muxing/transcoding for %s.', videoUUID) |
271 | this.transSessions.set(sessionId, ffmpegExec) | 271 | this.transSessions.set(sessionId, ffmpegExec) |
@@ -382,6 +382,8 @@ class LiveManager { | |||
382 | }) | 382 | }) |
383 | 383 | ||
384 | ffmpegExec.on('end', () => onFFmpegEnded()) | 384 | ffmpegExec.on('end', () => onFFmpegEnded()) |
385 | |||
386 | ffmpegExec.run() | ||
385 | } | 387 | } |
386 | 388 | ||
387 | private async onEndTransmuxing (videoId: number, cleanupNow = false) { | 389 | private async onEndTransmuxing (videoId: number, cleanupNow = false) { |