What is the correct way to pause/resume ffmpeg broadcast ?

I’m using ffmpeg to inject video to mediasoup. It’s working fine, now. But sometime, I need to restart the ffmpeg command. I tried these options

Option 1:

  1. Force kill ffmpeg command
  2. Start ffmpeg again
    ==> video freeze at consumer (browser)

Option 2 :

  1. Call producer.pause()
  2. Force kill ffmpeg command
  3. Start ffmpeg again
  4. Call producer.resume()
    ==> video still freeze at consumer (browser)

So, how to restart ffmpeg command in safe way ? Thank you

You’ll need to re-create producers and consumers. If you enable debug logs you’ll see a bunch of complains from mediasoup worker.