BigBlueButton recorder using puppeteer to export as webm or mp4 file & Live RTMP broadcasting
Bigbluebutton recordings export to
webmor
mp4& live broadcasting. This is an example how I have implemented BBB recordings to distibutable file.
/var/www/bigbluebutton-default/record. You can change value of
copyToPathfrom
.env.
mp4. Default
webm
videoBitsPerSecondproperty in
background.js
apt install xvfb)
dependencies_check.sh(run
./dependencies_check.shto install all)
The latest Google Chrome stable build should be use.
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list apt-get -y update apt-get -y install google-chrome-stable
FFmpeg (if not installed already & have plan for mp4 or RTMP)
sh sudo add-apt-repository ppa:jonathonf/ffmpeg-4 sudo apt-get update sudo apt-get install ffmpeg
Clone the project first:
git clone https://github.com/jibon57/bbb-recorder cd bbb-recorder npm install --ignore-scripts cp .env.example .env
node export.js "https://BBB_HOST/playback/presentation/2.0/playback.html?meetingId=MEETING_ID" meeting.webm 10 true
Options
You can pass 4 args
1) BBB recording link (mandatory) 2) (Optional) Export file name (should be
.webmat end). You can use "MEETINGID" (without
.webm) to set the meeting ID as export name. Default: MEETINGID 3) (Optional) Duration of recording (in seconds). You can set it to 0 use the real duration of recording. Default: real duration of recording 4) (Optional) Convert to mp4 or not (true for convert to mp4). Default: false
You can also use
liveJoin.jsto live join meeting as a recorder & perform recording like this:
node liveJoin.js "https://BBB_HOST/bigbluebutton/api/join?meetingId=MEETING_ID...." liveRecord.webm 0 true
Here
0mean no limit. Recording will auto stop after meeting end or kickout of recorder user. You can also set time limit like this:
node liveJoin.js "https://BBB_HOST/bigbluebutton/api/join?meetingId=MEETING_ID...." liveRecord.webm 60 true
Sometime you may want to broadcast meeting via RTMP. To test you can use
ffmpegServer.jsto run websocket server &
liveRTMP.jsto join the meeting. You'll have to edit
rtmpUrl&
ffmpegServerinfo inside
.envfile (if need).
1) First run websocket server by
node ffmpegServer.js2) Then in another terminal tab
node liveRTMP.js "https://BBB_HOST/bigbluebutton/api/join?meetingId=MEETING_ID...."
You can also set duration otherwise it will close after meeting end or kickout:
node liveRTMP.js "https://BBB_HOST/bigbluebutton/api/join?meetingId=MEETING_ID...." 20
Check the process of websocket server,
ffmpegshould start sending data to RTMP server.
Alternatively, you can stream via a docker container:
# copy compose file, update the environment params and the meeting join url cp docker-compose.yml.livertmp-stream-example docker-compose.yml docker-compose build docker-compose up
When you will run the command that time
Chromebrowser will be open in background & visit the link to perform screen recording. So, if you have set 10 seconds then it will record 10 seconds only. Later it will give you file as webm or mp4.
Note: It will use extra CPU to process chrome & ffmpeg.
We are offering cheaper Bigbluebutton Premium hosting or Bigbluebutton installation/configuration/loadbalance service. You can send me email jibon[@]mynaparrot.com
puppetcam. Most of the parts were copied from there.