GithubHelp home page GithubHelp logo

jibon57 / bbb-recorder Goto Github PK

View Code? Open in Web Editor NEW
258.0 27.0 133.0 103 KB

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

License: MIT License

JavaScript 89.61% Shell 8.34% Dockerfile 2.05%
bigbluebutton-plugin bigbluebutton-recorder bigbluebutton-record-export bbb-recorder bigbluebutton-rtmp

bbb-recorder's Introduction

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

bbb-recorder's People

Contributors

amirhoseinsalimi avatar bkmgit avatar edjopato avatar ewanyonyi avatar hipoloco avatar jibon57 avatar millad90s avatar tdebatty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bbb-recorder's Issues

TimeoutError: waiting for selector "button[aria-label="Leave audio"]"

I am trying to use livejoin to record the meeting.
It always give me this error
TimeoutError: waiting for selector "button[aria-label="Leave audio"]" failed: timeout 30000ms exceeded
at new WaitTask (/home/naman/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:549:28)
at DOMWorld._waitForSelectorOrXPath (/home/naman/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:478:22)
at DOMWorld.waitForSelector (/home/naman/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:432:17)
at Frame.waitForSelector (/home/naman/bbb-recorder/node_modules/puppeteer/lib/FrameManager.js:627:47)
at Frame. (/home/naman/bbb-recorder/node_modules/puppeteer/lib/helper.js:112:23)
at Page.waitForSelector (/home/naman/bbb-recorder/node_modules/puppeteer/lib/Page.js:1122:29)
at main (/home/naman/bbb-recorder/liveJoin.js:78:20)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: 'TimeoutError'
}

I tried adjusting the timeout but doesn't seems to work
Any Ideas?

Content of the webm recording

Hello, I would love to try this tool but in the exported webm, would it also capture the chat, presentation, screen sharing etc other than the video itself ? I am hoping that is the case but wanted to double check.

TimeoutError: waiting for selector "[aria-label="Listen only"]"

Hello i am trying to use the livejoin function, it load some page logs and then i get this error

{ TimeoutError: waiting for selector "[aria-label="Listen only"]" failed: timeou t 30000ms exceeded
at new WaitTask (/home/thomas/bbb-recorder/node_modules/puppeteer/lib/DOMWor ld.js:549:28)
at DOMWorld._waitForSelectorOrXPath (/home/thomas/bbb-recorder/node_modules/ puppeteer/lib/DOMWorld.js:478:22)
at DOMWorld.waitForSelector (/home/thomas/bbb-recorder/node_modules/puppetee r/lib/DOMWorld.js:432:17)
at Frame.waitForSelector (/home/thomas/bbb-recorder/node_modules/puppeteer/l ib/FrameManager.js:627:47)
at Frame. (/home/thomas/bbb-recorder/node_modules/puppeteer/lib/h elper.js:112:23)
at Page.waitForSelector (/home/thomas/bbb-recorder/node_modules/puppeteer/li b/Page.js:1122:29)
at main (/home/thomas/bbb-recorder/liveJoin.js:66:20)
at process._tickCallback (internal/process/next_tick.js:68:7) name: 'Timeout Error' }

My bbb server is HTML5 and using the greenlight 2.5.

Any ideas?

Can't use live recording (liveJoin.js) if the room created via Greenlight.

I can't use joining via this link, where uses meetingId parameter. I have ID provided by Greenlight, such as "abc-12d-3ef".
So it's impossible to use this link in my case.
node liveJoin.js "https://BBB_HOST/bigbluebutton/api/join?meetingId=MEETING_ID...." liveRecord.webm 0 true
Please instruct me a little.
Can I do something another here?

Ejecute node from php Shell_exec

Hello, nice to meet you, I'm glad you have this solution for the recording of bbb, I have several ideas in my project, but I'm just really stuck with a problem that has been in it for hours.
I can't execute the comment from php shell_exec, my idea is to execute
$ dir = "/ var / www / symphony / bbbr / bbb-recorder";
chdir ($ dir);
$ result = shell_exec ('node export.js "https://mydomain.cl/playback/presentation/2.0/playback.html?meetingId=26fe41aafaa52ae721916d0f9d3ee6e0e86db3ba-1589397338630" meet.webm 10 true> / dev / null> dev / null ');
echo "

