Attempt to repair red5 'ser' files in sanity script

This commit is contained in:
Calvin Walton 2015-01-27 11:51:29 -05:00 committed by Felipe Cecagno
parent d8174e3d78
commit 34b13eb807

View File

@ -50,6 +50,19 @@ def check_audio_files(raw_dir,meeting_id)
end end
def check_webcam_files(raw_dir, meeting_id) def check_webcam_files(raw_dir, meeting_id)
meeting_dir = "#{raw_dir}/#{meeting_id}"
BigBlueButton.logger.info("Repairing red5 serialized streams")
cp="/usr/share/red5/red5-server.jar:/usr/share/red5/lib/*"
FileUtils.cd("#{meeting_dir}/video/#{meeting_id}") do
Dir.glob("*.flv.ser").each do |ser|
BigBlueButton.logger.info("Repairing #{ser}")
ret = BigBlueButton.exec_ret('java', '-cp', cp, 'org.red5.io.flv.impl.FLVWriter', ser, '0', '7')
if ret != 0
BigBlueButton.logger.warn("Failed to repair #{ser}")
end
end
end
BigBlueButton.logger.info "Checking all webcam recorded streams from events were archived." BigBlueButton.logger.info "Checking all webcam recorded streams from events were archived."
webcams = BigBlueButton::Events.get_start_video_events("#{raw_dir}/#{meeting_id}/events.xml") webcams = BigBlueButton::Events.get_start_video_events("#{raw_dir}/#{meeting_id}/events.xml")
@ -59,7 +72,6 @@ def check_webcam_files(raw_dir, meeting_id)
end end
BigBlueButton.logger.info "Checking the length of webcam streams is not zero." BigBlueButton.logger.info "Checking the length of webcam streams is not zero."
meeting_dir = "#{raw_dir}/#{meeting_id}"
events_file = "#{meeting_dir}/events.xml" events_file = "#{meeting_dir}/events.xml"
events_xml = Nokogiri::XML(File.open(events_file)) events_xml = Nokogiri::XML(File.open(events_file))
original_num_events = events_xml.xpath("//event").size original_num_events = events_xml.xpath("//event").size