feat(server): only transcode streams that require it (#7106)

This commit is contained in:
Mert
2024-02-14 11:24:39 -05:00
committed by GitHub
parent b823dfffdc
commit 5ff68d4cdb
7 changed files with 169 additions and 97 deletions
@@ -1,4 +1,4 @@
import { VideoCodec } from '@app/infra/entities';
import { TranscodeTarget, VideoCodec } from '@app/infra/entities';
import { Writable } from 'node:stream';
export const IMediaRepository = 'IMediaRepository';
@@ -16,15 +16,14 @@ export interface VideoStreamInfo {
width: number;
rotation: number;
codecName?: string;
codecType?: string;
frameCount: number;
isHDR: boolean;
bitrate: number;
}
export interface AudioStreamInfo {
index: number;
codecName?: string;
codecType?: string;
frameCount: number;
}
@@ -64,7 +63,7 @@ export interface BitrateDistribution {
}
export interface VideoCodecSWConfig {
getOptions(videoStream: VideoStreamInfo, audioStream: AudioStreamInfo): TranscodeOptions;
getOptions(target: TranscodeTarget, videoStream: VideoStreamInfo, audioStream: AudioStreamInfo): TranscodeOptions;
}
export interface VideoCodecHWConfig extends VideoCodecSWConfig {