aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index 4daf9249b..e10e306a7 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -1,8 +1,9 @@
1import * as Bull from 'bull' 1import * as Bull from 'bull'
2import { copy, pathExists, readdir, remove } from 'fs-extra' 2import { pathExists, readdir, remove } from 'fs-extra'
3import { join } from 'path' 3import { join } from 'path'
4import { getDurationFromVideoFile, getVideoFileResolution } from '@server/helpers/ffprobe-utils' 4import { ffprobePromise, getAudioStream, getAudioStreamCodec, getDurationFromVideoFile, getVideoFileResolution } from '@server/helpers/ffprobe-utils'
5import { VIDEO_LIVE } from '@server/initializers/constants' 5import { VIDEO_LIVE } from '@server/initializers/constants'
6import { LiveManager } from '@server/lib/live-manager'
6import { generateVideoMiniature } from '@server/lib/thumbnail' 7import { generateVideoMiniature } from '@server/lib/thumbnail'
7import { publishAndFederateIfNeeded } from '@server/lib/video' 8import { publishAndFederateIfNeeded } from '@server/lib/video'
8import { getHLSDirectory } from '@server/lib/video-paths' 9import { getHLSDirectory } from '@server/lib/video-paths'
@@ -14,7 +15,6 @@ import { VideoStreamingPlaylistModel } from '@server/models/video/video-streamin
14import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' 15import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models'
15import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' 16import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
16import { logger } from '../../../helpers/logger' 17import { logger } from '../../../helpers/logger'
17import { LiveManager } from '@server/lib/live-manager'
18 18
19async function processVideoLiveEnding (job: Bull.Job) { 19async function processVideoLiveEnding (job: Bull.Job) {
20 const payload = job.data as VideoLiveEndingPayload 20 const payload = job.data as VideoLiveEndingPayload
@@ -106,13 +106,17 @@ async function saveLive (video: MVideo, live: MVideoLive) {
106 const concatenatedTsFile = LiveManager.Instance.buildConcatenatedName(playlistFile) 106 const concatenatedTsFile = LiveManager.Instance.buildConcatenatedName(playlistFile)
107 const concatenatedTsFilePath = join(replayDirectory, concatenatedTsFile) 107 const concatenatedTsFilePath = join(replayDirectory, concatenatedTsFile)
108 108
109 const { videoFileResolution, isPortraitMode } = await getVideoFileResolution(concatenatedTsFilePath) 109 const probe = await ffprobePromise(concatenatedTsFilePath)
110 const { audioStream } = await getAudioStream(concatenatedTsFilePath, probe)
111
112 const { videoFileResolution, isPortraitMode } = await getVideoFileResolution(concatenatedTsFilePath, probe)
110 113
111 const outputPath = await generateHlsPlaylistFromTS({ 114 const outputPath = await generateHlsPlaylistFromTS({
112 video: videoWithFiles, 115 video: videoWithFiles,
113 concatenatedTsFilePath, 116 concatenatedTsFilePath,
114 resolution: videoFileResolution, 117 resolution: videoFileResolution,
115 isPortraitMode 118 isPortraitMode,
119 isAAC: audioStream?.codec_name === 'aac'
116 }) 120 })
117 121
118 if (!durationDone) { 122 if (!durationDone) {