diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-05 10:36:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-09 09:18:07 +0200 |
commit | 84cae54e7a2595bea0c3ea106a4d111fd11a4ec6 (patch) | |
tree | 03fe73edf049ce60df6bbc34dcfb2031c07ea59c /server/lib/live | |
parent | 7e0f50d6e0c7dc583d40e196c283eb20dc386ae6 (diff) | |
download | PeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.tar.gz PeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.tar.zst PeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.zip |
Add option to not transcode original resolution
Diffstat (limited to 'server/lib/live')
-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> { |