Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix(media-execution): pass the planned frame rate to ffmpeg (#284)

Sharky Wang54ff2ec40cd3
diff --git a/packages/media-execution/src/execute.ts b/packages/media-execution/src/execute.ts
index 0ac7d05a..724f3cf4 100644
--- a/packages/media-execution/src/execute.ts
+++ b/packages/media-execution/src/execute.ts
@@ -689,7 +689,7 @@ export async function executeNormalizeMedia(
await runProcess({
executable: env.ffmpegPath,
argv: ["-y", ...visualInput, "-an", "-vf", filter,
- "-frames:v", String(plan.frameCount), "-fps_mode", "cfr", ...encoderArgs, output],
+ "-frames:v", String(plan.frameCount), "-r", fps, "-fps_mode", "cfr", ...encoderArgs, output],
timeoutMs: env.processTimeoutMs,
maxStdoutBytes: 64 * 1024,
...(env.sharedLibraryPath === undefined ? {} : { sharedLibraryPath: env.sharedLibraryPath }),
@@ -951,7 +951,8 @@ export async function executeTransformMedia(
argv.push("-map", "0:v:0", "-an", "-vf", plan.videoFilters.join(","));
}
argv.push(
- "-frames:v", String(plan.frameCount), "-fps_mode", "cfr",
+ "-frames:v", String(plan.frameCount),
+ "-r", `${media.timeline.frameRate.numerator}/${media.timeline.frameRate.denominator}`, "-fps_mode", "cfr",
"-c:v", "libx264", "-preset", "veryfast", "-pix_fmt", "yuv420p",
"-movflags", "+faststart", output,
);