bigbluebutton-Github/record-and-playback/core
Calvin Walton d402f519c6 fix(recording): Deskshare audio processing hang
This is a refinement of the fix introduced in 3c1a9cd7c4.

Further investigation of the issue reveals that the cause of the bad
timestamps which result in error messages or hang is when the `apad`
filter does not receive any input audio frames. This happens if the
seekpoint is after the end of audio. The existing seekpoint checks can't
cover this, because in a deskshare file the video stream can continue on
after the audio stream ends.

The `,asetpts=N` filter was added to deal with this problem, and it
works in most cases. But there is a case where it fails - when the
"mismatched length" audio stretching to work around broken recordings
from BigBlueButton 0.81/0.90 kicks in.

The issue there is that the `atrim=start=S` filter (used due to the
difficulty of calculating seeks when stretching) hits the invalid
timestamps and hangs.

I'm working around this issue with a "defense in depth" combination of
two changes:

* Move the `,asetpts=N` filter to be applied before the audio stretch
  filters. This fixes the processing hang.
* Adjust the conditions on the "mismatched length" audio stretching so
  that it only gets applied on audio files likely to be from extremely
  old BigBlueButton versions - those with audio in wav files, or encoded
  to vorbis.

BigBlueButton has been using audio recorded directly to opus by
FreeSWITCH for quite a while, and the handling for gaps or lost packets
is done in current BBB versions by a combination of the libopus decoder
and the use of ffmpeg's `aresample=async=1000` filter to dynamically
stretch, squish, or fill in audio so it becomes a continuous stream
that's locked to the file timestamps. Applying the "mismatched length"
processing on top of that is probably making audio sync issues worse.
2023-10-03 14:21:50 -04:00
..
features Remove a few matterhorn references that were missed. 2016-09-02 17:45:10 -04:00
lib fix(recording): Deskshare audio processing hang 2023-10-03 14:21:50 -04:00
resources/raw recording: Anonymize names in chat 2021-09-02 15:02:27 -04:00
scripts fix(recording): handle archive remux failures 2023-09-07 11:57:55 -03:00
spec Include webrtc webcams in recording processing 2018-04-24 15:20:35 -04:00
systemd Merge tag 'v2.5.3' into merge25-26-jul14 2022-07-15 11:08:02 -03:00
test/recordandplayback recording: Enforce minimum length of video segments 2023-02-16 11:46:45 -05:00
.gitignore recording: Anonymize names in chat 2021-09-02 15:02:27 -04:00
Gemfile fix: record-and-playback/core/Gemfile & record-and-playback/core/Gemfile.lock to reduce vulnerabilities 2023-08-20 20:05:57 +00:00
Gemfile.lock fix: record-and-playback/core/Gemfile & record-and-playback/core/Gemfile.lock to reduce vulnerabilities 2023-08-20 20:05:57 +00:00
Rakefile recording: Anonymize names in chat 2021-09-02 15:02:27 -04:00