From 1833f7ca9ef0ae73c932350ede5c3f95df72c05b Mon Sep 17 00:00:00 2001 From: XPA Date: Fri, 8 Sep 2023 16:33:23 +0900 Subject: [PATCH] fix: output.fps does not work correctly --- electron/converter.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/electron/converter.ts b/electron/converter.ts index 3afd47e..84fc06f 100644 --- a/electron/converter.ts +++ b/electron/converter.ts @@ -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();