m1k1o / go-transcode

On-demand transcoding origin server for live inputs and static files in Go using ffmpeg. Also with NVIDIA GPU hardware acceleration.
Apache License 2.0
212 stars 39 forks source link

HLS transcoding leaving defunct processes #2

Open m1k1o opened 2 years ago

m1k1o commented 2 years ago

After killing ffmpeg transcoding profile, defuct (zombie) processes can be seen.

This should be fixed by f004def49841e2d8b8381262b70a8b7c77cfce8e but it does not seem to be working correctly.

m1k1o commented 2 years ago

Could be fixed by waiting for child to finish .Wait(). From: https://stackoverflow.com/a/29552044/1113204

m1k1o commented 2 years ago

That actually didn't fix all cases. It still occurs on one of my servers. Maybe closing stdin could fix it.

m1k1o commented 1 year ago

If using sh -c and it calls multiple processes, they are never killed. Although this is not directly issue of this implementation, it does not allow calling mutliple processes and piping them, only one.