";
echo $ result;
echo "
";

But it hangs, and on the server, it is run by www-data but the chrome process stays running without doing anything.

but if i run the same code from command shell, everything works fine.
I have tried in many ways, thinking it was the permissions, but it is not.
Something happens that when running from the web, the process hangs.
I have realized that if I do an example:
logged in as root user:
sudo -u www-data node export.js "http://maidomain.com......" 10 true
also hangs.
and so with any user.
I would appreciate your help

Error: throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');

internal/util.js:214
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at promisify (internal/util.js:214:11)
at Object. (/home/bbb/bbb-recorder/node_modules/extract-zip/index.js:11:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/home/bbb/bbb-recorder/node_modules/puppeteer/lib/cjs/node/BrowserFetcher.js:48:39)

TimeoutError: waiting for selector

I launched the "Start Record" button of the webinar and then entered in the terminal

node liveJoin.js "http://192.168.1.100/bigbluebutton/api/join?meetingId=random-8051339" liveRecord.webm 0 true

Got an error

{TimeoutError: waiting for selector "[aria-label =" Listen only "]" failed: timeout 30000ms exceeded

Increasing recording resolution

Hello!

Thank you very much for this project. I would like to export 1080p recordings of the BigBlueButton recordings. I've changed the xvfb settings in export.js to a screen of size 1920x1200x24, as well as the resolution of the Chrome window, but ffmpeg still reports the outputted video is 720p. Any ideas where else I have to change the resolution (if at all possible)?

Thanks in advance!

TimeoutError: waiting for selector "[aria-label="Listen only"]" failed: timeout 60000ms exceeded

Good day!
I have error, when i try to use live broadcast function.
BigBlueButton and bbb-recorder are on the same local server.

In one window of the terminal, I run the command
node ffmpegServer.js

In second terminal screen i enter this command:
node liveRTMP.js "https://domain.online/bigbluebutton/api/join?meetingId=adm-96w-m2a

and after some seconds i see this error

PAGE LOG: FFMPEG_SERVER
{ TimeoutError: waiting for selector "[aria-label="Listen only"]" failed: timeout 60000ms exceeded
    at new WaitTask (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:549:28)
    at DOMWorld._waitForSelectorOrXPath (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:478:22)
    at DOMWorld.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:432:17)
    at Frame.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/FrameManager.js:627:47)
    at Frame.<anonymous> (/root/bbb-recorder/node_modules/puppeteer/lib/helper.js:112:23)
    at Page.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/Page.js:1122:29)
    at main (/root/bbb-recorder/liveRTMP.js:73:14)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7) name: 'TimeoutError' }

Can you help me, please?

Errors while running the service

Hi,

Followed the document and deployed accordingly in the same server where BBB is installed. however when i start "node ffmpegServer.js", iam getting the following error:
root@ns107515:/bbb-recorder# node ffmpegServer.js
Listening...
connection
FFmpeg STDERR: ffmpeg version 4.2.2-1ubuntu1
16.04.york0 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu116.04.12) 20160609
configuration: --prefix=/usr --extra-version='1ubuntu1
16.04.york0' --toolchai n=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux -gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable -filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-liba om --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable -libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-li bfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack - -enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt - -enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enab le-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libss h --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-l ibxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-o mx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1 394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --e nable-frei0r --enable-libx264 --enable-shared

FFmpeg STDERR: libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100

However when i checked ./dependencies_check.sh it doesnt returns anything which indicates it has all the necessary required files.

In the other tab, i directly executed Live stream command only but it returned the same error. The BBB setup i have is the standard out of the box setup without any changes.
node liveRTMP.js "https://test.testdomain.com/bigbluebutton/api/join?meetingId=abc-zgm-cqh"
PAGE LOG: FFMPEG_SERVER
{ TimeoutError: waiting for selector "[aria-label="Listen only"]" failed: timeout 30000ms exceeded
at new WaitTask (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:549:28)
at DOMWorld._waitForSelectorOrXPath (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:478:22)
at DOMWorld.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:432:17)
at Frame.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/FrameManager.js:627:47)
at Frame. (/root/bbb-recorder/node_modules/puppeteer/lib/helper.js:112:23)
at Page.waitForSelector (/root/bbb-recorder/node_modules/puppeteer/lib/Page.js:1122:29)
at main (/root/bbb-recorder/liveRTMP.js:72:20)
at
at process._tickCallback (internal/process/next_tick.js:189:7) name: 'TimeoutError' }

