使用 nodejs fluent-ffmpeg 流式传输到 icecast 服务器



我正在尝试进行 api 调用来表达哪个调用 ffmpeg 输出流到 icecast。

我可以用 child_process 做到这一点,但已经找到了 nodejs 的fluent-ffmpeg

如果我添加

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

我收到一个无效的参数错误,如果我使用

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

我没有收到错误,对调用网页的正确响应,但没有ffmpeg过程。

有谁知道fluent-ffmpeg输出是否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');
  });
尝试在

nodejs中使用icecast的冰模块


冰冷模块节点

自从我使用"fluent-ffmpeg"以来已经很久了,您是否尝试过使用"writeToStream"功能?像这样:

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');
  });
});

也许这个链接可以 https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/124

最新更新