TheSHEEEP
TheSHEEEP

Reputation: 3132

ffmpeg not stopping when input is dshow

We were recording a video by specifying a named pipe as input for video frames, like this:

ffmpeg -r 30 -f rawvideo -pix_fmt bgra -s 640x480 -i namedPipe [... output options] out.mp4

It works well, and FFmpeg stops once the named pipe is closed, as is desired.

However, then we also want to record live audio from directshow, like this:

ffmpeg -r 30 -f rawvideo -pix_fmt bgra -s 640x480 -i namedPipe -f dshow -i audio=virtual-audio-capturer [... output options] out.mp4

This also works, but the problem is that the process now does not stop any more once we close the named pipe for the video frames. My guess is that ffmpeg still gets audio input and thus just keeps running.

How can I change the FFmpeg command so that it stops once the video frames keep coming?

Upvotes: 0

Views: 827

Answers (1)

Gyan
Gyan

Reputation: 93068

Add -shortest i.e. [... output options] -shortest out.mp4

Upvotes: 1

Related Questions