Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill process avoid to set correctly the mime headers #383

Open
manuelcanepa opened this issue May 15, 2023 · 3 comments
Open

Kill process avoid to set correctly the mime headers #383

manuelcanepa opened this issue May 15, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@manuelcanepa
Copy link

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 an application/octet-stream type instead of video/mp4:

$ file --mime-type -b 00.34.11.mp4
$ application/octet-stream

https://github.com/boonya/rtsp-video-recorder/blob/acc2eebe591796e4676e2cde6747b572a433c15e/src/recorder.ts#LL154C23-L154C23

@manuelcanepa
Copy link
Author

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");

@boonya
Copy link
Owner

boonya commented May 18, 2023

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.

@boonya boonya self-assigned this May 18, 2023
@boonya boonya added the bug Something isn't working label May 18, 2023
@boonya boonya pinned this issue May 18, 2023
@boonya boonya unpinned this issue May 18, 2023
@boonya
Copy link
Owner

boonya commented May 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants