High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): use VBR for QSV so the max bitrate is respected (#29240)
Anthony Clericic0bf5a4c563d
diff --git a/server/src/services/media.service.spec.ts b/server/src/services/media.service.spec.tsindex 994ba436ad..b453082574 100644--- a/server/src/services/media.service.spec.ts+++ b/server/src/services/media.service.spec.ts@@ -2939,6 +2939,8 @@ describe(MediaService.name, () => {'7','-global_quality:v','23',+ '-b:v',+ '6897k','-maxrate','10000k','-bufsize',diff --git a/server/src/utils/media.ts b/server/src/utils/media.tsindex b3a617c36e..eb775e20d3 100644--- a/server/src/utils/media.ts+++ b/server/src/utils/media.ts@@ -788,6 +788,12 @@ export class QsvSwDecodeConfig extends BaseHWConfig {const options = [`-${this.useCQP() ? 'q:v' : 'global_quality:v'}`, `${this.config.crf}`];const bitrates = this.getBitrateDistribution();if (bitrates.max > 0) {+ // Workaround for https://github.com/immich-app/immich/issues/29220, to be revisited+ // QSV seems to ignore -maxrate without -b:v+ // -b:v alongside global_quality uses QVBR+ if (!this.useCQP()) {+ options.push('-b:v', `${bitrates.target}${bitrates.unit}`);+ }options.push('-maxrate', `${bitrates.max}${bitrates.unit}`, '-bufsize', `${bitrates.max * 2}${bitrates.unit}`);}return options;