Can you please help to get this resolved. Would like to stream to youtube with the limitations accepted as mentioned in your readme for this tool.

Thank you,
KiranKumar.

Windows / MAC-OS version

what will happen to lines with xvfb on a MAC-OS or Windows system?
Does this code, especially export.js works with minimal modification?

bbb-recorder install errors

Hi,
Thank you for this scrip.
I tried testing it, but got stuck in installation. Could be completely due to my ignorance.

koenr@koenr-Latitude-5580:~/bbb-recorder$ npm install
loadDep:ws → resolveWithN ▐ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=8.16.0"} (current: {"node":"8.10

[email protected] install /home/koenr/bbb-recorder/node_modules/sleep
node-gyp rebuild

make: Map '/home/koenr/bbb-recorder/node_modules/sleep/build' wordt binnengegaan
CXX(target) Release/obj.target/node_sleep/module_init.o
CXX(target) Release/obj.target/node_sleep/sleep_cpp11.o
CXX(target) Release/obj.target/node_sleep/sleep_posix.o
CXX(target) Release/obj.target/node_sleep/sleep_win.o
SOLINK_MODULE(target) Release/obj.target/node_sleep.node
COPY Release/node_sleep.node
make: Map '/home/koenr/bbb-recorder/node_modules/sleep/build' wordt verlaten

[email protected] install /home/koenr/bbb-recorder/node_modules/puppeteer
node install.js

[email protected] /home/koenr/bbb-recorder
├── UNMET PEER DEPENDENCY bufferutil@^4.0.1
├─┬ [email protected]
│ ├── @types/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├── UNMET PEER DEPENDENCY utf-8-validate@^5.0.2
├── [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]

npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

When running it, I get the following error message:
Error: Could not start Xvfb.
at Xvfb.startSync (/home/koenr/bbb-recorder/node_modules/xvfb/index.js:84:17)
at main (/home/koenr/bbb-recorder/export.js:41:18)
at Object. (/home/koenr/bbb-recorder/export.js:106:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)

Running it on Ubuntu 18.04

page.waitForSelector('html.downloadComplete') does not end.

Is anyone else having the same problem? If I leave it on timeout: 0, it waits endlessly. I'm doing the tests with a 10-second recording, I don't believe it's internet speed.

await page.waitForSelector('html.downloadComplete', {timeout: 0})

I tested with a timeout (120000ms) with try / catch, returns the TimeoutError and ends.

error { TimeoutError: waiting for selector "html.downloadComplete" failed: timeout 120000ms exceeded
    at new WaitTask (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/DOMWorld.js:549:28)
    at DOMWorld._waitForSelectorOrXPath (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/DOMWorld.js:478:22)
    at DOMWorld.waitForSelector (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/DOMWorld.js:432:17)
    at Frame.waitForSelector (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/FrameManager.js:627:47)
    at Frame.<anonymous> (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/helper.js:112:23)
    at Page.waitForSelector (/home/hb/projetos/bbb-downloader/node_modules/puppeteer/lib/Page.js:1122:29)
    at exports.startRecording (/home/hb/projetos/bbb-downloader/src/app/lib/bbb-recorder/recorder.js:139:18)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'TimeoutError' }

Is it possible for bbb-recorder to work with a Zoom URL of a meeting/webinar?

My goal is to broadcast from Zoom to Facebook live using ffmpeg.

I'm thinking of running a Zoom webapp (nodejs) using the Zoom Web SDK so I can join a meeting without reCAPTCHA and somehow auto-filling out meeting details such as Meeting ID, etc... and using Puppeteer to make a few clicks like pressing "Join" and "Join Audio by Computer" buttons.

Could this be possible?

length recording

Can i record a playback for all of his length without specify seconds?
Thanks

using bbb-recorder in another server - PHP scripts

Hi Jibon,

thanks for your solution. This is what we were looking for!

