Coder Social home page Coder Social logo

manishkatyan / bbb-optimize Goto Github PK

View Code? Open in Web Editor NEW
83.0 13.0 43.0 758 KB

Better audio quality, increase recording processing speed, dynamic video profile, pagination, fix 1007/1020 errors and use apply-config.sh to manage your customizations are some key techniques for you to optimize and smoothly run your BigBlueButton servers.

License: MIT License

Shell 92.34% JavaScript 7.66%

bbb-optimize's Introduction

BigBlueButton Optimize

You can easily optimize your BigBlueButton server to meet your specific requirements for branding and feature customizations.

GitHub package.json version Monthly download on NPM



✨ Features

  • Branding
  • Session settings
  • Lock settings
  • Audio and Video optimization



πŸ– Requirements

To install this package, you would need a BigBlueButton 2.4.x server.



⏳ Installation

# Install bbb-opimize CLI globally
npm i -g bigbluebutton-optimize

#Run optimization. Replace ENV_FILE with your env file
bbb-optimize --env-file=ENV_FILE

#Restart the bbb
bbb-conf --restart

Example env file

#Set welcome message
DEFAULT_WELCOME_MESSAGE=Welcome to my awesome session

# Change default bigbluebutton logo; default=/var/www/bigbluebutton-default/logo.png
DEFAULT_LOGO=/root/branding/logo.png

# Change default bigbluebutton favicon; default=/var/www/bigbluebutton-default/favicon.ico
DEFAULT_FAVICON=/root/branding/favicon.ico

#Mute the session on start; default false
MUTE_ON_START=true

#lock settings
LOCK_PRIVATE_CHAT=true

#Enable mediasoup for webcam and screensharing instread of kurento
ENABLE_MEDIASOUP=true

Available optimization options

Branding

# If the message contains characters not in ISO-8859-1 character sets
# they must be properly escaped to unicode characters. An easy way to
# do this is running the native2ascii command setting UTF8 encoding and
# passing this file's path as input and output parameters, e.g.:
#
# native2ascii -encoding UTF8 bigbluebutton.properties bigbluebutton.properties
DEFAULT_WELCOME_MESSAGE=Hello Welcome to My Conference

DEFAULT_WELCOME_MESSAGE_FOOTER=Message footer

# Change default bigbluebutton logo; default /var/www/bigbluebutton-default/logo.png
DEFAULT_LOGO=/var/www/bigbluebutton-default/logo.png

# Change default bigbluebutton favicon; default /var/www/bigbluebutton-default/favicon.ico
DEFAULT_FAVICON=/var/www/bigbluebutton-default/favicon.ico

# Change default bigbluebutton presentation; default /var/www/bigbluebutton-default/default.pdf
DEFAULT_PRESENTATION= /var/www/bigbluebutton-default/default.pdf

#Set title and it will be set as your bigbluebutton meeting tab name
CLIENT_TITLE=Class ++
APP_NAME=Class ++

#Set copyright
COPY_RIGHT=Β©2022 example.com

#Change default help link for your bigbluebutton session
HELP_LINK=https:\/\/www.example.com\/help

Session settings

#Enable this to allow moderators to unmute viwers
ALLOW_MODS_TO_UNMUTE_USERS=false

# Allow webcams streaming reception only to and from moderators
WEBCAM_ONLY_FOR_MODERATOR=false

#Mute the session on start
MUTE_ON_START=false

#Keep the meeting events
DEFAULT_KEEP_EVENTS=false

#Set the max users that can join a single BigBlueButton session
#If set to 0, There will not be any limit
DEFAULT_MAX_USERS=0

#Allow users to join the same session using multiple devices
ALLOW_DUPLICATE_USER_ID=false

# Param to end the meeting when there are no moderators after a certain period of time.
# Needed for classes where teacher gets disconnected and can't get back in. Prevents
# students from running amok
END_WHEN_NO_MODERATOR=false

# Number of minutes to wait for moderator rejoin before end meeting (if `END_WHEN_NO_MODERATOR=true` )
END_WHEN_NO_MODERATOR_DELAY=2

#Disable the recording even if record=true passed in create call
DISABLE_RECORDING=false

#Enable the shared notes 
ENABLE_SHARED_NOTES=false

# Number of minutes that Learning Dashboard will be available after the end of the meeting
# if 0, the Learning Dashboard will keep available permanently; 
LEARNING_DASHBOARD_CLEANUP_DELAY=2

# Default duration of the meeting in minutes. If set to 0 the meeting does'nt end.
MEETING_DURATION=0

#Enable listen only mode
ENABLE_LISTEN_ONLY_MODE=true

#Set this to true to skip audio check after joining the session
SKIP_AUDIO_CHECK=false

#Set this true to enable dictation
ENABLE_DICTATION=false

Lock settings

#Default lock settings

#Lock the private chat
LOCK_PRIVATE_CHAT=false

#Lock the public chat
LOCK_PUBLIC_CHAT=false

#Lock the shared notes 
LOCK_SHARED_NOTES=false

#Lock the mic 
LOCK_MICROPHONE=false

#Lock the webcam 
LOCK_WEBCAM=false

#If enabled, viewers will not able to see other viewers
HIDE_USER_LIST=false

Audio and Video optimization

#Enable mediasoup for webcam and screensharing instread of kurento
ENABLE_MEDIASOUP=false

#Enable multiple kurento for better performance
ENABLE_MULTIPLE_KURENTO=false

#Set the default webcam resolution, Allowd values are low, medium, high, hd
WEBCAM_RESOLUTION=medium

#Enable recording optimization for ios devices
OPTIMIZE_RECORDING_FOR_IOS=true


#Enable this to fix audio issues such as 1007, 1020. 
#Reference: https://github.com/manishkatyan/bbb-optimize/tree/v1#fix-1007-and-1020-errors
FIX_AUDIO_ERROR=true

#If FIX_AUDIO_ERROR is set to true, then set your bbb server's  PUBLIC_IP
PUBLIC_IP=

Miscellaneous settings

#Minimize the chat section on start
CHAT_START_CLOSED=false
#Set the log level for bbb; possible values are: INFO, DEBUG, WARN, ERROR,; default DBUG
LOG_LEVEL=DEBUG

Additional optimization

Stream better quality audio

Edit /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml and make the following changes

maxaveragebitrate: "256000"
maxplaybackrate: "48000"

Edit /opt/freeswitch/etc/freeswitch/autoload_configs/conference.conf.xml and make the follwoing changes

<param name="interval" value="20"/>
<param name="channels" value="2"/>
<param name="energy-level" value="100"/>

Edit /opt/freeswitch/etc/freeswitch/dialplan/default/bbb_conference.xml and copy-and-paste the code below, removing the existig code

<?xml version="1.0" encoding="UTF-8"?>
<include>
   <extension name="bbb_conferences_ws">
      <condition field="${bbb_authorized}" expression="true" break="on-false" />
      <condition field="${sip_via_protocol}" expression="^wss?$" />
      <condition field="destination_number" expression="^(\d{5,11})$">
         <action application="set" data="jitterbuffer_msec=60:120:20" />
         <action application="set" data="rtp_jitter_buffer_plc=true" />
         <action application="set" data="rtp_jitter_buffer_during_bridge=true" />
         <action application="set" data="suppress_cng=true" />
         <action application="answer" />
         <action application="conference" data="$1@cdquality" />
      </condition>
   </extension>
   <extension name="bbb_conferences">
      <condition field="${bbb_authorized}" expression="true" break="on-false" />
      <condition field="destination_number" expression="^(\d{5,11})$">
         <action application="set" data="jitterbuffer_msec=60:120:20" />
         <action application="set" data="rtp_jitter_buffer_plc=true" />
         <action application="set" data="rtp_jitter_buffer_during_bridge=true" />
         <action application="set" data="suppress_cng=true" />
         <action application="answer" />
         <action application="conference" data="$1@cdquality" />
      </condition>
   </extension>
</include>

Edit /opt/freeswitch/etc/freeswitch/autoload_configs/opus.conf.xml and copy-and-paste the code below, removing the existig code

<?xml version="1.0" encoding="UTF-8"?>
<configuration name="opus.conf">
   <settings>
      <param name="use-vbr" value="1" />
      <param name="use-dtx" value="0" />
      <param name="complexity" value="10" />
      <param name="packet-loss-percent" value="15" />
      <param name="keep-fec-enabled" value="1" />
      <param name="use-jb-lookahead" value="1" />
      <param name="advertise-useinbandfec" value="1" />
      <param name="adjust-bitrate" value="1" />
      <param name="maxaveragebitrate" value="256000" />
      <param name="maxplaybackrate" value="48000" />
      <param name="sprop-maxcapturerate" value="48000" />
      <param name="sprop-stereo" value="1" />
      <param name="negotiate-bitrate" value="1" />
   </settings>
</configuration>

Reference

Secure recordings

With default BBB installation, anyone can share playback recording of your classes on Facebook or WhatsApp for everyone to view.

To secure your recordings, you can make it accessible only from a certain domain. For example, allow recordings to be accessed from theh domain of your Moodle site.

For BBB version greater that 2.3 or 2.4:

#edit /etc/bigbluebutton/nginx/playback.nginx 

location /playback/presentation/2.3 {
  root /var/bigbluebutton;
  try_files $uri /playback/presentation/2.3/index.html;

    # Restrict access
    valid_referers server_names
      bbb.youdomain.com;
    if ($invalid_referer) {
      return 404;
    }
  # End - Restrict access

}

