lys
lys

Reputation: 107

Video Capture, FFmpeg

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?

Upvotes: 0

Views: 256

Answers (1)

Gyan
Gyan

Reputation: 93329

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

Upvotes: 2

Related Questions