1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Optimize transcoding profile building

This commit is contained in:
Chocobozzz 2024-03-19 09:53:59 +01:00
parent 4e98d843da
commit c09e27d77a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
10 changed files with 48 additions and 26 deletions

View file

@ -2,6 +2,7 @@ import { LiveVideoErrorType } from '@peertube/peertube-models'
import { LoggerTagsFn } from '@server/helpers/logger.js'
import { MStreamingPlaylistVideo, MVideoLiveVideo } from '@server/types/models/index.js'
import EventEmitter from 'events'
import { FfprobeData } from 'fluent-ffmpeg'
interface TranscodingWrapperEvents {
'end': () => void
@ -38,6 +39,7 @@ interface AbstractTranscodingWrapperOptions {
bitrate: number
ratio: number
hasAudio: boolean
probe: FfprobeData
segmentListSize: number
segmentDuration: number
@ -61,6 +63,7 @@ abstract class AbstractTranscodingWrapper extends EventEmitter {
protected readonly bitrate: number
protected readonly ratio: number
protected readonly hasAudio: boolean
protected readonly probe: FfprobeData
protected readonly segmentListSize: number
protected readonly segmentDuration: number
@ -92,6 +95,7 @@ abstract class AbstractTranscodingWrapper extends EventEmitter {
this.bitrate = options.bitrate
this.ratio = options.ratio
this.hasAudio = options.hasAudio
this.probe = options.probe
this.segmentListSize = options.segmentListSize
this.segmentDuration = options.segmentDuration

View file

@ -30,6 +30,7 @@ export class FFmpegTranscodingWrapper extends AbstractTranscodingWrapper {
bitrate: this.bitrate,
ratio: this.ratio,
probe: this.probe,
hasAudio: this.hasAudio
})