fix(server): ffmpeg matrices (#13461)

* Fix ffmpeg matrices

* override `getColors`

* formatting

---------

Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
lyyn 2024-10-16 20:29:59 +02:00 committed by GitHub
parent c266465317
commit 782ba48470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 14 deletions

View file

@ -270,9 +270,9 @@ export class BaseConfig implements VideoCodecSWConfig {
getColors() {
return {
primaries: 'bt709',
transfer: 'bt709',
matrix: 'bt709',
primaries: '709',
transfer: '709',
matrix: '709',
};
}
@ -424,16 +424,16 @@ export class ThumbnailConfig extends BaseConfig {
getScaling(videoStream: VideoStreamInfo) {
let options = super.getScaling(videoStream) + ':flags=lanczos+accurate_rnd+full_chroma_int';
if (!this.shouldToneMap(videoStream)) {
options += ':out_color_matrix=601:out_range=pc';
options += ':out_color_matrix=bt601:out_range=pc';
}
return options;
}
getColors() {
return {
primaries: 'bt709',
primaries: '709',
transfer: '601',
matrix: 'bt470bg',
matrix: '470bg',
};
}
}
@ -650,6 +650,14 @@ export class NvencHwDecodeConfig extends NvencSwDecodeConfig {
getOutputThreadOptions() {
return [];
}
getColors() {
return {
primaries: 'bt709',
transfer: 'bt709',
matrix: 'bt709',
};
}
}
export class QsvSwDecodeConfig extends BaseHWConfig {
@ -793,6 +801,14 @@ export class QsvHwDecodeConfig extends QsvSwDecodeConfig {
getInputThreadOptions() {
return [`-threads 1`];
}
getColors() {
return {
primaries: 'bt709',
transfer: 'bt709',
matrix: 'bt709',
};
}
}
export class VAAPIConfig extends BaseHWConfig {
@ -940,4 +956,12 @@ export class RkmppHwDecodeConfig extends RkmppSwDecodeConfig {
}
return [];
}
getColors() {
return {
primaries: 'bt709',
transfer: 'bt709',
matrix: 'bt709',
};
}
}