fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.85k stars 874 forks source link

How to kill the ffmpeg progress in windows ? #1145

Closed radiorz closed 3 years ago

radiorz commented 3 years ago

Version information

Code to reproduce


const command = ffmpeg(inputPath).inputOptions('-re').inputOptions('-stream_loop -1').noVideo().format('flv')
    command
        .output(outputPath, {
            end: true
        })
        .run()

    setTimeout(() => {
        command.on('error', () => {
            console.log('Ffmpeg has been killed')
        })
        command.kill()
        console.log(1)
    }, 10 * 1000)

(note: if the problem only happens with some inputs, include a link to such an input file)

Expected results

the ffmpeg process is killed

Observed results

the ffmpeg is still running

Checklist

radiorz commented 3 years ago

there is a way to kill the process:

command.ffmpegProc.stdin.write('q');