feat: improve keyframe handling and encoding parameters

- Move keyframe interval from -g flag to SVT-AV1's keyint parameter
- Add enable-qm parameter for better quality management
- Disable quiet mode to show FFmpeg progress during encoding
This commit is contained in:
Esa Kataja
2025-10-04 17:23:22 +03:00
parent c68b887b60
commit df6087d0d8
+6 -4
View File
@@ -28,8 +28,8 @@ export function encodingCommandBuilder(videoInfo: parsedVideoInfo): string {
const profile = videoInfo.MPix < 1 ? profiles.DVD : profiles.BluRay;
const args = [
"ffmpeg \\\n",
"-v",
"quiet \\\n",
// "-v",
// "quiet \\\n",
"-hide_banner \\\n",
"-i",
`"${videoInfo.filename}" \\\n`,
@@ -45,7 +45,9 @@ export function encodingCommandBuilder(videoInfo: parsedVideoInfo): string {
args.push("-crf", profile.crf + " \\\n");
args.push(
"-svtav1-params",
`tune=0:film-grain=${profile.filmGrain}:scd=1:film-grain-denoise=1 \\\n`,
`keyint=${
Math.round(videoInfo.fps * 5)
}:tune=0:film-grain=${profile.filmGrain}:scd=1:film-grain-denoise=1:enable-overlays=1:enable-qm=1:qm-min=0:qm-max=15 \\\n`,
);
args.push("-preset", profile.preset + " \\\n");
@@ -65,7 +67,7 @@ export function encodingCommandBuilder(videoInfo: parsedVideoInfo): string {
);
}
args.push("-g", `${Math.round(videoInfo.fps * 5)} \\\n`);
// args.push("-g", `${Math.round(videoInfo.fps * 5)} \\\n`);
if (videoInfo.metadata) {
args.push("-metadata", `title="${videoInfo.metadata.title}" \\\n`);