cos tam dziala
This commit is contained in:
35
back/src/lib/crateClip.ts
Normal file
35
back/src/lib/crateClip.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { execa } from "execa";
|
||||
import ffmpegPath from "ffmpeg-static";
|
||||
import path from "node:path";
|
||||
|
||||
export async function encodeFrames({
|
||||
inputPattern,
|
||||
output,
|
||||
fps = 30,
|
||||
}: {
|
||||
inputPattern: string;
|
||||
output: string;
|
||||
fps?: number;
|
||||
}) {
|
||||
console.log("kleje filmik");
|
||||
await execa(ffmpegPath!, [
|
||||
"-y",
|
||||
"-pattern_type", "glob",
|
||||
"-framerate", fps.toString(),
|
||||
"-i", inputPattern,
|
||||
|
||||
"-i", path.resolve("./music.mp3"),
|
||||
|
||||
"-c:v", "libx264",
|
||||
"-pix_fmt", "yuv420p",
|
||||
|
||||
|
||||
"-c:a", "mp3",
|
||||
|
||||
"-shortest",
|
||||
// "-preset", "medium",
|
||||
// "-crf", "18",
|
||||
output,
|
||||
]);
|
||||
console.log("filmik sklejony");
|
||||
}
|
||||
Reference in New Issue
Block a user