• Stars
    star
    259
  • Rank 157,669 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BigBlueButton recorder using puppeteer to export as webm or mp4 file & Live RTMP broadcasting

bbb-recorder

Bigbluebutton recordings export to webm or mp4 & live broadcasting. This is an example how I have implemented BBB recordings to distibutable file.

  1. Videos will be copy to /var/www/bigbluebutton-default/record. You can change value of copyToPath from .env.
  2. Can be converted to mp4. Default webm
  3. Specify bitrate to control quality of the exported video by adjusting videoBitsPerSecond property in background.js

Dependencies

  1. xvfb (apt install xvfb)
  2. Google Chrome stable
  3. npm modules listed in package.json
  4. Everything inside dependencies_check.sh (run ./dependencies_check.sh to 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)

sudo add-apt-repository ppa:jonathonf/ffmpeg-4
sudo apt-get update
sudo apt-get install ffmpeg

Usage

Clone the project first:

git clone https://github.com/jibon57/bbb-recorder
cd bbb-recorder
npm install --ignore-scripts
cp .env.example .env

Usage via container

Build the container once.

git clone https://github.com/jibon57/bbb-recorder
cd bbb-recorder
docker build -t bbb-recorder .

Then prefix the docker run command before the following examples.

docker run --detach -v ~/local-output-dir:/output bbb-recorder

In this case we specify --detach which means the container will run in background until it finishes.

For the recording export example this would be:

docker run --detach -v ~/local-output-dir:/output bbb-recorder node export.js "https://BBB_HOST/playback/presentation/2.0/playback.html?meetingId=MEETING_ID" meeting.webm 10 true

You can simplify this task with an alias:

alias bbb='docker run --detach -v ~/local-output-dir:/output bbb-recorder node export.js'
bbb "https://BBB_HOST/playback/presentation/2.0/playback.html?meetingId=MEETING_ID" meeting.webm 10 true

Recording export

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 .webm at end). You can use "MEETING_ID" (without .webm) to set the meeting ID as export name. Default: MEETING_ID
  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

Live recording

You can also use liveJoin.js to 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 0 mean 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

Live RTMP broadcasting

Sometime you may want to broadcast meeting via RTMP. To test you can use ffmpegServer.js to run websocket server & liveRTMP.js to join the meeting. You'll have to edit rtmpUrl & ffmpegServer info inside .env file (if need).

  1. First run websocket server by node ffmpegServer.js
  2. 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, ffmpeg should 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

How it will work?

When you will run the command that time Chrome browser 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.

Looking for Bigbluebutton shared hosting?

We are offering cheaper Bigbluebutton Premium hosting or Bigbluebutton installation/configuration/loadbalance service. You can send me email jibon[@]mynaparrot.com

Thanks to

puppetcam. Most of the parts were copied from there.

Canvas-Streaming-Example

More Repositories

1

nativescript-mediafilepicker

A complete file picker solution for NativeScript
Java
51
star
2

Joomla_API

Joomla API for mobile apps (Android, iPhone/iPad & External site)
PHP
25
star
3

nativescript-braintree

Braintree Payments (Drop-in) plugin for NativeScript
TypeScript
9
star
4

nativescript-payment-alipay-wechat

An example of wechat & alipay payment using H5 feature for NativeScript
PHP
6
star
5

BigBlueButton_for_Joomla

BigBlueButton conference software integration to Joomla website.
PHP
5
star
6

livekit-recorder-example

This is very simple & experimental example of livekit recorder using node.js
TypeScript
4
star
7

nativescript-wechat-login

Wechat login plugin for NativeScript
Objective-C
3
star
8

Education_Board_Result_BD

Show Education Board Result in your php site ;)
PHP
3
star
9

nativescript-crossplatform-aes

Simple Cross platform 256bit AES encryption / decryption for NativeScript. Encryption/decryption messages between NativeScript & NodeJS.
Objective-C
2
star
10

nativescript-simple-libsodium

Libsodium implementation for NativeScript
C
2
star
11

nativescript-baidu-push-notifications

Baidu push notifications plugin for NativeScript
Objective-C
2
star
12

DSE_Joomla

PHP
1
star
13

com_shadowsocks

Joomla component for managing shadowsocks using shadowsocks-restful-api
PHP
1
star
14

secure-file-download-server

jwt token based simple & secure file download server in Go
Go
1
star
15

Hoicoi_Radio

PHP
1
star
16

nativescript-azure-cognitiveservices

Azure cognitive services implementation for NativeScript.
TypeScript
1
star
17

Hoicoi-Digital

Sell downloadable products for Virtuemart
PHP
1
star