Skip to content
Snippets Groups Projects
Commit 630224ab authored by Felipe Cecagno's avatar Felipe Cecagno
Browse files

add support for mp4 in the presentation playback, disabled by default

parent fff9940c
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ require File.expand_path('../../edl', __FILE__)
module BigBlueButton
def BigBlueButton.process_webcam_videos(target_dir, temp_dir, meeting_id, output_width, output_height, audio_offset, processed_audio_file)
def BigBlueButton.process_webcam_videos(target_dir, temp_dir, meeting_id, output_width, output_height, audio_offset, processed_audio_file, video_formats=['webm'])
BigBlueButton.logger.info("Processing webcam videos")
# Process user video (camera)
......@@ -57,15 +57,25 @@ module BigBlueButton
:postprocess => [
[ 'mkclean', '--quiet', ':input', ':output' ]
]
},
{
:extension => 'mp4',
:parameters => [
[ '-c:v', 'libx264', '-crf', '23', '-b:v', '60M',
'-threads', '2', '-preset', 'medium', '-cpu-used', '3',
'-c:a', 'libmp3lame', '-b:a', '48K',
'-f', 'mp4' ]
]
}
]
formats.reject!{ |format| ! video_formats.include? format[:extension] }
formats.each do |format|
filename = BigBlueButton::EDL::encode(
processed_audio_file, user_video_file, format, "#{target_dir}/webcams", audio_offset)
end
end
def BigBlueButton.process_deskshare_videos(target_dir, temp_dir, meeting_id, output_width, output_height)
def BigBlueButton.process_deskshare_videos(target_dir, temp_dir, meeting_id, output_width, output_height, video_formats=['webm'])
BigBlueButton.logger.info("Processing deskshare videos")
deskshare_edl = BigBlueButton::Events.create_deskshare_edl(
......@@ -98,8 +108,18 @@ module BigBlueButton
:postprocess => [
[ 'mkclean', '--quiet', ':input', ':output' ]
]
},
{
:extension => 'mp4',
:parameters => [
[ '-c:v', 'libx264', '-crf', '23', '-b:v', '60M',
'-threads', '2', '-preset', 'medium', '-cpu-used', '3',
'-c:a', 'libmp3lame', '-b:a', '48K',
'-f', 'mp4' ]
]
}
]
formats.reject!{ |format| ! video_formats.include? format[:extension] }
formats.each do |format|
filename = BigBlueButton::EDL::encode(
nil, deskshare_video_file, format, "#{target_dir}/deskshare", 0)
......
......@@ -11,6 +11,9 @@ include_deskshare: true
# For PRODUCTION
publish_dir: /var/bigbluebutton/published/presentation
video_formats:
- webm
# - mp4
# For DEVELOPMENT
#publish_dir: /home/ubuntu/temp/published/presentation
......
......@@ -1202,13 +1202,18 @@ begin
begin
if File.exist?("#{$process_dir}/webcams.webm")
video_formats = $presentation_props['video_formats']
video_files = Dir.glob("#{$process_dir}/webcams.{#{video_formats.join(',')}}")
if ! video_files.empty?
BigBlueButton.logger.info("Making video dir")
video_dir = "#{package_dir}/video"
FileUtils.mkdir_p video_dir
BigBlueButton.logger.info("Made video dir - copying: #{$process_dir}/webcams.webm to -> #{video_dir}")
FileUtils.cp("#{$process_dir}/webcams.webm", video_dir)
BigBlueButton.logger.info("Copied .webm file")
video_files.each do |video_file|
BigBlueButton.logger.info("Made video dir - copying: #{video_file} to -> #{video_dir}")
FileUtils.cp(video_file, video_dir)
BigBlueButton.logger.info("Copied #{File.extname(video_file)} file")
end
else
audio_dir = "#{package_dir}/audio"
BigBlueButton.logger.info("Making audio dir")
......@@ -1229,13 +1234,16 @@ begin
end
end
if File.exist?("#{$process_dir}/deskshare.webm")
video_files = Dir.glob("#{$process_dir}/deskshare.{#{video_formats.join(',')}}")
if ! video_files.empty?
BigBlueButton.logger.info("Making deskshare dir")
deskshare_dir = "#{package_dir}/deskshare"
FileUtils.mkdir_p deskshare_dir
BigBlueButton.logger.info("Made deskshare dir - copying: #{$process_dir}/deskshare.webm to -> #{deskshare_dir}")
FileUtils.cp("#{$process_dir}/deskshare.webm", deskshare_dir)
BigBlueButton.logger.info("Copied deskshare.webm file")
video_files.each do |video_file|
BigBlueButton.logger.info("Made deskshare dir - copying: #{video_file} to -> #{deskshare_dir}")
FileUtils.cp(video_file, deskshare_dir)
BigBlueButton.logger.info("Copied #{File.extname(video_file)} file")
end
else
BigBlueButton.logger.info("Could not copy deskshares.webm: file doesn't exist")
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment