I have a program written in Node.Js that uses the following FFmpeg command to capture videos:
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 design of the video to be interrupted at any time by means of a button. When finalized by the command:
taskkill /im ffmpeg.exe /t /f
The video is corrupted and can not be played.
Any way to end the process but preserve the recorded content?