we want to setup a separate box to process videos using the BBB hook.
we will:

  1. setup the hook to our bbb-recorder box
  2. get the duration of the video using getRecordings API.
  3. convert to mp4
  4. we will use meetingid as name.
  5. we will leave file in S3.

do you have the PHP scripts or in any other language that you might setup so we can based on that?

then we can share our solution.

thanks!

SyntaxError: Unexpected token function after update

Hello,
we get the following error after updating our os packages:

/root/bbb-recorder/export.js:40
async function main() {
      ^^^^^^^^

SyntaxError: Unexpected token function
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
ii  node-npmlog                           0.0.4-1                                         all          Logger with custom levels and colored output for Node.js
ii  node-read-package-json                1.2.4-1                                         all          Read package.json for npm module for Node.js
ii  npm                                   3.5.2-0ubuntu4                                  all          package manager for Node.js

I thinks it's a issue with the npm version?
How should the export.js be updated?

All best

NOT ISSUE: Hide/Resize presentation during recording

Dear developer,
Thanks so much for this useful tool!

Was anyone able to hide or resize presentation during recording?!
Can we do it either with bbb-recorder configuration or with BigBlueButton configurations?!

Thanks in advance..

This is not issue :)

Hi Jibon,
This is great project.
Thanks to this project, we have implemented our BBB dashboard downloading MP4 future.

Thanks again.

WhatsApp Image 2020-04-22 at 11 13 06 PM
WhatsApp Image 2020-04-22 at 11 13 07 PM
WhatsApp Image 2020-04-22 at 11 13 07 PM (1)

got error while doing live rtmp

when i run live rtmp node command the a new user join the meeting but nothing happens on the youtube stream server i also updated the config file still just user comes but there is no data going to youtube stream

catch an error

script does not work for me, all dependencies installed. Chrome browser installed latest version

/var/www/bigbluebutton-default/record/0a1e360bc6f84d1711684c71b076d34f0ea948f5-1592491248546.mp4 does not exist, running MP4 conversion job
internal/util.js:214
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at promisify (internal/util.js:214:11)
at Object. (/usr/local/bbb-recorder/node_modules/extract-zip/index.js:11:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/bbb-recorder/node_modules/puppeteer/lib/cjs/node/BrowserFetcher.js:48:39)

using external server

hello everyone,
first off a very big thank you for developing a much needed solution
please sir can you explain how i can set up a secondary server just to process and store the recording i am using php how can i make this process easy or automated and then retrieve the recording or multiple recordings with meeting id
thanks in advanced

Recording export not working:

Hello Jibon,

Hope you're doing well and thanks for this great project. I am interested in implementing the bbb-recoder but I am facing an issue when I try to import a recording.

Here's the error it produces:

node export.js "https://vc.example.so/playback/presentation/2.0/playback.html?meetingId=6ef5b3b22bf34eb-1638" meeting.webm 0 true

internal/util.js:214
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at promisify (internal/util.js:214:11)
at Object. (/home/u1/bbb-recorder/node_modules/extract-zip/index.js:11:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/home/u1/bbb-recorder/node_modules/puppeteer/lib/cjs/node/BrowserFetcher.js:48:39)

I have installed all the dependencies, I would have appreciated if you can help me set up this.

Thanks,

Trouble with some recordings

HI there

Not sure is this is an issue or not with a few longer recordings 50 mins +
We keep getting logs underneath the REC Start not sure is this is stopping recording from happening.
image

Error when running script for recording export

After succesfull installation a tried to export recording to mp4 file using command

node export.js "https://bbbvoip.upvsp.cz/playback/presentation/2.0/playback.html?meetingId=d075cf94b0bd47cde1cb0c75d54edd97113339ad-1588181572758" meeting.webm 0 true

I checked and playback record in Moodle, everything works fine. When I tried to export meeting to mp4 but it failed with error:

