2016-06-25 15 views
4

FacebookのドキュメントとしてObject Live Videoを作成しました。ライブビデオFacebook API(FFMPEG nodejs)

"stream_url": "rtmp://rtmp-api.facebook.com:80/rtmp/641310872699778?ds=1&a=AaYx3JYoFLTXAvBK

私はストリームのためhttps://github.com/fluent-ffmpeg/node-fluent-ffmpegを使用しますが、私は失敗した

誰もがビデオファイル(例:MP4)をストリーミングするためのソリューションを持っています。ビデオFacebookのAPIをObjectに

var ffmpeg = require('fluent-ffmpeg'), 
    fs = require('fs'); 

    // open input stream 
var infs = fs.createReadStream(__dirname + '/2.mp4'); 

infs.on('error', function(err) { 
    console.log(err); 
}); 
var publish = "rtmp://rtmp-api.facebook.com:80/rtmp/641310872699778?ds=1&a=AaYx3JYoFLTXAvBK"; 
// make sure you set the correct path to your video file 
var proc = ffmpeg(infs) 

    .format('mp4') 
    .size('320x?') 
    .videoBitrate('512k') 
    .videoCodec('libx264') 
    .fps(24) 
    .audioBitrate('96k') 
    .audioCodec('aac') 
    .audioFrequency(22050) 
    .audioChannels(2) 
    // setup event handlers 
    .on('end', function() { 
    console.log('file has been converted succesfully'); 
    }) 
    .on('error', function(err) { 
    console.log('an error happened: ' + err.message); 
    }) 
    // save to stream 
    .save(publish); //end = true, close output stream after writing 

an error happened: ffmpeg exited with code 1: rtmp://rtmp-api.facebook.com:80/rtmp/641310872699778?ds=1&a=AaYx3JYoFLTXAvBK: Operation not permitted

+1

同じ問題がありますが、未加工のffmpegを使用すると、その間に解決策が見つかりました。 Facebook OpenGraph APIを使用すると、認証に問題があることが判明しました – Mitro

+0

var内で一重引用符を使用しようとすると、すべてのrtmp url内で公開されます。http://stream-recorder.com/forum/ffmpeg-live-facebook- t21044.html?s = 303eefb03fa1a7be191863303d585acd & – Mitro

答えて

-1

引用入力を試しましたか?

publish = "\"rtmp://... live=1 app=...\""; 
関連する問題