codealchemist / youtube-audio-server

Easily stream and download audio from YouTube.
74 stars 32 forks source link

Spawn too many ffmpeg process in background #11

Open edwinharly opened 6 years ago

edwinharly commented 6 years ago

It seems like every time it spawned a process for stream, the process didn't get killed, so the process are stacking so many in the background

codealchemist commented 5 years ago

I was able to reproduce. Thanks for reporting this!

codealchemist commented 5 years ago

Hey @edwinharly, I just added a fix to kill ffmpeg when processing is done. Also added new endpoints that should help avoid some scenarios where more instances where started (like directly hitting an audio URL from Chrome).

Still, there are cases where ffmpeg is going zombie: Just tried with VLC, which doesn't request the whole file at once, but instead keeps the stream open and requests chunks at regular intervals. After killing VLC the ffmpeg process wasn't properly killed. Will need to investigate this further.

Please, let me know if v2.3.0 is working better for you. Thanks!

edwinharly commented 5 years ago

Glad to hear it, I'll test it if I've got the chance to and let you know after that

DavidBerdik commented 2 years ago

Out of curiosity, how does the server handle livestreams? If I start streaming one, and then close it, will the ffmpeg instance supporting it be killed too, or will it continue running?