PAGE LOG: ==Getting URL params
PAGE LOG: ==DOM content loaded
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Resizing components
PAGE LOG: ==Processing metadata.xml
PAGE LOG: Failed to load resource: the server responded with a status of 404 (Not Found)
PAGE LOG: Failed to load resource: the server responded with a status of 404 (Not Found)
PAGE LOG: Failed to load resource: the server responded with a status of 404 (Not Found)
PAGE LOG: ==Found video /presentation/d075cf94b0bd47cde1cb0c75d54edd97113339ad-1588181572758/video/webcams.webm
PAGE LOG: ==Loading playback
PAGE LOG: ==Hide playback content
PAGE LOG: ==Loaded logo from logo.png
PAGE LOG: ==Loading video
PAGE LOG: ==Loading acorn media player
PAGE LOG: ==Processing shapes.svg
PAGE LOG: ==Processing panzooms.xml
PAGE LOG: ==Processing cursor.xml
PAGE LOG: ==Processing deskshare.xml
PAGE LOG: ==Processing captions.json
PAGE LOG: ==Resizing components
PAGE LOG: ==Processing presentation_text.json
PAGE LOG: ==All medias can be played
PAGE LOG: ==Linking chat to media
PAGE LOG: ==Running popcorn
PAGE LOG: 'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.
PAGE LOG: ==Generating thumbnails
PAGE LOG: ==Setting title on thumbnails
PAGE LOG: ==Defining start time
PAGE LOG: ==Loading done
PAGE LOG: ==Show playback content
PAGE LOG: ==Resizing components
PAGE LOG: REC_START
/var/www/bigbluebutton-default/record/meeting.mp4
/root/Downloads/meeting.webm
converting using: ffmpeg -y -i '/root/Downloads/meeting.webm' -c:v libx264 -preset veryfast -movflags faststart -profile:v high -level 4.2 -max_muxing_queue_size 9999 -vf mpdecimate -vsync vfr '/var/www/bigbluebutton-default/record/meeting.mp4'
err:
Error: Command failed: ffmpeg -y -i '/root/Downloads/meeting.webm' -c:v libx264 -preset veryfast -movflags faststart -profile:v high -level 4.2 -max_muxing_queue_size 9999 -vf mpdecimate -vsync vfr '/var/www/bigbluebutton-default/record/meeting.mp4'
ffmpeg version 4.2.2-1bbb1ubuntu16.04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1
16.04.12) 20160609
configuration: --prefix=/usr --extra-version='1bbb1~ubuntu16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-librsvg --enable-librubberband --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libxml2 --enable-sdl2 --disable-decoders --enable-decoder='aac,ass,bmp,ffv1,ffvhuff,flac,flashsv,flashsv2,flv,gif,h264,huffyuv,librsvg,libspeex,mjpeg,mp3float,mpeg2video,opus,pcm_f32le,pcm_s16le,pcm_s16le_planar,png,rawvideo,srt,ssa,subrip,vorbis,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt' --disable-encoders --enable-encoder='aac,ass,bmp,ffv1,ffvhuff,flac,flashsv,flashsv2,flv,gif,h264_vaapi,huffyuv,libmp3lame,libopus,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,libx264,libx264rgb,mjpeg,mjpeg_vaapi,mpeg2_vaapi,mpeg2video,pcm_f32le,pcm_s16le,pcm_s16le_planar,png,rawvideo,srt,ssa,subrip,vp8_vaapi,vp9_vaapi,webvtt' --disable-hwaccels --enable-hwaccel='h264_vaapi,h264_vdpau,mjpeg_vaapi,mpeg2_vaapi,mpeg2_vdpau,vp8_vaapi,vp9_vaapi' --disable-parsers --enable-parser='aac,bmp,flac,gif,h264,mjpeg,mpegaudio,mpegvideo,opus,png,vorbis,vp8,vp9' --disable-demuxers --enable-demuxer='aac,alsa,ass,avi,bmp_pipe,caf,concat,dash,ffmetadata,flac,flv,gif,gif_pipe,h264,hls,image2,image2pipe,ivf,jpeg_pipe,kmsgrab,lavfi,matroska,mjpeg,mov,mp3,mpegts,mpegtsraw,nut,ogg,pcm_f32le,pcm_s16le,png_pipe,pulse,rawvideo,rtp,rtsp,srt,swf,w64,wav,webvtt,yuv4mpegpipe' --disable-muxers --enable-muxer='adts,ass,avi,caf,dash,ffmetadata,flac,flv,framecrc,framehash,framemd5,gif,h264,hash,hls,image2,image2pipe,ipod,ivf,matroska,matroska_audio,md5,mjpeg,mkvtimestamp_v2,mov,mp3,mp4,mpeg2video,mpegts,nut,oga,ogg,ogv,opus,pcm_f32le,pcm_s16le,rawvideo,rtp,rtp_mpegts,rtsp,segment,singlejpeg,srt,stream_segment,swf,tee,uncodedframecrc,w64,wav,webm,webm_chunk,webm_dash_manifest,webvtt,yuv4mpegpipe' --disable-protocols --enable-protocol='async,cache,concat,data,file,hls,http,httpproxy,https,icecast,md5,pipe,rtmp,rtmps,rtmpt,rtmpts,rtp,subfile,tcp,tee,tls,udp,unix' --disable-bsfs --enable-bsf='aac_adtstoasc,chomp,filter_units,h264_metadata,h264_mp4toannexb,h264_redundant_pps,mjpeg2jpeg,mpeg2_metadata,noise,null,vp9_metadata,vp9_raw_reorder,vp9_superframe,vp9_superframe_split' --disable-indevs --enable-indev='alsa,lavfi,v4l2,fbdev,xcbgrab,kmsgrab' --disable-outdevs --enable-outdev='alsa,sdl2,xv,fbdev,v4l2' --disable-libdc1394 --enable-libdrm --disable-libiec61883 --disable-chromaprint --disable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
/root/Downloads/meeting.webm: Invalid data found when processing input

