From 136f43eb251c22c53caa173f9e3351e74ac4295b Mon Sep 17 00:00:00 2001 From: germanocaumo <germanocaumo@gmail.com> Date: Tue, 23 Mar 2021 14:18:31 -0300 Subject: [PATCH] Remove screenshare audio specific ffmpeg codec in recording processing. --- .../core/lib/recordandplayback/edl/audio.rb | 27 +++---------------- .../generators/audio_processor.rb | 5 ++-- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/record-and-playback/core/lib/recordandplayback/edl/audio.rb b/record-and-playback/core/lib/recordandplayback/edl/audio.rb index 12b69f2d6d..8b3ea41f29 100644 --- a/record-and-playback/core/lib/recordandplayback/edl/audio.rb +++ b/record-and-playback/core/lib/recordandplayback/edl/audio.rb @@ -22,11 +22,8 @@ module BigBlueButton module Audio FFMPEG_AEVALSRC = "aevalsrc=s=48000:c=stereo:exprs=0|0" FFMPEG_AFORMAT = "aresample=async=1000,aformat=sample_fmts=s16:sample_rates=48000:channel_layouts=stereo" - FFMPEG_AFORMAT_SCREENSHARE = "aresample=async=1000,aformat=sample_fmts=s16:sample_rates=48000:channel_layouts=stereo" FFMPEG_WF_CODEC = 'libvorbis' FFMPEG_WF_ARGS = ['-c:a', FFMPEG_WF_CODEC, '-q:a', '2', '-f', 'ogg'] - FFMPEG_WF_SCREENSHARE_CODEC = 'libopus' - FFMPEG_WF_SCREENSHARE_ARGS = ['-c:a', FFMPEG_WF_SCREENSHARE_CODEC, '-b:a', '48K', '-f', 'opus'] WF_EXT = 'ogg' def self.dump(edl) @@ -138,17 +135,9 @@ module BigBlueButton filename: audio[:filename], seek: seek } - if screenshare - ffmpeg_filter << "[#{input_index}]#{FFMPEG_AFORMAT_SCREENSHARE},apad" - else - ffmpeg_filter << "[#{input_index}]#{FFMPEG_AFORMAT},apad" - end + ffmpeg_filter << "[#{input_index}]#{FFMPEG_AFORMAT},apad" else - if screenshare - ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT_SCREENSHARE}" - else - ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT}" - end + ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT}" end ffmpeg_filter << ",atempo=#{speed},atrim=start=#{ms_to_s(audio[:timestamp])}" if speed != 1 @@ -157,11 +146,7 @@ module BigBlueButton else BigBlueButton.logger.info " Generating silence" - if screenshare - ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT_SCREENSHARE}" - else - ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT}" - end + ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT}" end if i > 0 @@ -196,11 +181,7 @@ module BigBlueButton ffmpeg_cmd << '-filter_complex_script' << filter_complex_script output = "#{output_basename}.#{WF_EXT}" - if screenshare - ffmpeg_cmd += [*FFMPEG_WF_SCREENSHARE_ARGS, output] - else - ffmpeg_cmd += [*FFMPEG_WF_ARGS, output] - end + ffmpeg_cmd += [*FFMPEG_WF_ARGS, output] BigBlueButton.logger.info "Running audio processing..." exitstatus = BigBlueButton.exec_ret(*ffmpeg_cmd) diff --git a/record-and-playback/core/lib/recordandplayback/generators/audio_processor.rb b/record-and-playback/core/lib/recordandplayback/generators/audio_processor.rb index 7153ec7919..c7f2d5de0f 100755 --- a/record-and-playback/core/lib/recordandplayback/generators/audio_processor.rb +++ b/record-and-playback/core/lib/recordandplayback/generators/audio_processor.rb @@ -51,11 +51,10 @@ module BigBlueButton BigBlueButton::EDL::Audio.dump(audio_edl) target_dir = File.dirname(file_basename) - events_xml = "#{archive_dir}/events.xml" # getting users audio... @audio_file = BigBlueButton::EDL::Audio.render( - audio_edl, File.join(target_dir, 'recording'), false) + audio_edl, File.join(target_dir, 'recording')) # and mixing it with deskshare audio deskshare_dir = "#{archive_dir}/deskshare" @@ -75,7 +74,7 @@ module BigBlueButton audio_inputs = [] audio_inputs << @audio_file - audio_inputs << BigBlueButton::EDL::Audio.render(deskshare_audio_edl, deskshare_dir, true) + audio_inputs << BigBlueButton::EDL::Audio.render(deskshare_audio_edl, deskshare_dir) @audio_file = BigBlueButton::EDL::Audio.mixer(audio_inputs, mixed_dir) else -- GitLab