- fix so that logs are written in /var/log/bigbluebutton/ using the ff convention

<playback-type>-process-<meeting-id>.log
This commit is contained in:
Richard Alam 2011-05-24 13:58:56 -04:00
parent 442e510953
commit c89cc5b777
7 changed files with 33 additions and 15 deletions

View File

@ -72,7 +72,7 @@ module BigBlueButton
# Rough frequency: 504
# Volume adjustment: 1.215
command = "sox #{file} -n stat 2>&1"
BigBlueButton.logger.info("Executing #{command}\n")
BigBlueButton.logger.info("#{command}\n")
IO.popen(command, "w+") do |output|
output.each do |line|
stats = line if line =~ /Length(.+)/
@ -103,14 +103,13 @@ module BigBlueButton
# Process the audio events for this recording
def self.process_events(events_xml)
puts events_xml
audio_events = match_start_and_stop_events(start_audio_recording_events(events_xml),
stop_audio_recording_events(events_xml)).each do |audio_event|
if not audio_event.matched
determine_start_stop_timestamps_for_unmatched_event!(audio_event)
end
end
puts audio_events.length
if audio_events.length > 0
audio_paddings = generate_audio_paddings(audio_events, events_xml)
audio_events.concat(audio_paddings)
@ -130,7 +129,6 @@ module BigBlueButton
start_events = []
doc = Nokogiri::XML(File.open(events_xml))
doc.xpath("//event[@eventname='StartRecordingEvent']").each do |start_event|
puts start_event
ae = AudioRecordingEvent.new
ae.start_event_timestamp = start_event[TIMESTAMP]
ae.bridge = start_event.xpath(BRIDGE).text
@ -138,7 +136,6 @@ module BigBlueButton
ae.start_record_timestamp = start_event.xpath(RECORD_TIMESTAMP).text
start_events << ae
end
puts "Start Events: #{start_events}"
return start_events.sort {|a,b| a.start_event_timestamp <=> b.start_event_timestamp}
end

View File

@ -27,6 +27,7 @@ module BigBlueButton
# Extract a page from the pdf file.
def self.extract_page_from_pdf(page_num, pdf_presentation, pdf_out)
command = "ghostscript #{OPTIONS} #{FIRSTPAGE}=#{page_num} #{LASTPAGE}=#{page_num} #{OUTPUTFILE}=#{pdf_out} #{NO_PDF_MARK_WORKAROUND} #{pdf_presentation}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
end
@ -34,6 +35,7 @@ module BigBlueButton
# Convert a pdf page to a png.
def self.convert_pdf_to_png(pdf_page, png_out)
command = "convert -density 600x600 -resize 800x560 -quality 90 #{pdf_page} #{png_out}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
end

View File

@ -8,7 +8,9 @@ module BigBlueButton
# Example:
# strip_audio_from_video(orig-video.flv, video2.flv)
def self.strip_audio_from_video(video_in, video_out)
IO.popen("ffmpeg -i #{video_in} -an -vcodec copy #{video_out}")
command = "ffmpeg -i #{video_in} -an -vcodec copy #{video_out}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
# TODO: check for result, raise an exception when there is an error
end
@ -21,7 +23,9 @@ module BigBlueButton
# Example:
# create_blank_video(15, 1000, canvas.jpg, blank-video.flv)
def self.create_blank_deskshare_video(length, rate, blank_canvas, video_out)
IO.popen("ffmpeg -loop_input -t #{length} -i #{blank_canvas} -r #{rate} -vcodec flashsv #{video_out}")
command = "ffmpeg -loop_input -t #{length} -i #{blank_canvas} -r #{rate} -vcodec flashsv #{video_out}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
# TODO: check for result, raise exception when there is an error
end
@ -34,7 +38,9 @@ module BigBlueButton
# Example:
# create_blank_video(15, 1000, canvas.jpg, blank-video.flv)
def self.create_blank_video(length, rate, blank_canvas, video_out)
IO.popen("ffmpeg -loop_input -t #{length} -i #{blank_canvas} -r #{rate} #{video_out}")
command = "ffmpeg -loop_input -t #{length} -i #{blank_canvas} -r #{rate} #{video_out}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
# TODO: check for result, raise exception when there is an error
end
@ -47,7 +53,9 @@ module BigBlueButton
# Example:
# create_blank_canvas(1280, 720, white, blank_canvas.jpg)
def self.create_blank_canvas(width, height, color, out_file)
IO.popen("convert -size #{width}x#{height} xc:#{color} #{out_file}")
command = "convert -size #{width}x#{height} xc:#{color} #{out_file}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
# TODO: check for result, raise an exception when there is an error
end
@ -62,7 +70,7 @@ module BigBlueButton
#command = "mencoder -forceidx -of lavf -oac copy -ovc copy -o #{video_out} #{videos_in.join(' ')}"
#BigBlueButton.execute(command)
# Somehow, using the backtick works but not using popen.
puts "mencoder -forceidx -of lavf -oac copy -ovc copy -o #{video_out} #{videos_in.join(' ')}"
BigBlueButton.logger.info("mencoder -forceidx -of lavf -oac copy -ovc copy -o #{video_out} #{videos_in.join(' ')}")
`mencoder -forceidx -of lavf -oac copy -ovc copy -o #{video_out} #{videos_in.join(' ')}`
end
@ -70,7 +78,9 @@ module BigBlueButton
# audio - the audio file
# video - the video file. Must not contain an audio stream.
def self.multiplex_audio_and_video(audio, video, video_out)
IO.popen("ffmpeg -i #{audio} -i #{video} -map 1:0 -map 0:0 -ar 22050 #{video_out}")
command = "ffmpeg -i #{audio} -i #{video} -map 1:0 -map 0:0 -ar 22050 #{video_out}"
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
# TODO: check result, raise an exception when there is an error
end
@ -234,7 +244,7 @@ module BigBlueButton
def self.fit_to_screen_size(frame_size, pad, flv_in, flv_out)
command = "ffmpeg -i #{flv_in} -aspect 4:3 -r 1000 -sameq #{frame_size} #{pad} -vcodec flashsv #{flv_out}"
puts command
BigBlueButton.logger.info(command)
IO.popen(command)
Process.wait
end

View File

@ -3,15 +3,15 @@ require 'rubygems'
require 'trollop'
require 'yaml'
logger = Logger.new('/var/log/bigbluebutton/matterhorn.log', 'daily' )
BigBlueButton.logger = logger
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]
logger = Logger.new("/var/log/bigbluebutton/matterhorn-process-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger
# This script lives in scripts/archive/steps while bigbluebutton.yml lives in scripts/
props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))

View File

@ -9,6 +9,9 @@ end
meeting_id = opts[:meeting_id]
logger = Logger.new("/var/log/bigbluebutton/matterhorn-publish-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger
# This script lives in scripts/archive/steps while matterhorn.yaml lives in scripts/
bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
matt_props = YAML::load(File.open('matterhorn.yml'))

View File

@ -12,6 +12,9 @@ meeting_id = opts[:meeting_id]
# This script lives in scripts/archive/steps while properties.yaml lives in scripts/
props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
logger = Logger.new("/var/log/bigbluebutton/simple-process-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger
recording_dir = props['recording_dir']
raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}"

View File

@ -10,6 +10,9 @@ end
meeting_id = opts[:meeting_id]
logger = Logger.new("/var/log/bigbluebutton/simple-publish-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger
# This script lives in scripts/archive/steps while properties.yaml lives in scripts/
bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
simple_props = YAML::load(File.open('simple.yml'))