0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 02:23:09 -05:00
This commit is contained in:
mertalev 2024-05-13 12:11:42 -04:00
parent adf620331c
commit 48a71ac4d9
No known key found for this signature in database
GPG key ID: 13C97EF14A338984

View file

@ -461,26 +461,30 @@ export class NVENCConfig extends BaseHWConfig {
return options; return options;
} }
getToneMapping() {
const colors = this.getColors();
return [
'hwupload=derive_device=vulkan',
`libplacebo=tonemapping=${this.config.tonemap}:colorspace=${colors.matrix}:color_primaries=${colors.primaries}:color_trc=${colors.transfer}:format=yuv420p:upscaler=none:downscaler=none:deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6`,
'hwupload=derive_device=cuda',
];
}
getFilterOptions(videoStream: VideoStreamInfo) { getFilterOptions(videoStream: VideoStreamInfo) {
const options = []; const options = ['hwupload=derive_device=vulkan'];
if (this.shouldScale(videoStream)) { if (this.shouldScale(videoStream)) {
options.push(`scale_cuda=${this.getScaling(videoStream)}`); const { width, height } = this.getSize(videoStream);
options.push(`scale_vulkan=w=${width}:h=${height}`);
} }
if (this.shouldToneMap(videoStream)) { const colors = this.getColors();
options.push(...this.getToneMapping()); const libplaceboOptions = [
} `color_primaries=${colors.primaries}`,
`color_trc=${colors.transfer}`,
`colorspace=${colors.matrix}`,
'deband=true',
'deband_iterations=3',
'deband_radius=8',
'deband_threshold=6',
'downscaler=none',
'format=yuv420p',
`tonemapping=${this.shouldToneMap(videoStream) ? this.config.tonemap : 'clip'}`,
'upscaler=none',
];
const libplacebo = `libplacebo=${libplaceboOptions.join(':')}`;
options.push(libplacebo, 'hwupload=derive_device=cuda');
return options; return options;
} }