Skip to content

Commit

Permalink
snapshot: tell ffmpeg pipe input format (koush#902)
Browse files Browse the repository at this point in the history
* snapshot: tell ffmpeg pipe input format

* use image2pipe
  • Loading branch information
bjia56 authored and A2Wolverin3 committed Jun 28, 2023
1 parent f37c36b commit 45c1fa2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/snapshot/src/ffmpeg-image-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function ffmpegCreateOutputArguments(inputArguments: string[], options: FFmpegIm

export function ffmpegFilterImageBuffer(inputJpeg: Buffer, options: FFmpegImageFilterOptions) {
const inputArguments = [
'-f', 'image2pipe',
'-i', 'pipe:4',
];

Expand Down Expand Up @@ -198,7 +199,7 @@ export async function ffmpegFilterImageStream(cp: ChildProcess, options: FFmpegI
++count;
last = jpeg;
});

await once(pipe, 'jpeg');
await Promise.any([once(cp, 'exit'), sleep(options.time)]).catch(() => {});
if (!last)
Expand Down

0 comments on commit 45c1fa2

Please sign in to comment.