Home > Mobile >  How to stop ffmpeg live stream to youtube over cron?
How to stop ffmpeg live stream to youtube over cron?

Time:10-12

I want to stream a video to youtube,

But don't know what to do to stop that live stream, like I want to stop in case wrong video gets streamed.

Like if i do a python subprocess or via cron not attached to the output, How can I stop the streaming and probably kill ffmpeg.

CodePudding user response:

On Linux & macOS you can use:

kill $(pgrep ffmpeg)

Note that this will stop all ffmpeg instances. If you want to be more discriminate see ffmpeg How to end a specific process?, or look into creating a PID file for each process.

  • Related