Reputation: 53
I've been fiddling with a gstreamer script to send a rtmp-stream to Facebook Live. I tried a lot of things. The stream works when I send it to my own RTMP-server, but Facebook just won't accept it.
I'm working on a Ubuntu 15.10. I did notice OBS has strange behaviour as well. On a MBP it seems to work, but on my box it won't.
The stream below fits the video/audio-specs mentioned in the Facebook Live. I've listed them here:
Video Format:
- We accept video in maximum 720p (720 x 1280) resolution, at 30 frames per second. (or 1 key frame every 2 seconds). CHECK
- You must send an I-frame (keyframe) at least once every two seconds throughout the stream. CHECK
- Recommended max bit rate is 2500Kbps. CHECK
- Titles must be less than 255 characters otherwise the stream will fail CHECK
- The Live API accepts H264 encoded video and AAC encoded audio only CHECK
Video Length:
90 minutes maximum length for live stream. CHECK (not specified, so I assume it should be fine)
60 minute maximum length for preview streams (either through Live dialog or publisher tools). After 60 minutes, a new stream key must be generated. CHECK (not specified, so I assume it should be fine)
Advanced Settings:
Gstreamer command:
gst-launch-1.0 v4l2src ! "video/x-raw,width=1280,height=720,framerate=30/1" ! x264enc bitrate=2500 key-int-max=10 ! video/x-h264,profile=high ! h264parse ! queue ! flvmux name=mux alsasrc device=hw:1 ! audioresample ! audio/x-raw,rate=44100 ! queue ! voaacenc bitrate=128000 ! queue ! mux. mux. ! rtmpsink location=\"rtmp://rtmp-api.facebook.com:80/rtmp/xxxxxxxxxxxxxxx?ds=1\&a=xxxxxxxxxxxxxxx\"
Did anyone get gstreamer to work for Facebook Live?
Upvotes: 4
Views: 2232
Reputation: 46
Change:
video/x-h264,profile=high
to:
video/x-h264,profile=baseline
And it works. I tried with:
gst-launch-1.0 flvmux name=mux streamable=true ! rtmpsink location="<rtmp_url_for_fblive>" videotestsrc is-live=true ! "video/x-raw,width=1280,height=720,framerate=30/1" ! identity sync=true ! x264enc bitrate=2500 key-int-max=60 ! video/x-h264,profile=high ! h264parse ! queue ! mux. audiotestsrc is-live=true ! audio/x-raw,rate=44100,channels=2 ! identity sync=true ! voaacenc bitrate=128000 ! queue ! mux.
Upvotes: 0