Skip to content

Commit

Permalink
Down-integrate a few ffmpeg changes from dizque
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbenincasa committed Apr 3, 2024
1 parent 67f2d14 commit bf3b076
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/src/ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,21 +668,25 @@ export class FFMPEG extends (events.EventEmitter as new () => TypedEventEmitter<
`-sc_threshold`,
`1000000000`,
);
if (stillImage) {
if (stillImage && this.opts.videoEncoder.toLowerCase().includes('nv')) {
ffmpegArgs.push('-tune', 'stillimage');
}
}
ffmpegArgs.push('-map', currentAudio, `-flags`, `cgop+ilme`);
if (transcodeVideo && this.audioOnly !== true) {
// add the video encoder flags
ffmpegArgs.push(
`-b:v`,
`${this.opts.videoBitrate}k`,
'-crf',
'22',
`-maxrate:v`,
`${this.opts.videoBitrate}k`,
`-bufsize:v`,
`${this.opts.videoBufferSize}k`,
);

if (this.opts.videoEncoder.toLowerCase() === 'mpeg2video') {
ffmpegArgs.push('-qscale:v', '1', '-b:v', `${this.opts.videoBitrate}k`);
}
}
if (transcodeAudio) {
// add the audio encoder flags
Expand Down

0 comments on commit bf3b076

Please sign in to comment.