我正在尝试进行一个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');
});发布于 2019-01-07 21:10:46
在nodejs中尝试使用icecast的icy模块
发布于 2019-01-08 13:16:46
自从我使用"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
https://stackoverflow.com/questions/54074445
复制相似问题