For BBB 2.2:

# edit /etc/bigbluebutton/nginx/presentation.nginx

  location /playback/presentation {
    root   /var/bigbluebutton;
    index index.html index.htm;

  # Restrict access
    valid_referers server_names
      bbb.youdomain.com;
    if ($invalid_referer) {
      return 404;
    }
  # End - Restrict access
  }

No logs

1. BigBlueButton logging

# BigBlueButton logs location: /var/log/bigbluebutton/bbb-web.log. To limit this log, set
# (1) change appLogLevel from DEBUG to ERROR
vi /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
# (2) change each logger level to ERROR (default INFO and DEBUG)
vi /usr/share/bbb-web/WEB-INF/classes/logback.xml

# To avoid logging ip-addresses in bbb-webrtc-sfu change log > level to error (default verbose)
vi /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml

# To change logs level for chat usage and chat messages, change loglevel to ERROR
vi /etc/bbb-transcode-akka/application.conf (default INFO)
vi /etc/bbb-transcode-akka/logback.xml (default INFO, DEBUG, WARN]
vi /etc/bbb-apps-akka/application.conf (default DEBUG)
vi /etc/bbb-apps-akka/logback.xml (default INFO DEBUG)

2. Nginx

# Nginx logs - change access log 
vi /etc/nginx/nginx.conf
access_log /dev/null; (default /var/log/nginx/access.log)

# Nginx logs - change access log
vi /etc/nginx/sites-available/bigbluebutton
access_log /dev/null; (default /var/log/nginx/bigbluebutton.access.log)

3. Freeswitch

# Freeswitch logs - change loglevel and stdout-loglevel to ERROR (default DEBUG)
vi /etc/bbb-fsesl-akka/application.conf

# Freeswitch logs - change logger to ERROR (default INFO, DEBUG, WARN)
vi /etc/bbb-fsesl-akka/logback.xml

4. Red5

# red5 - change root > level to ERROR and each logger to ERROR (default INFO)
vi /etc/red5/logback.xml

5. Kurento

# export GST_DEBUG="1 ..." (Default is 3; Set it to 1, that is for Error)
vi /etc/default/kurento-media-server

6. Greenlight

vi .env

# Comment the following live to send logs to log/production.log 
# RAILS_LOG_TO_STDOUT=true

# Create symlink, replacing $GREENLIGHTDIR with the absolute path where Greenlight is installed. 
ln -s /dev/null $GREENLIGHTDIR/log/production.log

7. Scalelite

The Scalelite API container is logging user activities. For example: Who joined which meeting. This logfile will never be deleted automatically and it will get quite large, if scalelite is serving many users. Hence, delete logs via cronjobs.

# Login as root
crontab -e

