fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.84k stars 875 forks source link

Running multiple instances of fluent-ffmpeg to download multiple m3u8 streams causes it to stop downloading #1109

Open firsttobebear opened 3 years ago

firsttobebear commented 3 years ago

fluent-ffmpeg version: 2.1.2 ffmpeg version: N-100625-gf6477ac9f4 OS: Windows 10

I want to download multiple m3u8 streams and it works fine until I have it do some cpu tasks while it is downloading where all the ffmpeg instances suddenly stop downloading and does not give any error, or end event. Even without running cpu tasks it sometimes randomly stops a certain ffmpeg process. I've been trying to debug this for a while but it doesn't omit any events.

This is my current code:

new ffmpeg(Link)
  .seekInput(StartTime)
  .setDuration(IndividualThreadTime)
  .videoCodec("copy")
  .audioCodec("copy")
  .output("./Temp/Vod-Snippets/Snippet" + ThreadNumber + ".mp4")

  .on("end", function() {
      console.log("Finished vod " + ThreadNumber)
  })

  .on('error', function(err) {
      console.log('An error occurred on vod', ThreadNumber + ": ", err.message);
  })

  .run()
LKNSI commented 3 years ago

Seeing this issue too - and with just one FFMPEG instance on my end. Running the command directly on CLI produces expected behavior.

ffmpeg -i <stream.m3u8> -c copy -bsf:a aac_adtstoasc "output.mp4"

Feels like it just stops following and/or requesting .ts segments after maybe a few seconds.