mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(server): override reserved color metadata for video thumbnails (#22348)
override reserved metadata
This commit is contained in:
parent
68acb8b99d
commit
ea9c0683ff
5 changed files with 61 additions and 3 deletions
|
|
@ -392,9 +392,30 @@ export class ThumbnailConfig extends BaseConfig {
|
|||
|
||||
getBaseInputOptions(videoStream: VideoStreamInfo, format?: VideoFormat): string[] {
|
||||
// skip_frame nointra skips all frames for some MPEG-TS files. Look at ffmpeg tickets 7950 and 7895 for more details.
|
||||
return format?.formatName === 'mpegts'
|
||||
? ['-sws_flags accurate_rnd+full_chroma_int']
|
||||
: ['-skip_frame nointra', '-sws_flags accurate_rnd+full_chroma_int'];
|
||||
const options =
|
||||
format?.formatName === 'mpegts'
|
||||
? ['-sws_flags accurate_rnd+full_chroma_int']
|
||||
: ['-skip_frame nointra', '-sws_flags accurate_rnd+full_chroma_int'];
|
||||
|
||||
const metadataOverrides = [];
|
||||
if (videoStream.colorPrimaries === 'reserved') {
|
||||
metadataOverrides.push('colour_primaries=1');
|
||||
}
|
||||
|
||||
if (videoStream.colorSpace === 'reserved') {
|
||||
metadataOverrides.push('matrix_coefficients=1');
|
||||
}
|
||||
|
||||
if (videoStream.colorTransfer === 'reserved') {
|
||||
metadataOverrides.push('transfer_characteristics=1');
|
||||
}
|
||||
|
||||
if (metadataOverrides.length > 0) {
|
||||
// workaround for https://fftrac-bg.ffmpeg.org/ticket/11020
|
||||
options.push(`-bsf:v ${videoStream.codecName}_metadata=${metadataOverrides.join(':')}`);
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
getBaseOutputOptions() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue