0

So I was trying to pipe the video from fluent-ffmpeg to response(client-side) without saving it as a file. Here is my code:

        .seekInput(06)
        .setDuration(5)
        .on('end', function(err, data) {
            if (!err) {
                console.log('conversion Done');
               
            }
        })
        .on('error', function(err) {
            console.log('wahala' + err);
        })
        .pipe(res, { end: true })```

I get this error:

Error: ffmpeg exited with code 1: pipe:1: Invalid argument
  • You will probably need to use a temporary file. – AKX Jan 20 '22 at 15:27
  • Try specifying the video format, as explained [here](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/337#issuecomment-62901962). – TGrif Jan 20 '22 at 15:36
  • @AKX, it works well with using a temporary file. IN a bit to shorten the time to send the file is why I am trying out this methodology. – Oluwatomisin Adeyinka Jan 21 '22 at 11:55
  • 1
    @OluwatomisinAdeyinka You would need to ensure that the target file format is one that can be written as a stream without seeking. MP4 is not one of those formats (at least not by default), see https://stackoverflow.com/questions/25411836/ffmpeg-doesnt-work-with-mp4-and-stdout – AKX Jan 21 '22 at 12:02

0 Answers0