Skip to content

Commit

Permalink
fix: output.fps does not work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Sep 8, 2023
1 parent b8b8dca commit 1833f7c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions electron/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import { Converter } from "./ffmpeg-stream/stream";
let converter, inputStream: Stream.Writable;
const startConverter = async (queue: ConvertQueue) => {
converter = new Converter();
converter.createInputFromFile(queue.movie.path, queue.movie.option);
converter.createInputFromFile(queue.movie.path, {
...queue.movie.option,
});
inputStream = converter.createInputStream({
f: "image2pipe",
r: queue.output.fps,
filter_complex: `pad=width=max(iw\\,ih*(16/9)):height=ow/(16/9):x=(ow-iw)/2:y=(oh-ih)/2,scale=1920x1080,overlay=x=0:y=0`,
});
converter.output(queue.output.path, {
vcodec: "libx264",
"b:v": "0",
crf: "30",
filter_complex: `[0:v]fps=fps=${queue.output.fps},pad=width=max(iw\\, ih*(16/9)):height=ow/(16/9):x=(ow-iw)/2:y=(oh-ih)/2,scale=w=1920:h=1080[3];[3][1:v]overlay[out_v]`,
"map:v": "[out_v]",
"map:a": "0:a",
r: queue.output.fps,
});
await converter.run();
Expand Down

0 comments on commit 1833f7c

Please sign in to comment.