Skip to content

Commit

Permalink
Limit video resolution to 1920px width
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 19, 2024
1 parent 0124f27 commit 22d43c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/VideoProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ export class VideoProcessor {

// Start ffmpeg
if (uuid in VideoProcessor.processes) VideoProcessor.processes[uuid].kill();
let ffmpeg = spawn(ffmpegPath, ["-i", videoPath, "-q:v", "2", path.join(cachePath, "%08d.jpg")]);
let ffmpeg = spawn(ffmpegPath, [
"-i",
videoPath,
"-vf",
"scale=1920:-2,setsar=1:1", // Limit to 1920px width
"-q:v",
"2",
path.join(cachePath, "%08d.jpg")
]);
VideoProcessor.processes[uuid] = ffmpeg;
let running = true;
let fullOutput = "";
Expand Down

0 comments on commit 22d43c8

Please sign in to comment.