aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-15 15:06:14 +0200
committerChocobozzz <me@florianbigard.com>2023-05-15 15:06:14 +0200
commit5a05c14573ca3c0d16b77bef78d845f96c8c6497 (patch)
tree3576ecd3d3e88209e9e66c937a56d284c001c43b /server/lib
parent1a5b7dff7fa1fc8b55ed12008f7720b46671e3d3 (diff)
downloadPeerTube-5a05c14573ca3c0d16b77bef78d845f96c8c6497.tar.gz
PeerTube-5a05c14573ca3c0d16b77bef78d845f96c8c6497.tar.zst
PeerTube-5a05c14573ca3c0d16b77bef78d845f96c8c6497.zip
Force live stream termination
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/live/live-manager.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts
index c78cf82eb..6d51f4de7 100644
--- a/server/lib/live/live-manager.ts
+++ b/server/lib/live/live-manager.ts
@@ -6,6 +6,7 @@ import { logger, loggerTagsFactory } from '@server/helpers/logger'
6import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config' 6import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config'
7import { VIDEO_LIVE } from '@server/initializers/constants' 7import { VIDEO_LIVE } from '@server/initializers/constants'
8import { sequelizeTypescript } from '@server/initializers/database' 8import { sequelizeTypescript } from '@server/initializers/database'
9import { RunnerJobModel } from '@server/models/runner/runner-job'
9import { UserModel } from '@server/models/user/user' 10import { UserModel } from '@server/models/user/user'
10import { VideoModel } from '@server/models/video/video' 11import { VideoModel } from '@server/models/video/video'
11import { VideoLiveModel } from '@server/models/video/video-live' 12import { VideoLiveModel } from '@server/models/video/video-live'
@@ -25,7 +26,6 @@ import { computeResolutionsToTranscode } from '../transcoding/transcoding-resolu
25import { LiveQuotaStore } from './live-quota-store' 26import { LiveQuotaStore } from './live-quota-store'
26import { cleanupAndDestroyPermanentLive, getLiveSegmentTime } from './live-utils' 27import { cleanupAndDestroyPermanentLive, getLiveSegmentTime } from './live-utils'
27import { MuxingSession } from './shared' 28import { MuxingSession } from './shared'
28import { RunnerJobModel } from '@server/models/runner/runner-job'
29 29
30const NodeRtmpSession = require('node-media-server/src/node_rtmp_session') 30const NodeRtmpSession = require('node-media-server/src/node_rtmp_session')
31const context = require('node-media-server/src/node_core_ctx') 31const context = require('node-media-server/src/node_core_ctx')
@@ -80,6 +80,9 @@ class LiveManager {
80 80
81 events.on('donePublish', sessionId => { 81 events.on('donePublish', sessionId => {
82 logger.info('Live session ended.', { sessionId, ...lTags(sessionId) }) 82 logger.info('Live session ended.', { sessionId, ...lTags(sessionId) })
83
84 // Force session aborting, so we kill ffmpeg even if it still has data to process (slow CPU)
85 setTimeout(() => this.abortSession(sessionId), 2000)
83 }) 86 })
84 87
85 registerConfigChangedHandler(() => { 88 registerConfigChangedHandler(() => {