mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
fix filters when tonemapping is disabled
This commit is contained in:
parent
e820188fa3
commit
f05760ab4b
1 changed files with 4 additions and 26 deletions
|
@ -85,17 +85,11 @@ class BaseConfig implements VideoCodecSWConfig {
|
||||||
options.push(`scale_vulkan=w=${width}:h=${height}`);
|
options.push(`scale_vulkan=w=${width}:h=${height}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldToneMap(videoStream)) {
|
const colors = this.getColors();
|
||||||
options.push(...this.getToneMapping());
|
const tonemapping = this.shouldToneMap(videoStream) ? this.config.tonemap : 'clip';
|
||||||
}
|
const libplacebo = `libplacebo=format=yuv420p:tonemapping=${tonemapping}:colorspace=${colors.matrix}:color_primaries=${colors.primaries}:color_trc=${colors.transfer}:upscaler=none:downscaler=none:deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6`;
|
||||||
|
|
||||||
if (options.length > 1) {
|
|
||||||
options[options.length - 1] = `${options.at(-1)}:format=yuv420p`;
|
|
||||||
options.push(this.getFilterEnd());
|
|
||||||
} else {
|
|
||||||
options.push(this.getFilterEnd(), 'format=yuv420p');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
options.push(libplacebo, this.getFilterEnd(), 'format=yuv420p');
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,14 +228,6 @@ class BaseConfig implements VideoCodecSWConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getToneMapping() {
|
|
||||||
const colors = this.getColors();
|
|
||||||
|
|
||||||
return [
|
|
||||||
`libplacebo=tonemapping=${this.config.tonemap}:colorspace=${colors.matrix}:color_primaries=${colors.primaries}:color_trc=${colors.transfer}:range=pc:downscaler=lanczos:deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6`,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
getDeviceOptions() {
|
getDeviceOptions() {
|
||||||
return [
|
return [
|
||||||
`-init_hw_device ${this.getAccel()}=${this.getDevice()}`,
|
`-init_hw_device ${this.getAccel()}=${this.getDevice()}`,
|
||||||
|
@ -378,14 +364,6 @@ export class ThumbnailConfig extends BaseConfig {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFilterOptions(videoStream: VideoStreamInfo): string[] {
|
|
||||||
const options = super.getFilterOptions(videoStream);
|
|
||||||
if (options.at(-1) !== 'format=yuv420p') {
|
|
||||||
options.push('format=yuv420p');
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
getFilterEnd() {
|
getFilterEnd() {
|
||||||
return 'hwdownload';
|
return 'hwdownload';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue