Open manuelcanepa opened 1 year ago
Maybe a fix will be replace the kill with a stdin.write("q\n") and wait to the process to close itself:
- this.process.kill();
+ this.process.stdin.write("q\n");
Cool. Thank you for your input here. I will take a look as soon as possible and let you know. I hope I will have a time this weekend.
I quickly investigated the issue and can say that the root cause of wrong mime tipe is not that you've mentioned.
I have ran ffmpeg
process directly and killed it by ctrl+c
for the first time. And soft quit from it for the second.
The result is below:
➜ file --mime-type -b Balkon-2023.05.19/15.09.15.mp4
application/octet-stream
➜ file --mime-type -b Balkon-2023.05.19/15.10.08.mp4
application/octet-stream
I am going to continue work on that issue as soon as I have time.
After a few tries, i learn that the command ffmpg will stay alive saving the video file, if you kill the process, the video will be partially correct if you check the mime type with
file
you will get anapplication/octet-stream
type instead ofvideo/mp4
:https://github.com/boonya/rtsp-video-recorder/blob/acc2eebe591796e4676e2cde6747b572a433c15e/src/recorder.ts#LL154C23-L154C23