Repository navigation
recording: Fix hang when deskshare audio ends before video - #24970
Conversation
In deskshare audio specifically, it's fairly common for the audio stream to stop before the video stream does, leaving a "gap" between the end of the audio stream and the end of the media file as a whole. Seeking into this gap breaks the audio processing, resulting in a hanging ffmpeg process. Since the audio file gap handling code is already inspecting all of the timestamps, it's easy for it to detect this sort of "gap" at the end of the file, and mark it as a gap to be removed from the EDL, which solves the seek problem.
WalkthroughThe changes modify the audio gap detection workflow by updating method signatures and introducing duration-based gap detection. The Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
record-and-playback/core/lib/recordandplayback/edl/media_utils.rb (1)
98-98: Nit: line exceeds RuboCop's 128-char limit (132).🧹 Proposed wrap
- BigBlueButton.logger.info("PTS gap detected between #{prev_end}ms and end of file at #{duration}ms (#{gap}ms long)") + BigBlueButton.logger.info( + "PTS gap detected between #{prev_end}ms and end of file at #{duration}ms (#{gap}ms long)", + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@record-and-playback/core/lib/recordandplayback/edl/media_utils.rb` at line 98, The log line using BigBlueButton.logger.info exceeds RuboCop's 128-char limit; break the long interpolation into a shorter concatenation or multiple string parts so the final logged message stays under 128 chars — update the BigBlueButton.logger.info call (the line referencing prev_end, duration and gap) to wrap the string across two operands or use string interpolation split into shorter segments to satisfy the RuboCop limit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@record-and-playback/core/lib/recordandplayback/edl/media_utils.rb`:
- Line 98: The log line using BigBlueButton.logger.info exceeds RuboCop's
128-char limit; break the long interpolation into a shorter concatenation or
multiple string parts so the final logged message stays under 128 chars — update
the BigBlueButton.logger.info call (the line referencing prev_end, duration and
gap) to wrap the string across two operands or use string interpolation split
into shorter segments to satisfy the RuboCop limit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 78ae92f7-8d9b-404f-9b78-9656a07c7584
📒 Files selected for processing (2)
record-and-playback/core/lib/recordandplayback/edl/audio.rbrecord-and-playback/core/lib/recordandplayback/edl/media_utils.rb
✅ Automated tests have passed! |



What does this PR do?
In deskshare audio specifically, it's fairly common for the audio stream to stop before the video stream does, leaving a "gap" between the end of the audio stream and the end of the media file as a whole. Seeking into this gap breaks the audio processing, resulting in a hanging ffmpeg process.
Since the audio file gap handling code is already inspecting all of the timestamps, it's easy for it to detect this sort of "gap" at the end of the file, and mark it as a gap to be removed from the EDL, which solves the seek problem.
Closes Issue(s)
Issue was reported privately
Motivation
Processing of some recordings with deskshare were hanging indefinitely, preventing other recordings from processing.
How to test
Reproducing this issue requires a deskshare file where the audio is significantly shorter than the video, and also requires that there is another cut coincidentally during that gap caused by someone joining or leaving the audio on a server using livekit. It's very difficult to intentionally reproduce. I have several real recordings from Blindside Networks hosting which I have tested this change on, but which I am unfortunately not able to share.
Verifying that recordings without issues continue to process correctly is straightforwards.
More