Reputation: 123
I know there's a "stream targets" feature, but it allows me to configure Facebook target only for a particular FB user.
What I want is:
Is this possible at all?
Upvotes: 1
Views: 1993
Reputation: 501
At this time is it not possible to create Facebook Live stream targets using the REST API or with a Client-Side Application ... read more
There a solution to transcode live/video (HLS/MP4) stream to RTMP (Facebook) using ffmpeg .
Transcode HLS To RTMP (Facebook live)
ffmpeg -re -i "http://domain/x/x/input.m3u8" -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 426x240 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/111111111111111?ds=1&a=XXXXXXXXXXXXXXXXX"
Transcode MP4 To RTMP (Facebook live)
ffmpeg -re -i ./video.mp4 -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 426x240 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/111111111111111?ds=1&a=XXXXXXXXXXXXXXXXX"
Facebook video format Video Format:
Audio Format:
Create Facebook live "Go Live Dialog"
call the following code to initialize a pop-up window with control that determine where to direct your POST request.
<script>
document.getElementById('liveButton').onclick = function() {
FB.ui({
display: 'popup',
method: 'live_broadcast',
phase: 'create',
}, function(response) {
if (!response.id) {
alert('dialog canceled');
return;
}
//rtmp://rtmp-api.facebook.com:80/rtmp/111111111111111?ds=1&a=XXXXXXXXXXXXXXXXX
alert('stream url:' + response.stream_url);
FB.ui({
display: 'popup',
method: 'live_broadcast',
phase: 'publish',
broadcast_data: response,
}, function(response) {
alert("video status: \n" + response.status);
});
});
};
</script>
Upvotes: 2