0

I'm trying to make an api call to express which calls ffmpeg outputing a stream to icecast.

I can do this with child_process, but have found fluent-ffmpeg for nodejs.

If I add

.save('icecast://source:hackme@localhost:8000/test')

I get an invalid argument error, and if I use

.output('icecast://source:hackme@localhost:8000/test')

I get no error, a correct response to the calling web page , but no ffmpeg process.

Does anyone know if fluent-ffmpeg outputs to icecast.

var ffmpeg = require('fluent-ffmpeg');
  app.get('/ffmpeg', function(req, res) {
    var ffmpegPath = '/usr/bin/ffmpeg';
    proc = new ffmpeg('/home/russ/radio_audio/fore/BaBeL74.wav')
      .output('icecast://source:hackme@localhost:8000/test');
    proc.setFfmpegPath(ffmpegPath);
    res.send('ok');
  });
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96
Russ_ell
  • 53
  • 1
  • 7

2 Answers2

0

Try icy module for using icecast in nodejs


icy module nodejs

iamwebkalakaar
  • 358
  • 1
  • 9
  • 1
    Thanks for the response , as far as i can workout this module accepts a stream and will stream to stdout / inject metadata. I need to encode and stream result to icecast, so not sure if it will help. – Russ_ell Jan 07 '19 at 13:30
0

long time since I worked with "fluent-ffmpeg", have you tried to use "writeToStream" function? Something like:

var ffmpeg = require('fluent-ffmpeg');
app.get('/ffmpeg', function(req, res) {
  var ffmpegPath = '/usr/bin/ffmpeg';
  new ffmpeg('/home/russ/radio_audio/fore/BaBeL74.wav')
   .writeToStream(res, function(retcode, error){
    console.log('file has been converted succesfully');
  });
});

Maybe this link can you https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/124

aquilesb
  • 2,182
  • 1
  • 19
  • 19
  • Thanks for the reply , and sorry for the delay in responding. I desided to go with a child_process bash script in the end as i have a complicated ffmpeg script which i would have to add options to fluent-ffmpeg for. – Russ_ell Jan 25 '19 at 12:25