diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 14:55:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch) | |
tree | 226d3dd1565b0bb56588897af3b8530e6216e96b /server/lib/transcoding/default-transcoding-profiles.ts | |
parent | 6bcb854cdea8688a32240bc5719c7d139806e00b (diff) | |
download | PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.gz PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.zst PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.zip |
Implement remote runner jobs in server
Move ffmpeg functions to @shared
Diffstat (limited to 'server/lib/transcoding/default-transcoding-profiles.ts')
-rw-r--r-- | server/lib/transcoding/default-transcoding-profiles.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/server/lib/transcoding/default-transcoding-profiles.ts b/server/lib/transcoding/default-transcoding-profiles.ts index f47718819..5251784ac 100644 --- a/server/lib/transcoding/default-transcoding-profiles.ts +++ b/server/lib/transcoding/default-transcoding-profiles.ts | |||
@@ -1,15 +1,9 @@ | |||
1 | 1 | ||
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { getAverageBitrate, getMinLimitBitrate } from '@shared/core-utils' | 3 | import { getAverageBitrate, getMinLimitBitrate } from '@shared/core-utils' |
4 | import { AvailableEncoders, EncoderOptionsBuilder, EncoderOptionsBuilderParams, VideoResolution } from '../../../shared/models/videos' | 4 | import { buildStreamSuffix, FFmpegCommandWrapper, ffprobePromise, getAudioStream, getMaxAudioBitrate } from '@shared/ffmpeg' |
5 | import { | 5 | import { AvailableEncoders, EncoderOptionsBuilder, EncoderOptionsBuilderParams, VideoResolution } from '@shared/models' |
6 | buildStreamSuffix, | 6 | import { canDoQuickAudioTranscode } from './transcoding-quick-transcode' |
7 | canDoQuickAudioTranscode, | ||
8 | ffprobePromise, | ||
9 | getAudioStream, | ||
10 | getMaxAudioBitrate, | ||
11 | resetSupportedEncoders | ||
12 | } from '../../helpers/ffmpeg' | ||
13 | 7 | ||
14 | /** | 8 | /** |
15 | * | 9 | * |
@@ -184,14 +178,14 @@ class VideoTranscodingProfilesManager { | |||
184 | addEncoderPriority (type: 'vod' | 'live', streamType: 'audio' | 'video', encoder: string, priority: number) { | 178 | addEncoderPriority (type: 'vod' | 'live', streamType: 'audio' | 'video', encoder: string, priority: number) { |
185 | this.encodersPriorities[type][streamType].push({ name: encoder, priority }) | 179 | this.encodersPriorities[type][streamType].push({ name: encoder, priority }) |
186 | 180 | ||
187 | resetSupportedEncoders() | 181 | FFmpegCommandWrapper.resetSupportedEncoders() |
188 | } | 182 | } |
189 | 183 | ||
190 | removeEncoderPriority (type: 'vod' | 'live', streamType: 'audio' | 'video', encoder: string, priority: number) { | 184 | removeEncoderPriority (type: 'vod' | 'live', streamType: 'audio' | 'video', encoder: string, priority: number) { |
191 | this.encodersPriorities[type][streamType] = this.encodersPriorities[type][streamType] | 185 | this.encodersPriorities[type][streamType] = this.encodersPriorities[type][streamType] |
192 | .filter(o => o.name !== encoder && o.priority !== priority) | 186 | .filter(o => o.name !== encoder && o.priority !== priority) |
193 | 187 | ||
194 | resetSupportedEncoders() | 188 | FFmpegCommandWrapper.resetSupportedEncoders() |
195 | } | 189 | } |
196 | 190 | ||
197 | private getEncodersByPriority (type: 'vod' | 'live', streamType: 'audio' | 'video') { | 191 | private getEncodersByPriority (type: 'vod' | 'live', streamType: 'audio' | 'video') { |