Repository navigation
recording: Add support for multiple presets to 'video' recording format - #23887
Conversation
|
Caution Review failedFailed to post review comments WalkthroughThis pull request introduces markdown-to-HTML rendering for group chat messages with configurable image support, adds a new UserVoiceState event for broadcasting voice conference state changes, propagates speaker locale through the voice system, implements dial-in user mute-on-start enforcement configuration, adds version-aware plugin manifest handling, enhances SVG dimension probing for presentations, updates database schemas to persist HTML message variants and connection metadata, and performs a comprehensive migration from javax.* to jakarta.* for validation and servlet APIs across the Java codebase. Sequence DiagramsequenceDiagram
participant Client
participant Handler as Message Handler
participant GroupChat as GroupChatApp
participant Markdown as MarkdownUtil
participant DB as ChatMessageDAO
participant Gateway as OutGateway
Client->>Handler: SendGroupChatMessage
Handler->>GroupChat: toGroupChatMessage<br/>(message, allowedHtmlElements)
GroupChat->>Markdown: markdownToSafeHtml<br/>(message, allowedHtmlElements)
Markdown-->>GroupChat: messageAsHtml
GroupChat-->>Handler: GroupChatMessage<br/>(message, messageAsHtml)
Handler->>DB: insertGroupChatMessage<br/>(message, messageAsHtml)
DB-->>Handler: ✓
Handler->>Gateway: buildGroupChatMsgToUser<br/>(messageAsHtml)
Gateway->>Client: GroupChatMsgToUser<br/>(message, messageAsHtml)
rect rgb(200, 220, 240)
Note over Client: Display with<br/>safe HTML rendering
end
sequenceDiagram
participant User
participant VoiceHandler as Voice Handler
participant VoiceApp
participant DB as UserState/VoiceUsers
participant MsgBuilder
participant Gateway as OutGateway
participant Client
User->>VoiceHandler: Join/Leave/Mute Voice Conf
VoiceHandler->>VoiceApp: handleUserJoinedVoiceConfEvtMsg<br/>(speechLocale)
VoiceApp->>DB: Update VoiceUserState<br/>(speechLocale)
VoiceApp->>MsgBuilder: buildUserVoiceStateEvtMsg
MsgBuilder-->>VoiceApp: UserVoiceStateEvtMsg<br/>(talking, muted, leftVoiceConf)
VoiceApp->>Gateway: send(UserVoiceStateEvtMsg)
Gateway->>Client: Broadcast voice state<br/>update
rect rgb(220, 240, 200)
Note over Client: Update voice UI<br/>(status, icons, etc.)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (7)
record-and-playback/video/playback/video/index.html.erb (3)
5-5: Escape meetingName to prevent XSS in title and headermeetingName originates from metadata (untrusted). Escape before rendering.
- <title><%= meetingName %></title> + <title><%= CGI.escapeHTML(meetingName.to_s) %></title> ... - <h1><%= meetingName %></h1> + <h1><%= CGI.escapeHTML(meetingName.to_s) %></h1>Also applies to: 17-17
31-31: Fix srclang valuesrclang must be a BCP-47 language code (e.g., "en"), not a filename.
- <track kind="captions" label="<%= CGI.escapeHTML(caption['localeName']) %>" src="caption_<%= CGI.escapeHTML(caption['locale']) %>.vtt" srclang="<%= CGI.escapeHTML(caption['locale']) %>.vtt"> + <track kind="captions" label="<%= CGI.escapeHTML(caption['localeName']) %>" src="caption_<%= CGI.escapeHTML(caption['locale']) %>.vtt" srclang="<%= CGI.escapeHTML(caption['locale']) %>">
40-40: Accessibility attribute typoChange area-label to aria-label for screen readers.
- <div id="chat" aria-live="polite" role="region" area-label="Chat Messages"></div> + <div id="chat" aria-live="polite" role="region" aria-label="Chat Messages"></div>record-and-playback/video/scripts/publish/video.rb (2)
21-24: Require missing depsThis file uses Nokogiri and JSON but never requires them; runtime will fail on first use.
require File.expand_path('../../lib/recordandplayback', __dir__) require 'optimist' require 'yaml' +require 'nokogiri' +require 'json'
29-29: Typo: Optimist.die, not Optimist.dirThis currently raises NoMethodError and blocks publishing.
-Optimist.dir :meeting_id, 'must be provided' unless opts[:meeting_id] +Optimist.die :meeting_id, 'must be provided' unless opts[:meeting_id]record-and-playback/video/scripts/process/video.rb (2)
21-29: Require missing stdlibSet and JSON are used later; without requires this will crash at runtime.
require File.expand_path('../../lib/recordandplayback', __dir__) require File.expand_path('../../lib/recordandplayback/edl', __dir__) require 'active_support/core_ext/hash' require 'optimist' require 'yaml' require 'nokogiri' require 'erb' require 'cgi' +require 'set' +require 'json'
414-419: Preserve metadata children, not attributesCopying attributes drops most metadata. Iterate child elements to retain all keys.
- xml.meta do - metadata.attributes.each do |k, v| - xml.method_missing(k, v) - end - end + xml.meta do + metadata.elements.each do |child| + xml.method_missing(child.name, child.text) + end + end
🧹 Nitpick comments (6)
record-and-playback/video/scripts/publish/video.rb (1)
73-81: Metadata presence check is good; add tiny guardIf metadata.xml is malformed, Nokogiri::XML can return a document with errors. Optional: log xml.errors for easier diagnostics.
record-and-playback/video/scripts/process/video.rb (1)
87-94: Minor log grammar“Webcams were use” → “Webcams were used”.
- logger.info('Webcams were use in this session') + logger.info('Webcams were used in this session')record-and-playback/video/scripts/video.yml (4)
24-27: Guard against VP9 + MP4 copy mismatch.If bbb_presentation_video_codec is set to vp9, the MP4 “-c:v copy” formats will fail; MP4 doesn’t carry VP9. Either (a) keep codec=h264 when using MP4/copy, or (b) enable a WebM/VP9 format and disable MP4. Please confirm the processing scripts reject/override incompatible combinations.
Minimal doc hardening:
# The codec that will be used by the intermediate file generated by the bbb-presentation-video # tool, containing the presentation/whiteboard area. The options are "vp9" or "h264". +# NOTE: If set to "vp9", ensure a WebM/VP9 output format is enabled and MP4/copy is disabled, +# or change MP4 parameters to transcode to H.264 instead of using "-c:v copy". bbb_presentation_video_codec: "h264"If you want, I can provide a patch that uncomments the WebM/VP9 blocks and comments out the MP4 blocks.
Also applies to: 86-98, 148-156
73-73: Remove trailing whitespace (yamllint).Keeps CI green and diffs clean.
- +- +- - [ '-c:v', 'copy', # Use working format codec defined in + - [ '-c:v', 'copy', # Use working format codec defined inAlso applies to: 147-147, 152-152
21-23: Consider restricting meta-driven preset selection.allow_meta_preset: true lets meeting creators pick heavier presets (e.g., 1080p), impacting CPU/IO. Recommend defaulting to false in large deployments or whitelisting allowed meta presets downstream.
92-93: Revisit file extension: use “mp4” instead of “m4v”.Some tooling and CDN heuristics expect .mp4; you already advertise video/mp4. If nothing depends on .m4v, switch to .mp4.
- extension: m4v + extension: mp4Also applies to: 150-151
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
record-and-playback/video/playback/video/index.html.erb(1 hunks)record-and-playback/video/scripts/process/video.rb(5 hunks)record-and-playback/video/scripts/publish/video.rb(3 hunks)record-and-playback/video/scripts/video.yml(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
record-and-playback/video/scripts/process/video.rb (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (3)
create_webcam_edl(168-390)create_deskshare_edl(463-529)edl_match_recording_marks_video(583-588)record-and-playback/core/lib/recordandplayback/edl/video.rb (1)
merge(55-177)
🪛 ast-grep (0.38.6)
record-and-playback/video/scripts/process/video.rb
[warning] 156-156: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file.
Context: sl.fetch('areas', preset.fetch('areas', []))
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures [REFERENCES]
https://cwe.mitre.org/data/definitions/522.html
(hardcoded-secret-rsa-passphrase-ruby)
🪛 YAMLlint (1.37.1)
record-and-playback/video/scripts/video.yml
[error] 73-73: trailing spaces
(trailing-spaces)
[error] 147-147: trailing spaces
(trailing-spaces)
[error] 152-152: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-package (others)
- GitHub Check: build-package (bbb-playback-record)
- GitHub Check: build-package (bbb-etherpad)
- GitHub Check: build-package (bbb-graphql-server)
- GitHub Check: build-package (bbb-apps-akka)
🔇 Additional comments (8)
record-and-playback/video/scripts/publish/video.rb (2)
40-56: Override merge approach looks goodPreserving base presets while allowing override presets to extend/replace is correct and backward-compatible. Nice.
118-121: Correct use of string keys when copying outputsMatches how YAML loads format hashes. LGTM.
record-and-playback/video/scripts/process/video.rb (6)
44-60: Override merge approach looks goodMerging presets separately before merging other keys enables additive overrides. Backward-compatible. 👍
146-151: Set usage is correct once stdlib is requiredAfter requiring 'set', this media detection is solid.
154-170: Constraint-based layout selection is sensibleThe required/supported logic aligns with the presets design. Nice.
215-219: Good defensive check on layoutExiting early if core layout fields are missing prevents confusing downstream errors.
322-330: Codec default mismatch with config summary: verifyCode defaults to 'vp9', while video.yml (per PR summary) sets 'h264'. Ensure intended default is documented; otherwise you may get unexpected transcodes on missing config.
338-343: Correctly symbolizing format before encodeMatches EDL.encode expectations. LGTM.
|
The code duplication check is probably being triggered by the duplicate code needed to handle loading and merging the config files, as well as selecting the correct preset, separately in the |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
record-and-playback/video/scripts/process/video.rb (1)
21-29: Require 'set' to use SetRuby’s Set lives in the standard library and must be required. Without this, NameError: uninitialized constant Set will occur at runtime.
Apply this diff:
require 'optimist' require 'yaml' require 'nokogiri' require 'erb' require 'cgi' +require 'set'
♻️ Duplicate comments (2)
record-and-playback/video/scripts/process/video.rb (2)
117-123: Correctly reading preset from metadata attributes — LGTMAccessing events.xml metadata as attributes via metadata['bbb-recording-video-preset'] is correct for Nokogiri here.
395-397: meetingName attribute access — LGTMmetadata['meetingName'] correctly reads the attribute from events.xml.
🧹 Nitpick comments (2)
record-and-playback/video/scripts/process/video.rb (1)
45-51: Optional: allow YAML anchors/aliases in overridesIf admins use YAML anchors/aliases in /etc overrides, safe_load may reject them. Consider enabling aliases to improve configurability.
Apply this diff (both loads):
- YAML.safe_load(video_props_file) + YAML.safe_load(video_props_file, aliases: true)- YAML.safe_load(video_props_override_file) + YAML.safe_load(video_props_override_file, aliases: true)record-and-playback/video/scripts/video.yml (1)
147-147: Remove trailing spacesMinor YAML lint issue.
Apply this diff:
- +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
record-and-playback/video/playback/video/index.html.erb(4 hunks)record-and-playback/video/scripts/process/video.rb(6 hunks)record-and-playback/video/scripts/publish/video.rb(4 hunks)record-and-playback/video/scripts/video.yml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- record-and-playback/video/playback/video/index.html.erb
- record-and-playback/video/scripts/publish/video.rb
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element (e.g., `<metadata meetingName="Demo Meeting" isBreakout="false"/>`), not as child elements. The metadata element is accessed via `events.at_xpath('/recording/metadata')` and attributes are accessed using bracket notation like `metadata['meetingName']`.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element, not as child elements. Therefore, accessing metadata values should use bracket notation like metadata['meetingName'] rather than XPath methods like at_xpath('meetingName').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
🧬 Code graph analysis (1)
record-and-playback/video/scripts/process/video.rb (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (3)
create_webcam_edl(168-390)create_deskshare_edl(463-529)edl_match_recording_marks_video(583-588)record-and-playback/core/lib/recordandplayback/edl/video.rb (1)
merge(55-177)
🪛 ast-grep (0.38.6)
record-and-playback/video/scripts/process/video.rb
[warning] 156-156: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file.
Context: sl.fetch('areas', preset.fetch('areas', []))
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures [REFERENCES]
https://cwe.mitre.org/data/definitions/522.html
(hardcoded-secret-rsa-passphrase-ruby)
🪛 YAMLlint (1.37.1)
record-and-playback/video/scripts/video.yml
[error] 147-147: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-package (others)
- GitHub Check: build-package (bbb-graphql-server)
- GitHub Check: build-package (bbb-web)
- GitHub Check: build-package (bbb-freeswitch)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (1)
record-and-playback/video/scripts/process/video.rb (1)
338-343: Formats symbolization before encode — LGTMSymbolizing each format hash in place ensures templates can use symbol keys consistently later.
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (2)
record-and-playback/video/scripts/process/video.rb (2)
155-158: LGTM: correct fallback to base layout areasUsing
layout.fetch('areas', [])fixes the earlier incorrect suggestion to usepreset. This ensures constraint-based layout matching works.
395-397: Use attribute access (correct) + add nil-safe fallback for meetingNameAttribute access is correct for events.xml metadata (per prior discussion). Add safe nav + fallback to
meeting_idto avoid nil crash.- meetingName: metadata['meetingName'], + meetingName: metadata&.[]('meetingName') || meeting_id,
🧹 Nitpick comments (4)
record-and-playback/video/scripts/process/video.rb (4)
44-59: Enable YAML anchors in configs (safer override merging)safe_load currently rejects YAML anchors/aliases, which are common in BBB configs. Allow aliases for both base and override loads.
- YAML.safe_load(video_props_file) + YAML.safe_load(video_props_file, aliases: true) @@ - YAML.safe_load(video_props_override_file) + YAML.safe_load(video_props_override_file, aliases: true)
125-129: Tighten log phrasing for fallbackWhen meta preset is disabled or absent, “Preset doesn't exist” is misleading.
- logger.info("Preset doesn't exist, falling back to default preset #{preset_name.inspect}") + logger.info("Using default preset #{preset_name.inspect}")
322-322: Prefer preset-level codec setting; fallback to globalCode reads only from top-level props, but PR intent mentions preset-level override. Read from preset first, then
video_props.- bbb_presentation_video_codec = video_props.fetch('bbb_presentation_video_codec', 'vp9') + bbb_presentation_video_codec = preset.fetch('bbb_presentation_video_codec', + video_props.fetch('bbb_presentation_video_codec', 'vp9')) @@ - '-c', bbb_presentation_video_codec, + '-c', bbb_presentation_video_codec,Also applies to: 328-330
338-343: LGTM: uses preset formats and symbolized format keysLooks good. Ensure
require 'json'is present to avoid runtime error atJSON.parselater.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
record-and-playback/video/scripts/process/video.rb(6 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element (e.g., `<metadata meetingName="Demo Meeting" isBreakout="false"/>`), not as child elements. The metadata element is accessed via `events.at_xpath('/recording/metadata')` and attributes are accessed using bracket notation like `metadata['meetingName']`.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element, not as child elements. Therefore, accessing metadata values should use bracket notation like metadata['meetingName'] rather than XPath methods like at_xpath('meetingName').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
🧬 Code graph analysis (1)
record-and-playback/video/scripts/process/video.rb (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (3)
create_webcam_edl(168-390)create_deskshare_edl(463-529)edl_match_recording_marks_video(583-588)record-and-playback/core/lib/recordandplayback/edl/video.rb (1)
merge(55-177)
🪛 ast-grep (0.38.6)
record-and-playback/video/scripts/process/video.rb
[warning] 156-156: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file.
Context: sl.fetch('areas', layout.fetch('areas', []))
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures [REFERENCES]
https://cwe.mitre.org/data/definitions/522.html
(hardcoded-secret-rsa-passphrase-ruby)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: build-package (bbb-fsesl-akka)
- GitHub Check: build-package (bbb-freeswitch)
- GitHub Check: build-package (others)
- GitHub Check: build-package (bbb-learning-dashboard)
- GitHub Check: build-package (bbb-playback-record)
- GitHub Check: build-package (bbb-graphql-server)
🔇 Additional comments (2)
record-and-playback/video/scripts/process/video.rb (2)
90-90: LGTM: clearer log messageNo issues here.
263-268: LGTM: EDL entries use symbol keys consistentlyMatches EDL conventions and later processing.
Also applies to: 272-276
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
record-and-playback/video/scripts/process/video.rb (1)
21-29: Require stdlib deps explicitly to avoid NameError across environmentsSet, Logger, FileUtils, and JSON are used but not required; some Ruby setups won’t autoload them.
require File.expand_path('../../lib/recordandplayback', __dir__) require File.expand_path('../../lib/recordandplayback/edl', __dir__) require 'active_support/core_ext/hash' require 'optimist' require 'yaml' require 'nokogiri' require 'erb' require 'cgi' +require 'set' +require 'logger' +require 'fileutils' +require 'json'
🧹 Nitpick comments (4)
record-and-playback/video/scripts/process/video.rb (4)
117-129: Meta-preset: keep attribute access, add nil-safe guard and clearer loggingAttribute access is correct for events.xml. Guard for missing and only log when a name exists; log unknown preset before falling back.
-preset = nil -if video_props.fetch('allow_meta_preset', true) - # Use preset specified via metadata parameter, if available - preset_name = metadata['bbb-recording-video-preset'] - logger.info("Using preset #{preset_name.inspect}") - preset = video_props.dig('presets', preset_name) unless preset_name.nil? -end +preset = nil +if video_props.fetch('allow_meta_preset', true) + # Use preset specified via metadata parameter, if available + preset_name = metadata&.[]('bbb-recording-video-preset') + if preset_name + preset = video_props.dig('presets', preset_name) + if preset + logger.info("Using preset from metadata: #{preset_name.inspect}") + else + logger.warn("Unknown preset from metadata: #{preset_name.inspect} — will fall back") + end + end +end # Fall back to using the default preset if preset.nil? preset_name = video_props['default_preset'] - logger.info("Preset doesn't exist, falling back to default preset #{preset_name.inspect}") + logger.info("Falling back to default preset #{preset_name.inspect}") preset = video_props.dig('presets', preset_name) unless preset_name.nil? end
228-235: Warn when dropping presentation due to layout lacking areaCurrently this silently disables presentation even if media exists. Emit a warning to aid misconfig diagnosis.
-# Ensure the presentation video is not generated unless there is a presentation area in the selected layout -have_presentation = false unless layout['areas'].any? { |area| area['name'] == 'presentation' } +# Ensure the presentation video is not generated unless there is a presentation area in the selected layout +if have_presentation && !layout['areas'].any? { |area| area['name'] == 'presentation' } + logger.warn('Presentation media present but selected layout lacks a presentation area; skipping presentation rendering') + have_presentation = false +end
325-333: Let presets override presentation codec, fall back to global and defaultAligns with per-preset control while keeping backward compatibility.
-bbb_presentation_video_codec = video_props.fetch('bbb_presentation_video_codec', 'vp9') +bbb_presentation_video_codec = + preset.fetch('bbb_presentation_video_codec', + video_props.fetch('bbb_presentation_video_codec', 'vp9'))
341-346: Validate formats array before encoding; symbolization aligns with templatesAdd a small guard to fail fast on empty/invalid formats. Symbolizing each format entry is good and matches template expectations.
-logger.info "Encoding output files to #{preset['formats'].length} formats" -preset['formats'].each_with_index do |format, i| +formats = preset['formats'] +unless formats.is_a?(Array) && !formats.empty? + logger.error('Preset formats missing or empty') + exit(1) +end +logger.info "Encoding output files to #{formats.length} formats" +formats.each_with_index do |format, i| format.symbolize_keys! logger.info " #{format[:mimetype]}" BigBlueButton::EDL.encode(audio, video, format, "#{process_dir}/video-#{i}", video_props['audio_offset']) end
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
record-and-playback/video/scripts/process/video.rb(6 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:23:35.550Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.550Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element (e.g., `<metadata meetingName="Demo Meeting" isBreakout="false"/>`), not as child elements. The metadata element is accessed via `events.at_xpath('/recording/metadata')` and attributes are accessed using bracket notation like `metadata['meetingName']`.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:21:06.806Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:395-397
Timestamp: 2025-09-11T20:21:06.806Z
Learning: In BigBlueButton's events.xml file, metadata is stored as attributes on the metadata element, not as child elements. Therefore, accessing metadata values should use bracket notation like metadata['meetingName'] rather than XPath methods like at_xpath('meetingName').
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, YAML configuration data (including format hashes) has its keys converted to symbols using deep_symbolize_keys! in the process/video.rb script, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
📚 Learning: 2025-09-11T20:24:01.166Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/playback/video/index.html.erb:27-29
Timestamp: 2025-09-11T20:24:01.166Z
Learning: In BigBlueButton's video recording processing pipeline, format hashes loaded from YAML configuration are converted to use symbol keys via format.symbolize_keys! in the process/video.rb script before being passed to templates, so templates should access format data using symbol keys like format[:extension] and format[:mimetype] rather than string keys.
Applied to files:
record-and-playback/video/scripts/process/video.rb
🧬 Code graph analysis (1)
record-and-playback/video/scripts/process/video.rb (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (3)
create_webcam_edl(168-390)create_deskshare_edl(463-529)edl_match_recording_marks_video(583-588)record-and-playback/core/lib/recordandplayback/edl/video.rb (1)
merge(55-177)
🪛 ast-grep (0.38.6)
record-and-playback/video/scripts/process/video.rb
[warning] 156-156: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file.
Context: sl.fetch('areas', layout.fetch('areas', []))
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures [REFERENCES]
https://cwe.mitre.org/data/definitions/522.html
(hardcoded-secret-rsa-passphrase-ruby)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-package (others)
- GitHub Check: build-package (bbb-playback-record)
- GitHub Check: build-package (bbb-etherpad)
- GitHub Check: build-package (bbb-export-annotations)
- GitHub Check: build-package (bbb-graphql-server)
🔇 Additional comments (3)
record-and-playback/video/scripts/process/video.rb (3)
48-59: Override merge logic looks solidCleanly supports /etc override and merges presets first to allow additive/replace semantics; tolerates missing override file.
154-170: Constraint-based layout selection reads wellRequired/supported media checks with Set are correct; fallback to named layouts comes later.
395-401: meetingName attribute access is correctCorrectly pulls meetingName from metadata attributes for the index template.
c29ce91 to
b6e0dfc
Compare
Automated tests Summary⏳ Tests are running... |
|
At Anton's request, I'm going to be rebasing this PR to BBB 3.0 |
germanocaumo
left a comment
There was a problem hiding this comment.
Reviewed and tested a bit, everything seems good 👍
In order to make the video recording format more flexible, I'm adding support for creating multiple "presets" in the configuration file, to allow different content layouts or video resolutions to be generated. The layout can be changed on a per-meeting basis by setting the meeting create parameter `meta_bbb-recording-video-preset=presetname` (this feature can be disabled if not desired). In addition to supporting multiple presets, the method for defining content-dependent layouts has changed to allow more flexibility. You can specify multiple different possible video layouts for a preset, and an appropriate layout will automatically be selected from the list depending on what type of content was shared during the live session. See the comments in video.yml for details. The "video" recording format now supports a configuration override file at /etc/bigbluebutton/recording/video.yml - this override file can be used to alter top-level settings and add new presets or replace existing presets. The configuration file parsing was written in such a way that it is still able to understand the configuration format used by previous BigBlueButton versions. If someone has customized their video.yml, they can continue to use the same video.yml after upgrading and it will continue to work.
Skip generating the presentation video if the selected layout does not include a presentation area.
b6e0dfc to
31e5401
Compare
|
This pull request has conflicts ☹ |
|
I've rebased the PR to the v3.0.x-release branch. The diff is identical. |
|





In order to make the video recording format more flexible, I'm adding support for creating multiple "presets" in the configuration file, to allow different content layouts or video resolutions to be generated.
The layout can be changed on a per-meeting basis by setting the meeting create parameter
meta_bbb-recording-video-preset=presetname(this feature can be disabled if not desired).In addition to supporting multiple presets, the method for defining content-dependent layouts has changed to allow more flexibility. You can specify multiple different possible video layouts for a preset, and an appropriate layout will automatically be selected from the list depending on what type of content was shared during the live session. See the comments in video.yml for details.
The "video" recording format now supports a configuration override file at /etc/bigbluebutton/recording/video.yml - this override file can be used to alter top-level settings and add new presets or replace existing presets. The processing scripts are corrected to read settings from /etc/bigbluebutton/recording/recording.yml as well #22980
The configuration file parsing was written in such a way that it is still able to understand the configuration format used by previous BigBlueButton versions. If someone has customized their video.yml, they can continue to use the same video.yml after upgrading and it will continue to work.
The selection of video layout is still static (a single layout is selected to be used for the entire recording), but the update to how the layouts are handled was designed with adaptive video layout #23337 in mind (it should be possible to implement that without requiring any additional changes to the config file structure).