簡體   English   中英

使用nodejs fluent-ffmpeg流式傳輸到icecast服務器

[英]Using nodejs fluent-ffmpeg to stream to icecast server

我正在嘗試進行api調用以表達將ffmpeg輸出流到icecast的哪些調用。

我可以使用child_process來做到這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');
  });

嘗試使用icy模塊在Node.js中使用Icecast


冰冷的模塊nodejs

自從我使用“ 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM