Skip to content

Commit

Permalink
core: aggregate streams support horizontal padding (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Aug 6, 2023
1 parent 2d62944 commit a6d163e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/core/src/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ function createVideoCamera(devices: VideoCamera[], console: Console): VideoCamer

for (let i = 0; i < inputs.length; i++) {
ffmpegInput.inputArguments.push(...inputs[i].inputArguments);
filter.push(`[${i}:v] scale=-1:${h},pad=${w}:ih:(ow-iw)/2 [pos${i}];`)
// https://superuser.com/a/891478
filter.push(`[${i}:v] scale=(iw*sar)*min(${w}/(iw*sar)\\,${h}/ih):ih*min(${w}/(iw*sar)\\,${h}/ih),pad=${w}:${h}:(${w}-iw*min(${w}/iw\\,${h}/ih))/2:(${h}-ih*min(${w}/iw\\,${h}/ih))/2 [pos${i}];`)
}
for (let i = inputs.length; i < dim * dim; i++) {
ffmpegInput.inputArguments.push(
Expand Down

0 comments on commit a6d163e

Please sign in to comment.