0

I have a program written in Node.Js that uses the following FFmpeg command to capture video:

ffmpeg -f dshow -i video=Integrated Webcam -c:v libx264 -f segment -strftime 1 -segment_time 60 -segment_format mp4 out%Y-%m-%d_%H-%M-%S.mp4

There is a need for the video to be interrupted at any time by means of a button. When finalized by the command:

taskkill /im ffmpeg.exe /t /f

Video is corrupted and can not be played.

Any way to end the process but preserve the recorded content?

lys
  • 107
  • 8
  • You should be able to send it a BREAK signal...maybe :) https://stackoverflow.com/questions/813086/can-i-send-a-ctrl-c-sigint-to-an-application-on-windows – rogerdpack Oct 04 '17 at 02:02

1 Answers1

2

Add -segment_format_options movflags=empty_moov. The files won't be seekable, but you can remux: ffmpeg -i in.mp4 -c copy out.mp4

Gyan
  • 85,394
  • 9
  • 169
  • 201