Can yoy help me where is the problem ?

.env file support

Hello,

IMHO .env file is a nice thing to have for such a project. It provides:

  • Painless clustering for isolated environments e.g. Docker
  • In-place support on cloud platforms
  • More naturalness for other developers

Caveat? The config.json file would be deleted and modules requiring env. variables should import the variables, but we can export the whole env. variable as a single object to maximize the code re-use.

What does this need?

  • Delete config.json file
  • Setup .env variables (with a small .env.example)
  • Update README.md

I can work on this and send a PR if you're interested in the issue.

FFmpeg strange behaviour

Hello there!

First, i realli would like to thank you for this project.
I tried to use it to achieve an RTMP streaming for a conference.
I edited the .json file in order to set the righ rtmp url and my nginx rtmp server receive the stream from bbb-recorder.
Next, i did another thing: added a "-re" flag before "-i" on the ffmpeg arguments (this is important for ffmpeg if you want to stream live because it forces the encoding at 1x, for real time streaming).

Here is the strange:
Everytime i launch the recorder, it seems that it is capable to only create a frame recording, next ffmpeg receive the SIGINT (or similiar) command and so it stops and restart again.
The result is that ffmpeg is able to stream only one frame of the conference in an infinite restarting loop.

I joined to meeting using the API get provided from BBB (in which i had to add fullname, password meetingID and checksum), but it seems that bbb-recorder is able to only get a record of the first frame.

Can you help me with this?

Thank you!

Use metadata.xml or ffprobe to find duration

Hi, instead of setting manually the duration you could set in your script to search for video duration on metadata.xml, getting end time and subtract start time and then divide by 1000 for getting the seconds.

<start_time>1585088145458</start_time> <end_time>1585091756843</end_time>

or use the terminal command below:

ffprobe -i some_video -show_entries format=duration -v quiet -of csv="p=0"
if the meeting was recorded with a webcam.

Best regards.

Sometimes exported video contains only black screen or 1-2 seconds of the full video

First of all, Thanks for sharing the code with others.

I have tested the export.js. It works as expected but I faced some situations in which the exported video contained a black screen or only 1-2 sec of the full video whose length was 2-3 mins. Only after re-running the script, I got the expected result.

Do you have an idea of how can this problem be solved?

Thanks in advance.

Long recordings cannot be recorded

Hello,

we have a bbb recording with 7239 secounds.
We are always running into the same issue:
Error: Could not stop Xvfb. at Xvfb.stopSync (/root/bbb-recorder/node_modules/xvfb/index.js:129:17) at main (/root/bbb-recorder/export.js:95:18) at <anonymous>

Maybe someone has an idea how to fix the problem?

We are running bbb-recorder on an Ubuntu 18.04 VM with no bbb installed.

All best

Link to a file share solution or Greenlight

