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:
@@ -28,8 +28,8 @@ export function encodingCommandBuilder(videoInfo: parsedVideoInfo): string {
|
|||||||
const profile = videoInfo.MPix < 1 ? profiles.DVD : profiles.BluRay;
|
const profile = videoInfo.MPix < 1 ? profiles.DVD : profiles.BluRay;
|
||||||
const args = [
|
const args = [
|
||||||
"ffmpeg \\\n",
|
"ffmpeg \\\n",
|
||||||
"-v",
|
// "-v",
|
||||||
"quiet \\\n",
|
// "quiet \\\n",
|
||||||
"-hide_banner \\\n",
|
"-hide_banner \\\n",
|
||||||
"-i",
|
"-i",
|
||||||
`"${videoInfo.filename}" \\\n`,
|
`"${videoInfo.filename}" \\\n`,
|
||||||
@@ -45,7 +45,9 @@ export function encodingCommandBuilder(videoInfo: parsedVideoInfo): string {
|
|||||||
args.push("-crf", profile.crf + " \\\n");
|
args.push("-crf", profile.crf + " \\\n");
|
||||||
args.push(
|
args.push(
|
||||||
"-svtav1-params",
|
"-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");
|
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) {
|
if (videoInfo.metadata) {
|
||||||
args.push("-metadata", `title="${videoInfo.metadata.title}" \\\n`);
|
args.push("-metadata", `title="${videoInfo.metadata.title}" \\\n`);
|
||||||
|
|||||||
Reference in New Issue
Block a user