Substitute IO.popen by BigBlueButton.execute in presentation.rb and video.rb
This commit is contained in:
parent
25bb768026
commit
794d419631
@ -27,17 +27,15 @@ 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
|
||||
BigBlueButton.execute(command)
|
||||
# Process.wait
|
||||
end
|
||||
|
||||
# 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
|
||||
BigBlueButton.execute(command)
|
||||
# Process.wait
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -9,9 +9,7 @@ module BigBlueButton
|
||||
# strip_audio_from_video(orig-video.flv, video2.flv)
|
||||
def self.strip_audio_from_video(video_in, video_out)
|
||||
command = "ffmpeg -i #{video_in} -an -vcodec copy #{video_out}"
|
||||
BigBlueButton.logger.info(command)
|
||||
IO.popen(command)
|
||||
Process.wait
|
||||
BigBlueButton.execute(command)
|
||||
# TODO: check for result, raise an exception when there is an error
|
||||
end
|
||||
|
||||
@ -24,9 +22,7 @@ module BigBlueButton
|
||||
# create_blank_video(15, 1000, canvas.jpg, blank-video.flv)
|
||||
def self.create_blank_deskshare_video(length, rate, blank_canvas, 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
|
||||
BigBlueButton.execute(command)
|
||||
# TODO: check for result, raise exception when there is an error
|
||||
end
|
||||
|
||||
@ -39,9 +35,7 @@ module BigBlueButton
|
||||
# create_blank_video(15, 1000, canvas.jpg, blank-video.flv)
|
||||
def self.create_blank_video(length, rate, blank_canvas, video_out)
|
||||
command = "ffmpeg -loop_input -t #{length} -i #{blank_canvas} -r #{rate} #{video_out}"
|
||||
BigBlueButton.logger.info(command)
|
||||
IO.popen(command)
|
||||
Process.wait
|
||||
BigBlueButton.execute(command)
|
||||
# TODO: check for result, raise exception when there is an error
|
||||
end
|
||||
|
||||
@ -54,9 +48,7 @@ module BigBlueButton
|
||||
# create_blank_canvas(1280, 720, white, blank_canvas.jpg)
|
||||
def self.create_blank_canvas(width, height, color, out_file)
|
||||
command = "convert -size #{width}x#{height} xc:#{color} #{out_file}"
|
||||
BigBlueButton.logger.info(command)
|
||||
IO.popen(command)
|
||||
Process.wait
|
||||
BigBlueButton.execute(command)
|
||||
# TODO: check for result, raise an exception when there is an error
|
||||
end
|
||||
|
||||
@ -79,9 +71,7 @@ module BigBlueButton
|
||||
# video - the video file. Must not contain an audio stream.
|
||||
def self.multiplex_audio_and_video(audio, video, 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
|
||||
BigBlueButton.execute(command)
|
||||
# TODO: check result, raise an exception when there is an error
|
||||
end
|
||||
|
||||
@ -290,9 +280,10 @@ module BigBlueButton
|
||||
# Use for newer version of FFMPEG
|
||||
padding = "-vf pad=#{MAX_VID_WIDTH}:#{MAX_VID_HEIGHT}:#{side_padding}:#{top_bottom_padding}:FFFFFF"
|
||||
command = "ffmpeg -i #{stripped_webcam} -aspect 4:3 -r 1000 -sameq #{frame_size} #{padding} #{scaled_flv}"
|
||||
BigBlueButton.logger.info(command)
|
||||
IO.popen(command)
|
||||
Process.wait
|
||||
#BigBlueButton.logger.info(command)
|
||||
#IO.popen(command)
|
||||
#Process.wait
|
||||
BigBlueButton.execute(command)
|
||||
end
|
||||
end
|
||||
|
||||
@ -337,9 +328,10 @@ module BigBlueButton
|
||||
# Use for newer version of FFMPEG
|
||||
padding = "-vf pad=#{MAX_VID_WIDTH}:#{MAX_VID_HEIGHT}:#{side_padding}:#{top_bottom_padding}:FFFFFF"
|
||||
command = "ffmpeg -i #{flv_in} -aspect 4:3 -r 1000 -sameq #{frame_size} #{padding} -vcodec flashsv #{scaled_flv}"
|
||||
BigBlueButton.logger.info(command)
|
||||
IO.popen(command)
|
||||
Process.wait
|
||||
BigBlueButton.execute(command)
|
||||
#BigBlueButton.logger.info(command)
|
||||
#IO.popen(command)
|
||||
#Process.wait
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user