diff options
Diffstat (limited to 'server/lib/live/live-manager.ts')
-rw-r--r-- | server/lib/live/live-manager.ts | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index bd47b01f9..1d1ecd935 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts | |||
@@ -4,7 +4,7 @@ import { createServer, Server } from 'net' | |||
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { createServer as createServerTLS, Server as ServerTLS } from 'tls' | 5 | import { createServer as createServerTLS, Server as ServerTLS } from 'tls' |
6 | import { | 6 | import { |
7 | computeLowerResolutionsToTranscode, | 7 | computeResolutionsToTranscode, |
8 | ffprobePromise, | 8 | ffprobePromise, |
9 | getLiveSegmentTime, | 9 | getLiveSegmentTime, |
10 | getVideoStreamBitrate, | 10 | getVideoStreamBitrate, |
@@ -26,10 +26,10 @@ import { federateVideoIfNeeded } from '../activitypub/videos' | |||
26 | import { JobQueue } from '../job-queue' | 26 | import { JobQueue } from '../job-queue' |
27 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '../paths' | 27 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '../paths' |
28 | import { PeerTubeSocket } from '../peertube-socket' | 28 | import { PeerTubeSocket } from '../peertube-socket' |
29 | import { Hooks } from '../plugins/hooks' | ||
29 | import { LiveQuotaStore } from './live-quota-store' | 30 | import { LiveQuotaStore } from './live-quota-store' |
30 | import { cleanupPermanentLive } from './live-utils' | 31 | import { cleanupPermanentLive } from './live-utils' |
31 | import { MuxingSession } from './shared' | 32 | import { MuxingSession } from './shared' |
32 | import { Hooks } from '../plugins/hooks' | ||
33 | 33 | ||
34 | const NodeRtmpSession = require('node-media-server/src/node_rtmp_session') | 34 | const NodeRtmpSession = require('node-media-server/src/node_rtmp_session') |
35 | const context = require('node-media-server/src/node_core_ctx') | 35 | const context = require('node-media-server/src/node_core_ctx') |
@@ -456,11 +456,17 @@ class LiveManager { | |||
456 | } | 456 | } |
457 | 457 | ||
458 | private buildAllResolutionsToTranscode (originResolution: number) { | 458 | private buildAllResolutionsToTranscode (originResolution: number) { |
459 | const includeInputResolution = CONFIG.LIVE.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION | ||
460 | |||
459 | const resolutionsEnabled = CONFIG.LIVE.TRANSCODING.ENABLED | 461 | const resolutionsEnabled = CONFIG.LIVE.TRANSCODING.ENABLED |
460 | ? computeLowerResolutionsToTranscode(originResolution, 'live') | 462 | ? computeResolutionsToTranscode({ inputResolution: originResolution, type: 'live', includeInputResolution }) |
461 | : [] | 463 | : [] |
462 | 464 | ||
463 | return resolutionsEnabled.concat([ originResolution ]) | 465 | if (resolutionsEnabled.length === 0) { |
466 | return [ originResolution ] | ||
467 | } | ||
468 | |||
469 | return resolutionsEnabled | ||
464 | } | 470 | } |
465 | 471 | ||
466 | private async createLivePlaylist (video: MVideo, allResolutions: number[]): Promise<MStreamingPlaylistVideo> { | 472 | private async createLivePlaylist (video: MVideo, allResolutions: number[]): Promise<MStreamingPlaylistVideo> { |