diff --git a/record-and-playback/core/scripts/process/README b/record-and-playback/core/scripts/process/README new file mode 100644 index 0000000000..4bc0a4fb33 --- /dev/null +++ b/record-and-playback/core/scripts/process/README @@ -0,0 +1,2 @@ +This directory is a placeholder for different scripts (e.g. simple and matterhorn) that will +process a raw archived recording into different playback formats. diff --git a/record-and-playback/core/scripts/publish/README b/record-and-playback/core/scripts/publish/README new file mode 100644 index 0000000000..d5b1bded64 --- /dev/null +++ b/record-and-playback/core/scripts/publish/README @@ -0,0 +1 @@ +This directory is a placeholder for different publish scripts (e.g. simple and matterhorn) for different playback formats. diff --git a/record-and-playback/core/scripts/ingest-status.rb b/record-and-playback/matterhorn/scripts/ingest-status.rb similarity index 100% rename from record-and-playback/core/scripts/ingest-status.rb rename to record-and-playback/matterhorn/scripts/ingest-status.rb diff --git a/record-and-playback/core/scripts/matterhorn.yml b/record-and-playback/matterhorn/scripts/matterhorn.yml similarity index 100% rename from record-and-playback/core/scripts/matterhorn.yml rename to record-and-playback/matterhorn/scripts/matterhorn.yml diff --git a/record-and-playback/core/scripts/process/matterhorn.rb b/record-and-playback/matterhorn/scripts/process/matterhorn.rb similarity index 100% rename from record-and-playback/core/scripts/process/matterhorn.rb rename to record-and-playback/matterhorn/scripts/process/matterhorn.rb diff --git a/record-and-playback/core/scripts/publish/matterhorn.rb b/record-and-playback/matterhorn/scripts/publish/matterhorn.rb similarity index 100% rename from record-and-playback/core/scripts/publish/matterhorn.rb rename to record-and-playback/matterhorn/scripts/publish/matterhorn.rb diff --git a/record-and-playback/core/scripts/process/simple.rb b/record-and-playback/simple/scripts/process similarity index 100% rename from record-and-playback/core/scripts/process/simple.rb rename to record-and-playback/simple/scripts/process diff --git a/record-and-playback/simple/scripts/process.rb b/record-and-playback/simple/scripts/process.rb new file mode 100755 index 0000000000..08d1dc9d7b --- /dev/null +++ b/record-and-playback/simple/scripts/process.rb @@ -0,0 +1,53 @@ +require '../lib/recordandplayback' +require 'rubygems' +require 'trollop' +require 'yaml' + +opts = Trollop::options do + opt :meeting_id, "Meeting id to archive", :default => '58f4a6b3-cd07-444d-8564-59116cb53974', :type => String +end + +meeting_id = opts[:meeting_id] + +# This script lives in scripts/archive/steps while properties.yaml lives in scripts/ +props = YAML::load(File.open('bigbluebutton.yml')) + +recording_dir = props['recording_dir'] +raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}" + +target_dir = "#{recording_dir}/process/simple/#{meeting_id}" +if FileTest.directory?(target_dir) + FileUtils.remove_dir target_dir +end +FileUtils.mkdir_p target_dir + +# Create a copy of the raw archives +temp_dir = "#{target_dir}/temp" +FileUtils.mkdir_p temp_dir +FileUtils.cp_r(raw_archive_dir, temp_dir) + +BigBlueButton::AudioProcessor.process("#{temp_dir}/#{meeting_id}", "#{target_dir}/audio.ogg") +events_xml = "#{temp_dir}/#{meeting_id}/events.xml" +FileUtils.cp(events_xml, target_dir) + +presentation_dir = "#{temp_dir}/#{meeting_id}/presentation" +presentations = BigBlueButton::Presentation.get_presentations(events_xml) + +processed_pres_dir = "#{target_dir}/presentation" +FileUtils.mkdir_p processed_pres_dir + +presentations.each do |pres| + pres_dir = "#{presentation_dir}/#{pres}" + num_pages = BigBlueButton::Presentation.get_number_of_pages_for(pres_dir) + pres_pdf = "#{pres_dir}/#{pres}.pdf" + + target_pres_dir = "#{processed_pres_dir}/#{pres}" + FileUtils.mkdir_p target_pres_dir + + 1.upto(num_pages) do |page| + pdf_page = "#{pres_dir}/slide-#{page}.pdf" + BigBlueButton::Presentation.extract_page_from_pdf(page, pres_pdf, pdf_page) + BigBlueButton::Presentation.convert_pdf_to_png(pdf_page, "#{target_pres_dir}/slide-#{page}.png") + end +end + diff --git a/record-and-playback/core/scripts/publish/simple.rb b/record-and-playback/simple/scripts/publish/simple.rb similarity index 100% rename from record-and-playback/core/scripts/publish/simple.rb rename to record-and-playback/simple/scripts/publish/simple.rb diff --git a/record-and-playback/core/scripts/simple.yml b/record-and-playback/simple/scripts/simple.yml similarity index 100% rename from record-and-playback/core/scripts/simple.yml rename to record-and-playback/simple/scripts/simple.yml diff --git a/record-and-playback/simple/css/bbb.playback.css b/record-and-playback/simple/webapp/css/bbb.playback.css similarity index 100% rename from record-and-playback/simple/css/bbb.playback.css rename to record-and-playback/simple/webapp/css/bbb.playback.css diff --git a/record-and-playback/simple/lib/jquery-1.4.4.js b/record-and-playback/simple/webapp/lib/jquery-1.4.4.js similarity index 100% rename from record-and-playback/simple/lib/jquery-1.4.4.js rename to record-and-playback/simple/webapp/lib/jquery-1.4.4.js diff --git a/record-and-playback/simple/lib/jquery-1.4.4.min.js b/record-and-playback/simple/webapp/lib/jquery-1.4.4.min.js similarity index 100% rename from record-and-playback/simple/lib/jquery-1.4.4.min.js rename to record-and-playback/simple/webapp/lib/jquery-1.4.4.min.js diff --git a/record-and-playback/simple/logo.png b/record-and-playback/simple/webapp/logo.png similarity index 100% rename from record-and-playback/simple/logo.png rename to record-and-playback/simple/webapp/logo.png diff --git a/record-and-playback/simple/playback.html b/record-and-playback/simple/webapp/playback.html similarity index 100% rename from record-and-playback/simple/playback.html rename to record-and-playback/simple/webapp/playback.html diff --git a/record-and-playback/simple/playback.js b/record-and-playback/simple/webapp/playback.js similarity index 100% rename from record-and-playback/simple/playback.js rename to record-and-playback/simple/webapp/playback.js