Remove screenshare audio specific ffmpeg codec in recording processing.

This commit is contained in:
germanocaumo 2021-03-23 14:18:31 -03:00
parent 95fabfe8c2
commit 136f43eb25
2 changed files with 6 additions and 26 deletions

View File

@ -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)

View File

@ -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