Skip to content

Instantly share code, notes, and snippets.

@abautu
Created January 9, 2021 22:47
Show Gist options
  • Save abautu/ec503ae9dbf3104e17cecb5d682b578f to your computer and use it in GitHub Desktop.
Save abautu/ec503ae9dbf3104e17cecb5d682b578f to your computer and use it in GitHub Desktop.
Bigbluebutton patch for issue #2483
diff -urN recordandplayback-orig/edl/audio.rb recordandplayback-andrei/edl/audio.rb
--- recordandplayback-orig/edl/audio.rb 2020-09-25 19:56:21.000000000 +0300
+++ recordandplayback-andrei/edl/audio.rb 2020-12-25 00:16:29.076301902 +0200
@@ -22,9 +22,9 @@
module Audio
FFMPEG_AEVALSRC = "aevalsrc=s=48000:c=stereo:exprs=0|0"
FFMPEG_AFORMAT = "aformat=sample_fmts=s16:sample_rates=48000:channel_layouts=stereo"
- FFMPEG_WF_CODEC = 'flac'
- FFMPEG_WF_ARGS = ['-c:a', FFMPEG_WF_CODEC, '-f', 'flac']
- WF_EXT = 'flac'
+ FFMPEG_WF_CODEC = 'libvorbis'
+ FFMPEG_WF_ARGS = ['-c:a', FFMPEG_WF_CODEC, '-q:a', '2', '-f', 'ogg']
+ WF_EXT = 'ogg'
def self.dump(edl)
BigBlueButton.logger.debug "EDL Dump:"
diff -urN recordandplayback-orig/edl/video.rb recordandplayback-andrei/edl/video.rb
--- recordandplayback-orig/edl/video.rb 2020-09-25 19:56:21.000000000 +0300
+++ recordandplayback-andrei/edl/video.rb 2020-12-29 00:32:49.044991167 +0200
@@ -23,10 +23,10 @@
module BigBlueButton
module EDL
module Video
- FFMPEG_WF_CODEC = 'mpeg2video'
+ FFMPEG_WF_CODEC = 'libx264'
FFMPEG_WF_FRAMERATE = 24
- FFMPEG_WF_ARGS = ['-an', '-codec', FFMPEG_WF_CODEC.to_s, '-q:v', '2', '-g', (FFMPEG_WF_FRAMERATE * 10).to_s, '-pix_fmt', 'yuv420p', '-r', FFMPEG_WF_FRAMERATE.to_s, '-f', 'mpegts']
- WF_EXT = 'ts'
+ FFMPEG_WF_ARGS = ['-an', '-codec', FFMPEG_WF_CODEC.to_s, '-preset', 'superfast', '-movflags', 'frag_keyframe', '-crf', '28', '-g', (FFMPEG_WF_FRAMERATE * 10).to_s, '-pix_fmt', 'yuv420p', '-r', FFMPEG_WF_FRAMERATE.to_s, '-f', 'h264']
+ WF_EXT = 'mp4'
def self.dump(edl)
BigBlueButton.logger.debug "EDL Dump:"
diff -urN recordandplayback-orig/generators/audio_processor.rb recordandplayback-andrei/generators/audio_processor.rb
--- recordandplayback-orig/generators/audio_processor.rb 2020-09-25 19:56:21.000000000 +0300
+++ recordandplayback-andrei/generators/audio_processor.rb 2020-12-25 00:16:06.108558288 +0200
@@ -60,13 +60,13 @@
ogg_format = {
:extension => 'ogg',
- :parameters => [ [ '-c:a', 'libvorbis', '-q:a', '2', '-f', 'ogg' ] ]
+ :parameters => [ [ '-c:a', 'copy', '-f', 'ogg' ] ]
}
BigBlueButton::EDL.encode(@audio_file, nil, ogg_format, file_basename)
webm_format = {
:extension => 'webm',
- :parameters => [ [ '-c:a', 'libvorbis', '-q:a', '2', '-f', 'webm' ] ],
+ :parameters => [ [ '-c:a', 'copy', '-f', 'webm' ] ],
:postprocess => [ [ 'mkclean', '--quiet', ':input', ':output' ] ]
}
BigBlueButton::EDL.encode(@audio_file, nil, webm_format, file_basename)
diff -urN recordandplayback-orig/generators/video.rb recordandplayback-andrei/generators/video.rb
--- recordandplayback-orig/generators/video.rb 2020-12-22 00:30:44.847685272 +0200
+++ recordandplayback-andrei/generators/video.rb 2020-12-29 01:47:08.550982370 +0200
@@ -55,8 +55,8 @@
# These settings are appropriate for 640x480 medium quality, and should be tweaked for other resolutions
# See https://developers.google.com/media/vp9/settings/vod/
# Increase -threads to max of 4 or increase -speed to max of 4 to speed up processing
- %w[-c:v libvpx-vp9 -b:v 750K -minrate 375K -maxrate 1088K -crf 33 -quality good -speed 1 -g 240 -tile-columns 1 -threads 2
- -c:a libopus -b:a 48K
+ %w[-c:v libvpx-vp9 -crf 28 -deadline realtime -cpu-used 8 -g 240 -tile-columns 1 -threads 2
+ -c:a copy
-f webm]
# Google recommends doing a 2-pass encode for better quality, but it's a lot slower. If you want to do this,
# comment the lines above, and uncomment the lines below.
@@ -76,7 +76,7 @@
# Increase -threads (or remove it, to use all cpu cores) to speed up processing
# You can also change the preset: try 'fast' or 'faster'
# To change quality, adjust the -crf value. Lower numbers are higher quality.
- %w[-c:v libx264 -crf 23 -threads 2 -preset medium -g 240
+ %w[-c:v copy
-c:a aac -b:a 64K
-f mp4 -movflags faststart]
],
@@ -121,8 +121,8 @@
# These settings are appropriate for 1280x720 medium quality, and should be tweaked for other resolutions
# See https://developers.google.com/media/vp9/settings/vod/
# Increase -threads to max of 8 or increase -speed to max of 4 to speed up processing
- %w[-c:v libvpx-vp9 -b:v 1024K -minrate 512K -maxrate 1485K -crf 32 -quality good -speed 2 -g 240 -tile-columns 2 -threads 2
- -c:a libopus -b:a 48K
+ %w[-c:v libvpx-vp9 -crf 28 -deadline realtime -cpu-used 8 -g 240 -tile-columns 2 -threads 2
+ -c:a copy
-f webm]
# Google recommends doing a 2-pass encode for better quality, but it's a lot slower. If you want to do this,
# comment the lines above, and uncomment the lines below.
@@ -142,7 +142,7 @@
# Increase -threads (or remove it, to use all cpu cores) to speed up processing
# You can also change the preset: try 'fast' or 'faster'
# To change quality, adjust the -crf value. Lower numbers are higher quality.
- %w[-c:v libx264 -crf 23 -threads 2 -preset medium -g 240
+ %w[-c:v copy
-c:a aac -b:a 64K
-f mp4 -movflags faststart]
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment