aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-05 10:36:19 +0200
committerChocobozzz <me@florianbigard.com>2022-08-09 09:18:07 +0200
commit84cae54e7a2595bea0c3ea106a4d111fd11a4ec6 (patch)
tree03fe73edf049ce60df6bbc34dcfb2031c07ea59c /server/lib/live
parent7e0f50d6e0c7dc583d40e196c283eb20dc386ae6 (diff)
downloadPeerTube-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.ts14
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'
4import { join } from 'path' 4import { join } from 'path'
5import { createServer as createServerTLS, Server as ServerTLS } from 'tls' 5import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
6import { 6import {
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'
26import { JobQueue } from '../job-queue' 26import { JobQueue } from '../job-queue'
27import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '../paths' 27import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '../paths'
28import { PeerTubeSocket } from '../peertube-socket' 28import { PeerTubeSocket } from '../peertube-socket'
29import { Hooks } from '../plugins/hooks'
29import { LiveQuotaStore } from './live-quota-store' 30import { LiveQuotaStore } from './live-quota-store'
30import { cleanupPermanentLive } from './live-utils' 31import { cleanupPermanentLive } from './live-utils'
31import { MuxingSession } from './shared' 32import { MuxingSession } from './shared'
32import { Hooks } from '../plugins/hooks'
33 33
34const NodeRtmpSession = require('node-media-server/src/node_rtmp_session') 34const NodeRtmpSession = require('node-media-server/src/node_rtmp_session')
35const context = require('node-media-server/src/node_core_ctx') 35const 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> {