bigbluebutton-Github/record-and-playback/core/scripts/README

133 lines
5.2 KiB
Plaintext
Raw Normal View History

README
2022-03-22 21:34:29 +08:00
These instructions below are for testing by running scripts manually:
1. Create some temp scratch dirs:
2022-03-22 21:34:29 +08:00
mkdir -p ~/temp/log/presentation ~/temp/recording/{process,publish,raw} ~/temp/recording/status/{recorded,archived,processed,sanity} ~/temp/published
2022-03-22 21:34:29 +08:00
2. Edit ~/dev/bigbluebutton/record-and-playback/core/scripts/bigbluebutton.yml and comment the PRODUCTION directories while uncommenting the DEVELOPMENT folders.
The path should match the ones created above.
# For PRODUCTION
2022-03-22 21:34:29 +08:00
# log_dir: /var/log/bigbluebutton
events_dir: /var/bigbluebutton/events
# recording_dir: /var/bigbluebutton/recording
# published_dir: /var/bigbluebutton/published
captions_dir: /var/bigbluebutton/captions
# playback_host: develop.distancelearning.cloud
playback_protocol: https
# For DEVELOPMENT
# This allows us to run the scripts manually
2022-03-22 21:34:29 +08:00
scripts_dir: /home/ubuntu/dev/bigbluebutton/record-and-playback/core/scripts
log_dir: /home/ubuntu/temp/log
recording_dir: /home/ubuntu/temp/recording
published_dir: /home/ubuntu/temp/published
playback_host: 127.0.0.1
3. Stop the recording service:
systemctl stop bbb-rap-starter
systemctl stop bbb-rap-resque-worker
4. Create a recording using BigBlueButton. After logging out, it should have created a <meeting-id>.done file in the
/var/bigbluebutton/recording/status/recorded directory. Make note of this meeting-id as we use that to tell the script
which recording to process.
2022-03-22 21:34:29 +08:00
5. Before running the scripts, we have to make sure our scripts have the paths set up correctly.
In your development environment (~/dev/bigbluebutton/record-and-playback), edit
- /core/scripts/archive/archive.rb
- /core/scripts/sanity/sanity.rb
- presentation/scripts/process/presentation.rb
- presentation/scripts/publish/presentation.rb
- presentation/scripts/presentation.yml
and ensure the scripts are using the DEVELOPMENT PATH. We need to do this so the script will be able to find the core library.
2022-03-22 21:34:29 +08:00
# For DEVELOPMENT
# Allows us to run the script manually
require File.expand_path('../../../../core/lib/recordandplayback', __FILE__)
2022-03-22 21:34:29 +08:00
# For PRODUCTION
# require File.expand_path('../../../lib/recordandplayback', __FILE__)
2022-03-22 21:34:29 +08:00
# For PRODUCTION
# publish_dir: /var/bigbluebutton/published/presentation
video_formats:
- webm
# - mp4
2022-03-22 21:34:29 +08:00
# For DEVELOPMENT
publish_dir: /home/ubuntu/temp/published/presentation
2022-03-22 21:34:29 +08:00
6. Now we run the archive step. Go to record-and-playback/core/scripts and type
ruby archive/archive.rb -m <meeting-id>
2022-03-22 21:34:29 +08:00
If everything went well, you should now have the raw files in ~/temp/recording/raw/<meeting-id>.
You can also check the logs at ~/temp/log/archive-<meeting-id>.log, and have a .done entry in ~/temp/recording/status/archived.
7. Now we need to do a sanity check to ensure the raw recordings are complete. Again in the scripts folder, type
ruby sanity/sanity.rb -m <meeting-id>
Confirm everything went as intended by checking the logs at ~/temp/log/sanity.log and
that a .done entry in ~/temp/recording/status/sanity exists.
8. Assuming the recording passed the sanity check, it's time to process the recording.
2022-03-22 21:34:29 +08:00
Set the path of the captions generation script by changing the line
ret = BigBlueButton.exec_ret('utils/gen_webvtt', '-i', raw_archive_dir, '-o', target_dir)
to
ret = BigBlueButton.exec_ret('/home/ubuntu/dev/bigbluebutton/record-and-playback/core/scripts/utils/gen_webvtt', '-i', raw_archive_dir, '-o', target_dir)
2022-03-22 21:34:29 +08:00
Now, you can run the presentation processing script:
2022-03-22 21:34:29 +08:00
cd ~/dev/bigbluebutton/record-and-playback/presentation/scripts
ruby process/presentation.rb -m <meeting-id>
You can monitor the progress by tailing the log at ~/temp/log/presentation/process-<meeting-id>.log.
Note that each time one of the scripts fails, the corresponding directories for the recording at
~/temp/recording/process/presentation and ~/temp/recording/publish/presentation
need to be deleted before executing them again.
9. If everything went well, we can now run the publish script. However, we need to cheat a little bit.
The publish script will be looking for a 'processing_time' file which contains information on how long the
processing took. Unfortunately, that file is created by the 'rap-worker.rb', a script which we don't run.
Manually create the file at
vi ~/temp/recording/process/presentation/<meeting-d>/processing_time
Enter any number (e.g. 46843) and save the file.
2022-03-22 21:34:29 +08:00
Once again, the path to the poll generation utility needs to be updated:
Change
ret = BigBlueButton.exec_ret('utils/gen_poll_svg', ...)
to
ret = BigBlueButton.exec_ret('/home/ubuntu/dev/bigbluebutton/record-and-playback/core/scripts/utils/gen_webvtt', ...)
2022-03-22 21:34:29 +08:00
Finally, run the publish script:
2022-03-22 21:34:29 +08:00
ruby publish/presentation.rb -m <meeting-id>-presentation
2022-03-22 21:34:29 +08:00
Notice we appended "presentation" to the meetingId, this will tell the script to publish using the "presentation" format.
2022-03-22 21:34:29 +08:00
9. Deploy your changes with deploy.sh and restarting the recording-related services:
systemctl restart bbb-rap-starter
systemctl restart bbb-rap-resque-worker