# add to delete all Docker-Container-Logfiles. At 03:00 every sunday and thursday.
0 3 * * 0,4 truncate -s 0 /var/lib/docker/containers/*/*-json.log

8. Coturn

ln -s /dev/null /var/log/coturn.log

9. Rotate Logs

If you want to keep logs, you can set days for which logs should be kept on the BBB server.

# Change log_history to 7 days (or as appropriate)
vi /etc/cron.daily/bigluebutton

# Change rotate to 7 (days) or as appropriate (this rotates log for /var/log/bigbluebutton/(bbb-rap-worker.log|sanity.log)
vi /etc/logrotate.d/bbb-record-core.logrotate

# Change rotate to 7 (days) or as appropriate (this rotates log for /var/log/bbb-webrtc-sfu/)
vi bbb-webrtc-sfu.logrotate

# Change MaxHistory to 7 (days) or as appropriate (this rotates log for /var/log/bigbluebutton/bbb-web.log)
vi /usr/share/bbb-web/WEB-INF/classes/logback.xml

No Syslog entries

# Edit /usr/lib/systemd/system/bbb-htlm5.service
StandardOutput=null
# Restart
systemctl daemon-reload

Set server Timezone

# Current timezone
timedatectl

# List of available timezone
timedatectl list-timezones

# Set new timezone by replacing Asia/Kolkata with your timezone
timedatectl set-timezone Asia/Kolkata

Restart BBB everyday

crontab -e

#restart bbb at 2 AM  everyday
00 2 * * * /usr/bin/bbb-conf --restart

Save big with our affordable BigBlueButton hosting.

  • Bare metal servers for HD video
  • 40% lower hosting costs
  • Top-rated tech support, 100% uptime
  • Upgrade / cancel anytime
  • 2 weeks free trial; No credit card needed

Start Free Trial



πŸ“ License

MIT License

Copyright (c) HigherEdLab.com

bbb-optimize's People

Contributors

arun-hel avatar manishkatyan 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

Watchers

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

bbb-optimize's Issues

is there any plan for 2.5 compatibility?

Thank you for sharing wonderful bbb-optimize!
I would like to know if you have any plans enabling BBB version 2.5 compatibility? is it too early to ask? I am interested in testing it on my dev 2.5 rc1 instance. Thanks again!

Update Set external IP in WebRtcEndpoint.conf.ini ?

Does this https://github.com/manishkatyan/bbb-optimize#4-set-external-ip-in-webrtcendpointconfini need update?

If I go to
/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini

it says
and IPv6 addresses of the media server.
;;
;; Forces all local IPv4 and/or IPv6 ICE candidates to have the given address.
;; This is really nothing more than a hack, but it's very effective to force a
;; public IP address when one is known in advance for the media server. In doing
;; so, KMS will not need a STUN or TURN server, but remote peers will still be
;; able to contact it.
;;
;; You can try using these settings if KMS is deployed on a publicly accessible
;; server, without NAT, and with a static public IP address. But if it doesn't
;; work for you, just go back to configuring a STUN or TURN server for ICE.
;;
;; Only set this parameter if you know what you're doing, and you understand
;; 100% WHY you need it. For the majority of cases, you should just prefer to
;; configure a STUN or TURN server.
;;
;; is a single IPv4 address.
;; is a single IPv6 address.
;;
;externalIPv4=198.51.100.1
;externalIPv6=2001:0db8:85a3:0000:0000:8a2e:0370:7334

;; External IP address of the media server.
;;
;; DEPRECATED: Use "externalIPv4" and/or "externalIPv6" instead.
;;
;; Forces all local IPv4 and IPv6 ICE candidates to have the given address. This
;; is really nothing more than a hack, but it's very effective to force a public
;; IP address when one is known in advance for the media server. In doing so,
;; KMS will not need a STUN or TURN server, but remote peers will still be able
;; to contact it.
;;
;; You can try using this setting if KMS is deployed on a publicly accessible
;; server, without NAT, and with a static public IP address. But if it doesn't
;; work for you, just go back to configuring a STUN or TURN server for ICE.
;;
;; Only set this parameter if you know what you're doing, and you understand
;; 100% WHY you need it. For the majority of cases, you should just prefer to

;; configure a STUN or TURN server.
;;
;; is a single IPv4 or IPv6 address.
;;
;externalAddress=198.51.100.1
;externalAddress=2001:0db8:85a3:0000:0000:8a2e:0370:7334

so I guess it's note
externalAddress=Public-IP-of-BBB-Server
that needs to be uncommented but
externalIPv4=Public-IP-of-BBB-Server

plus, I don't understand the following paragraph
STUN/TURN are needed only when the media server sits behind a NAT and needs to find out its own external IP address. However, if you set a static external IP address as mentioned above, then there is no need for the STUN/TURN auto-discovery. Hence, comment the following: using turn.higheredlab.com (IP address)

#stunServerAddress=95.217.128.91
#stunServerPort=3478

what do you exactly recommend to do?

5349 not 5439

Hello,

You wrote
Ensure that ufw firewall on your Turn server allows the following ports: 80, 443, 3478, 5439, and 49152:65535/udp
instead of
Ensure that ufw firewall on your Turn server allows the following ports: 80, 443, 3478, 5349, and 49152:65535/udp

Best regards,

Processing and published not sync

I have processing and also published version. Why this happend?

Is that the worker-2 works like as worker-1 ?

1b24c65c37c7105396e2be551555a8e918e87ad25-160506210765 Wed Nov 11 07:59:20 +0330 2020 X XXXXX 12 presentation presentation

Discuss: Error 1007 when already setup turn server

Hi,
I have an issue with bbb when connected to audio
I've setup a turn server and use with bbb, it only work when I set

media.peerconnection.ice.relay_only | true

on firefox, other always throw 1007

Could you please help?
Thank you in advance

cat: ./env : No such file or directory

Hi,
Fresh install of BBB2.4 and bbb-optimize.
I create a "config-optimize" env file which is cp from your 'example-env' and modified to suit my needs…
But when i try to apply my env file with "bbb-optimize --env-file=config-optimize" this message (as in title) is displayed and no changes are applied to BBB.
I run the command from /root/bbb-custom and the file has read permission for all.

Any idea?

what is right path of external.xml?

The README reference this path:
/opt/freeswitch/conf/sip_profiles/external.xml

The BBB reference this in their docs and bbb-conf --check
/opt/freeswitch/etc/freeswitch/sip_profiles/external.xml

I just want to sure if both are the same. If they are, I suggest using the second to avoid any confusion

Working solution for higher webcam quality

Hi,
Thanks for your useful information you have gathered through your git.
I wanted to ask if you have found a working solution to get a better webcam quality ( like HD ) from bigbluebutton.

regards.

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.