mirror of
https://github.com/immich-app/immich.git
synced 2025-06-01 20:54:22 -04:00
fix(server): apply qsv and vaapi quality to video stream only (#9807)
apply quality to video stream only
This commit is contained in:
parent
fbc3790cb6
commit
8812c3afcf
@ -1427,7 +1427,7 @@ describe(MediaService.name, () => {
|
|||||||
'-v verbose',
|
'-v verbose',
|
||||||
'-vf format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:720',
|
'-vf format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:720',
|
||||||
'-preset 7',
|
'-preset 7',
|
||||||
'-global_quality 23',
|
'-global_quality:v 23',
|
||||||
'-maxrate 10000k',
|
'-maxrate 10000k',
|
||||||
'-bufsize 20000k',
|
'-bufsize 20000k',
|
||||||
]),
|
]),
|
||||||
@ -1658,8 +1658,8 @@ describe(MediaService.name, () => {
|
|||||||
outputOptions: expect.arrayContaining([
|
outputOptions: expect.arrayContaining([
|
||||||
`-c:v h264_vaapi`,
|
`-c:v h264_vaapi`,
|
||||||
'-c:a copy',
|
'-c:a copy',
|
||||||
'-qp 23',
|
'-qp:v 23',
|
||||||
'-global_quality 23',
|
'-global_quality:v 23',
|
||||||
'-rc_mode 1',
|
'-rc_mode 1',
|
||||||
]),
|
]),
|
||||||
twoPass: false,
|
twoPass: false,
|
||||||
|
@ -678,7 +678,7 @@ export class QsvSwDecodeConfig extends BaseHWConfig {
|
|||||||
|
|
||||||
getBitrateOptions() {
|
getBitrateOptions() {
|
||||||
const options = [];
|
const options = [];
|
||||||
options.push(`-${this.useCQP() ? 'q:v' : 'global_quality'} ${this.config.crf}`);
|
options.push(`-${this.useCQP() ? 'q:v' : 'global_quality:v'} ${this.config.crf}`);
|
||||||
const bitrates = this.getBitrateDistribution();
|
const bitrates = this.getBitrateDistribution();
|
||||||
if (bitrates.max > 0) {
|
if (bitrates.max > 0) {
|
||||||
options.push(`-maxrate ${bitrates.max}${bitrates.unit}`, `-bufsize ${bitrates.max * 2}${bitrates.unit}`);
|
options.push(`-maxrate ${bitrates.max}${bitrates.unit}`, `-bufsize ${bitrates.max * 2}${bitrates.unit}`);
|
||||||
@ -821,9 +821,9 @@ export class VAAPIConfig extends BaseHWConfig {
|
|||||||
'-rc_mode 3',
|
'-rc_mode 3',
|
||||||
); // variable bitrate
|
); // variable bitrate
|
||||||
} else if (this.useCQP()) {
|
} else if (this.useCQP()) {
|
||||||
options.push(`-qp ${this.config.crf}`, `-global_quality ${this.config.crf}`, '-rc_mode 1');
|
options.push(`-qp:v ${this.config.crf}`, `-global_quality:v ${this.config.crf}`, '-rc_mode 1');
|
||||||
} else {
|
} else {
|
||||||
options.push(`-global_quality ${this.config.crf}`, '-rc_mode 4');
|
options.push(`-global_quality:v ${this.config.crf}`, '-rc_mode 4');
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user