Hello,
my first test of bbb-recorder are good, I have anothers tests to do to confirm. So now I think about users uses cases. I wonder to make it usable for users. For now my users are in greenlight, do you think is possible to link bbb-recorder to greenlight ? Or another idea to link that with a share system like nextcloud or others solutions ?

Thanks for you're development and ideas

bbb-recorder (ffmpeg) runs out of memory when streaming live to RTMP

This is not directly related to bbb-recorder but hoping you could assist us.

We have been testing with bbb-recorder to rtmp live stream BBB sessions to YouTube Live. Thank you for your work, the project is well put together.

Our issue:
ffmpeg runs out of memory after some time depending on the size of the host (VMs). We are using Linode as our provider.

Looks like with:

  • 2 VCPU / 4 GB it fails after less than 5 minutes
  • 4 VCPU / 8 GB it fails after about 38 minutes
[ 4521.946279] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=6fe9a17c458df671ac76e9d83081eab78508fd7c9063ad98c9c4fd4085c653fb,mems_allowed=0,global_oom,task_memcg=/docker/6fe9a17c458df671ac76e9d83081eab78508fd7c9063ad98c9c4fd4085c653fb,task=ffmpeg,pid=3529,uid=0
[ 4521.946350] Out of memory: Killed process 3529 (ffmpeg) total-vm:8860260kB, anon-rss:7688164kB, file-rss:0kB, shmem-rss:12812kB, UID:0 pgtables:16288kB oom_score_adj:0
[ 4522.378152] oom_reaper: reaped process 3529 (ffmpeg), now anon-rss:16kB, file-rss:0kB, shmem-rss:12832kB
[ 4523.638944] br-42362ca21fc0: port 1(vetha0a8f11) entered disabled state
[ 4523.639298] veth4950752: renamed from eth0
[ 4523.714325] br-42362ca21fc0: port 1(vetha0a8f11) entered disabled state
[ 4523.718378] device vetha0a8f11 left promiscuous mode
[ 4523.718387] br-42362ca21fc0: port 1(vetha0a8f11) entered disabled state

Seems it might be related to the audio capture. We are using your pulseaudio daemon settings and all ffmpeg settings.

What we are hoping for:

  • We would like to be able to stream live (RTMP to YouTube Live) one session for up to 5 hours.

Our questions

  • Is that an issue you have ran into perhaps?
  • What size systems (CPU/RAM) are you using to run the bbb-recorder for live RTMP streaming for that sort of duration?

Difficulties with long recordings

With small files / times it is working very well.

Sometimes the last few minutes of the video seem corrupted, but it doesn't get in the way. It seems to record, approximately, 3 minutes more than we put in the parameter. It happens with long or short recordings.

I tested with a recording of + 2h, but some problems happen:

  • The error maxBuffer exceeded happens. I increased the maxBuffer in the exec. The error no longer happens, but the final file appears corrupted, it does not open on all players. In VLC it seems kind of crashing, but it could be my pc or codec, I converted it on youtube and it looks ok. Is it possible to exchange exec for spawn?

  • Sometimes, when there is a longer delay in the initial loading of the page, apparently the play button is not activated and only records a black screen.

Congratulations and thanks for sharing.

chrome driver

Why do not you use chrome driver?
A saw one project which use in same situation crhome-stable and chrome driver for browser control

we have also issues when sometimes process does not finish properly and chrome Xvfb ffmpeg remains in memory

Export.js is exporting just 1 seconds

All the exported videos are no longer tan 0.25 seconds. I have tried different times from scratch, always same output.

Even setting name.webm 0 true or name.webm 10 true... no change

Specifying 0 for time duration literally make 0 size recording

When I execute following command -
node export.js "https:///playback/presentation/2.0/playback.html?meetingId=17c0689aa607459fc63d822848bc1475db509b8d-1586949361016" 17c0689aa607459fc63d822848bc1475db509b8d-1586949361016.webm 0 true

It doesn't consider the full recording length.

How to process recording concurrently?

I am trying to edit export.js to loop on all of my old presentation (BBB recording). I need export.js to process at least two presentations in the same time? I have edit export.js to process two urls instead of process.argv.

Currently I have this:

recorder = 0
# looping over my recordings
  if (recorder < 2) {
    recorder +=1

    main(url).then(() => {
      recorder -=1
    })
  }
#

On my mac OS everything works just as expected. On my Ubuntu 18.04 server I get this error:

Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
    at CDPSession.send (/root/bbb-recorder/node_modules/puppeteer/lib/Connection.js:180:29)
    at ExecutionContext._evaluateInternal (/root/bbb-recorder/node_modules/puppeteer/lib/ExecutionContext.js:107:44)
    at ExecutionContext.evaluate (/root/bbb-recorder/node_modules/puppeteer/lib/ExecutionContext.js:48:23)
    at ExecutionContext.<anonymous> (/root/bbb-recorder/node_modules/puppeteer/lib/helper.js:112:23)
    at DOMWorld.evaluate (/root/bbb-recorder/node_modules/puppeteer/lib/DOMWorld.js:112:20)
  -- ASYNC --
    at Frame.<anonymous> (/root/bbb-recorder/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.evaluate (/root/bbb-recorder/node_modules/puppeteer/lib/Page.js:860:43)
    at Page.<anonymous> (/root/bbb-recorder/node_modules/puppeteer/lib/helper.js:112:23)
    at main (/root/bbb-recorder/export.js:136:20)

What is problem? Why I am getting different behavior when changing the OS.

Thanks

Convert fail if meeting is longer than 3 hours

Hello,

I use your code to convert presentation to mp4 it worked very well until we tried to convert long meeting (3hours+). It seems it's a limitation from exec command.

I migrate exec command to spawnSync and now it's work fine.

Best regards,
Romain

SteelBlue User faced an error on main.joinRouteHandler

I'm trying to connect to my local development BBB and after trying to connect I am met with this error not sure what is causing this have tried few different things but keep getting this result.
Any idea what I could be doing wrong.

stderr buffer overflow during mp4 conversion

if there are too many warnings during mp4 conversion, stderr buffer exceeds default 200k and conversion stops with error:
RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded

I tried to increase the buffer to 500k, in line 130 of export.js but this wasn't enough:

exec(cmd, {maxBuffer: 1024 * 500}, function(err, stdout, stderr) {

so, my suggestion is change line 126 of export.js, to make ffmpeg output more verbose from:

var cmd = "ffmpeg -y -i '" + copyFrom + "' -c:v libx264 -preset veryfast -movflags faststart -profile:v high -level 4.2 -max_muxing_queue_size 9999 -vf mpdecimate -vsync vfr '" + copyTo + "'";

to

var cmd = "ffmpeg -loglevel fatal -y -i '" + copyFrom + "' -c:v libx264 -preset veryfast -movflags faststart -profile:v high -level 4.2 -max_muxing_queue_size 9999 -vf mpdecimate -vsync vfr '" + copyTo + "'";

(just add -loglevel fatal)

Livejoin: Audio is lost if meeting is disconected

If the meeting disconects for some seconds and reconnects, the recorder looses the audio and does not reconnect as a listener. This happened in a 3 hour session on which at 1:30 the server disconected for some seconds, and the last half of the meeting there is only video without sound.

Problem with Live RTMP broadcasting ffmpeg auto exit

You can use a simple workaround for this to resolve. This is happen when no change detected on the screen. Therefor we can put small countdown/timer to make small content change on the screen, then chrome will capture screens continuously. We don't need to camera open then.

await page.evaluate(() => {	
    var btn = document.createElement("div");
    btn.innerHTML = '<div id="injected_countdown" style="text-align:left; margin-bottom:-30px; padding-bottom:-20px;">COUNTDOWN</div>';
    document.querySelector("header").appendChild(btn);
});
await page.waitFor(1000);
await page.addScriptTag({url: 'inject.js'});

Here is the code for java-script timer injected above.

function startTime() {
  var today = new Date();
  var h = today.getHours();
  var m = today.getMinutes();
  var s = today.getSeconds();
  var ms = today.getMilliseconds();
  m = checkTime(m);
  s = checkTime(s);
  document.getElementById('injected_countdown').innerHTML = h + ":" + m + ":" + s + ":" + ms;
  var t = setTimeout(startTime, 100);
}
function checkTime(i) {
  if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10
  return i;
}
startTime();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.