Commit Graph

1117 Commits

Author SHA1 Message Date
Calvin Walton
67758e1cc9 RaP: Store rendered audio temp file in target directory, not archive_dir
The archive_dir can by the raw recording directory in some recording
formats - including, hopefully, presentation at some point (to avoid the
extra copy)
2018-06-20 16:29:49 -04:00
Richard Alam
14327a1edf Merge branch 'v2.0.x-release' of github.com:bigbluebutton/bigbluebutton into merge-v20-branch 2018-06-19 12:58:51 -07:00
Calvin Walton
c97f0cb33a RaP: Calculate video area sizes using aspect ratio
The previous calculation used the video size in pixels, which might lead
to stretched/squashed videos in rare cases where the video has non-square
pixels. The new calculation is correct for all video sizes.
2018-06-13 11:18:54 -04:00
Calvin Walton
9c3faf2830 RaP: Fix video start_time checking
The video_info function returns the start time already in milliseconds,
so compare against 1ms instead of 1/1000.
2018-06-13 11:18:54 -04:00
Calvin Walton
6388e55209 RaP: Support ffmpeg 4.0 in video processing scripts
The ffprobe command in ffmpeg 4.0 now omits the aspect ratio fields in the
json output when indeterminate, instead of returning an invalid value with
0 in the numerator or denominator. Handle this correctly.
2018-06-13 11:18:54 -04:00
Richard Alam
a2eaa9babd Merge branch 'master' of github.com:bigbluebutton/bigbluebutton into 21-and-20-merge-working-branch
- some conflicts have been fixed.

The following needs working on:

       both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatCopy.as
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatSaver.as
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatTab.mxml
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindowEventHandler.as
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as
        both modified:   ../bigbluebutton-client/src/org/bigbluebutton/modules/users/views/MediaItemRenderer.mxml

Parking as need to work on something else.
2018-06-06 08:23:13 -07:00
Calvin Walton
4554e3eac7 RaP: Workaround broken seeking in flv after red5 update.
Since the update to the newer red5, seeking in flv files (webcams in
particular are noticable) has been broken, resulting in cameras
appearing to "hang" any time there is a cut in the generated video -
which happens when start/stop button is pushed, or when cameras are
added or removed.

We can detect the problematic video files because the timestamp of the
first frame is large (old red5 versions always set first frame
timestamp to 0.001 seconds). If we see a file like this, having ffmpeg
remux the file - rewriting the timestamps and index - works around the
problem.
2018-05-30 11:41:45 -04:00
Calvin Walton
7d643f9bf8 RaP sanity: Don't delete .ser file unless repair succeeded 2018-05-23 12:03:20 -04:00
Calvin Walton
9cdafbdfe7 RaP: Merge the sanity script from master branch
Due to improvements in the recording scripts, most of the stuff the sanity
script was checking for is no longer needed (missing/corrupt video files
are handled by the processing scripts). The version of this script in
master has been cleaned up so that the only things it does are:

- Check that the events.xml exists and is properly formatted xml
- Rebuild flv files from red5 .flv.ser/.flv.info files

The script from master is compatible with the 2.0 code, so just use it
as-is.

This fixes a problem where following the recent red5 upgrade in 2.0 branch,
an flv file is never written for webcam streams where no frames were
received, despite there being recording events.
2018-05-23 11:18:04 -04:00
Calvin Walton
36a6b0f5ac RaP: Scale to a square when generating slide images for pres. format
This improves the quality of portrait documents, before they were
1200px when landscape documents got 1600px.

Switching to scaling to a square means that we can use the "-scale-to"
option on pdftocaio, which means that it generates images directly
at the desired size. This can save quite a bit of time (and memory)
if a document was uploaded with extremely large page size.
2018-05-16 11:54:35 -04:00
Calvin Walton
18d472e3a3 RaP: Improve check for record events in archive, sanity scripts
There's some cases where you can get 0-duration recordings due to
recording event placement (e.g. a single recording event is the last
event in the events.xml). Detect these cases, and treat them like
no recording marks in the archive script (it will stop the recording
from being automatically processed).

I've also adjusted the sanity script to detect these cases and error
out. The recording processing scripts cannot handle 0-length recordings,
you have to manually edit the events. I've added a message to the
sanity log about this.
2018-05-16 11:32:29 -04:00
Calvin Walton
32ff8b9f24 RnP: Fix bitrate in screenshare.yml
I forgot to include the 'K' multiplier on the bitrate values, so they
were all 1000 times too low.
2018-05-11 11:58:54 -04:00
Calvin Walton
e034b9c7ae Fix handling webcam videos that end early in recording processing
In some cases (due to network issues), the webcam video can be shorter
than the time between the start/stop events. Pad the input video with a
blank video to make sure that there's input to the video tiling filters,
to fix a problem where the video won't render correctly with ffmpeg v3.4
and later.
2018-05-07 13:21:11 -04:00
Fred Dixon
76296b95df
Merge pull request #5429 from kepstin/screenshare-video-rec
New "screenshare" recording format
2018-04-27 16:41:51 -04:00
Calvin Walton
eb04276897 Minor fixups from testing 2018-04-27 15:25:36 -04:00
Calvin Walton
ca198ee9ce
Merge pull request #5385 from lfzawacki/html5-video-recording
HTML5 recording of cameras and screenshare
2018-04-26 19:11:36 -04:00
Calvin Walton
21bd4b2673 Screenshare-focused video recording format. 2018-04-26 17:00:30 -04:00
Fred Dixon
c3c9aacf9e
Merge pull request #5417 from kepstin/podcast
Podcast recording format
2018-04-26 16:01:45 -04:00
Calvin Walton
60b828bea1 Fix some syntax issues 2018-04-26 15:24:16 -04:00
Calvin Walton
56baecdf9c Podcast recording format
Generates a single .ogg file containing the meeting audio
2018-04-26 15:06:52 -04:00
Felipe Cecagno
77d620a721 Fix recording events when there's screenshare AND webcams together 2018-04-26 01:24:41 +00:00
Lucas Fialho Zawacki
80562ac25c Merge branch 'webrtc-webcams' of https://github.com/kepstin/bigbluebutton into html5-video-recording 2018-04-25 20:02:45 +00:00
Calvin Walton
bfcaa5aaa3 Check for new webrtc deskshare event in presentation slide code 2018-04-25 16:00:13 -04:00
Calvin Walton
954ee4fc18 Events code doesn't know where archive dir is 2018-04-25 15:08:35 -04:00
Calvin Walton
9ada59d1c4 Fix more variable references in screenshare events 2018-04-25 15:04:01 -04:00
Lucas Fialho Zawacki
419adcf926 Merge branch 'webrtc-webcams' of https://github.com/kepstin/bigbluebutton into html5-video-recording 2018-04-25 18:30:43 +00:00
Calvin Walton
cd3e28a08c Fix some errors in screenshare archive/sanity 2018-04-25 14:28:37 -04:00
Lucas Fialho Zawacki
c0b3003918 Merge branch 'webrtc-webcams' of https://github.com/kepstin/bigbluebutton into html5-video-recording 2018-04-25 16:02:30 +00:00
Calvin Walton
ca0156d423 Support WebRTC screenshare in get events functions 2018-04-25 11:55:02 -04:00
Calvin Walton
39e981a7f2 Include webrtc screenshare streams in edl for video rendering 2018-04-25 11:44:23 -04:00
Calvin Walton
9f528e37fe Archive kurento screenshare streams 2018-04-25 11:35:36 -04:00
Fred Dixon
7f0d8db451
Merge pull request #5392 from kepstin/recording-webcam-fix
Fix handling webcam videos that end early in recording processing
2018-04-24 17:01:47 -04:00
Calvin Walton
8e0a79014f Fix handling webcam videos that end early in recording processing
In some cases (due to network issues), the webcam video can be shorter
than the time between the start/stop events. Pad the input video with a
blank video to make sure that there's input to the video tiling filters,
to fix a problem where the video won't render correctly with ffmpeg v3.4
and later.
2018-04-24 16:58:14 -04:00
Calvin Walton
ce84c5517b Include webrtc webcams in recording processing 2018-04-24 15:20:35 -04:00
Calvin Walton
c45fa74da0 Archive the webcam files from kurento webcam sharing 2018-04-24 15:18:02 -04:00
Calvin Walton
cafa9fd822 Rework audio processing to avoid seeking past end of file
In some cases when there is a slight mismatch between audio file
duration and event timestamp difference, and we have a record
status or chapter break event in a certain location, it could
trigger a seek past the end of an audio file. Detect this
condition and just render silence instead.

Also adjust the thresholds for the audio length scaling - they
were being triggered on short recordings that should be correct.
2018-02-13 12:45:58 -08:00
Calvin Walton
e30d5e3940 Rework audio processing to avoid seeking past end of file
In some cases when there is a slight mismatch between audio file
duration and event timestamp difference, and we have a record
status or chapter break event in a certain location, it could
trigger a seek past the end of an audio file. Detect this
condition and just render silence instead.

Also adjust the thresholds for the audio length scaling - they
were being triggered on short recordings that should be correct.
2018-02-12 16:33:37 -05:00
Richard Alam
bca27c4838
Merge pull request #5136 from kepstin/segmented-recording
Archive events.xml file in a concurrency-friendly way.
2018-02-12 14:28:37 -05:00
Calvin Walton
c1258ed387 Archive events.xml file in a concurrency-friendly way.
With the current segment processing, we might be processing one segment
while archiving a different segment from the same recording. To avoid
that the processing scripts see an incomplete events.xml file, write to
a temp file then rename.
2018-02-12 14:04:46 -05:00
Calvin Walton
c44d94b498 Workaround video sync issue due to red5 timestamp offset
Red5 sometimes writes webcam video files with a large offset in the
video frame offsets, sometimes up to 30 or even 60 seconds. However,
the start event in the events.xml file corresponds to the time at
which red5 received the first keyframe (recorded frame) in the video.

The end result is that the video will sometimes appear to be
delayed (out of sync) in the processed recording.

The correction is simple: We're already reading video metadata,
including the timestamp of the first frame, so we just have to apply
a correction during video processing to undo the frame timestamp
offsets in the video file.
2018-02-12 10:22:36 -08:00
Calvin Walton
0701bf87a8 Workaround video sync issue due to red5 timestamp offset
Red5 sometimes writes webcam video files with a large offset in the
video frame offsets, sometimes up to 30 or even 60 seconds. However,
the start event in the events.xml file corresponds to the time at
which red5 received the first keyframe (recorded frame) in the video.

The end result is that the video will sometimes appear to be
delayed (out of sync) in the processed recording.

The correction is simple: We're already reading video metadata,
including the timestamp of the first frame, so we just have to apply
a correction during video processing to undo the frame timestamp
offsets in the video file.
2018-02-12 11:54:18 -05:00
Calvin Walton
d8c0f7a67d Don't delete video events in the sanity script.
When working with the segmented recording format, the events file might
end with a mismatched start video event for an incomplete file. The
sanity script was removing this event, meaning the video didn't show up
in future segments.

Simply drop the code that tries to find invalid video files and removes
them from the events file. The new video processing code is already
robust against missing or corrupt files.
2017-12-14 14:43:31 -05:00
Richard Alam
e13a68377c Merge branch 'v2.0.x-release' of github.com:bigbluebutton/bigbluebutton into synch-with-v2.0 2017-11-20 08:42:46 -08:00
Calvin Walton
7362eb1eaf Update gems for security fixes, remove some unused. 2017-11-17 14:36:24 -05:00
Calvin Walton
feee34c144 Fix parsing meeting id for segments in publish step 2017-11-10 13:10:58 -05:00
Calvin Walton
d35dd90530 Applying segment breaks after recording marks doesn't work
The timestamps no longer line up after applying one edit, so these
have to be all done at the same time in one step.
2017-11-09 13:48:27 -05:00
Calvin Walton
abdb639e01 Bump bbb version to 2.1 so we can identify the new events
BBB 2.1 has multiple presentation pods and multiple chats, so the messages
for those have been altered.
2017-11-08 17:06:00 -05:00
Calvin Walton
eeb171cfc8 Add helper function that applies chapter breaks to record start/stop
This allows re-using some existing start/stop supporting processing
scripts to generate chapter recordings.
2017-11-08 13:49:24 -05:00
Calvin Walton
e2b40cc5bd Rework a bunch of the code to avoid repeatedly reparsing the events.xml 2017-11-08 10:12:25 -05:00
Calvin Walton
ab1019bf14 Set up rap publish/process scripts for segments 2017-11-07 11:50:28 -05:00
Calvin Walton
4e243536c7 Handle the no audio files case a bit better
If no audio files were found, it was running rsync with one argument,
which is a bit unexpected. It just printed a file list in this case, but
we can provide a cleaner error message instead.
2017-11-07 10:03:20 -05:00
Calvin Walton
50f2c1b90b Fix syntax issues in sanity scripts 2017-11-07 09:53:08 -05:00
Calvin Walton
35f7f425e2 Fix break detection in events 2017-11-07 09:52:50 -05:00
Calvin Walton
9add60d81b Fix a bunch of bugs found when testing the archive code 2017-11-06 15:22:43 -05:00
Calvin Walton
5bb5cbcd0e Have archive script check whether a particular segment is recorded
It previously checked whether any part of the entire meeting was recorded.
Helper functions are added to look up the time of segment start and end
(which handle non-segmented recordings correctly too).
Part of the events handling code was rewritten to reduce the number of times
that the events.xml file gets parsed.
2017-11-03 16:12:05 -04:00
Calvin Walton
f9c4843f28 Cleanups, initial work on checking for segment recorded status. 2017-11-03 15:17:04 -04:00
Calvin Walton
0e2785205a Update sanity script for recording segments, fix archive done files 2017-11-03 12:02:36 -04:00
Calvin Walton
037014db94 Adjust sanity rap worker to support segment breaks 2017-11-03 11:27:00 -04:00
Calvin Walton
f5cd1628e0 Trim events list after archive, make archive fail block future segments 2017-11-03 11:16:44 -04:00
Calvin Walton
2c4cadf459 Delete event data from redis after archive writes xml
Todo: we also need to remove the events from the meeting event list
2017-11-03 10:27:52 -04:00
Calvin Walton
a78997d1a1 Work in progress on segment archiving 2017-11-01 12:31:07 -04:00
Calvin Walton
0affb6a36e Make progressive archiving of media files work.
Switch to using rsync to archive video directories, with the -t option
so it'll only update modified/new files.
2017-10-30 15:04:30 -04:00
Calvin Walton
0acb3b5750 Adapt rap-archive-worker to segmented recording done file format 2017-10-30 13:40:53 -04:00
Calvin Walton
b2f8c80202 Handle out of order inserts at the start of a caption stream.
If you're inserting at position 0 (and there was no previous deleted text
from that position), you can't use the timestamp from the previous character
position, since there's no previous character. Use the timestamp of the
following character instead.
2017-10-12 14:16:34 -04:00
Calvin Walton
e37db34eb4 Correctly handle a recording start being the last event in a recording.
In some unusual cases, the recording start can be the last event in the
events file, or at least have the same timestamp as such.

Add some code to check the array bounds and break if needed, so we
don't check the timestamp on the (non-existant) event after the last
event.
2017-10-02 12:31:31 -04:00
Calvin Walton
3307fab99c Don't crash playback if text is not available for a slide.
This happens when the slide is a plain image, for example.
Fixes #4425
2017-09-28 14:34:19 -04:00
Calvin Walton
3f1fb1dc31 Handle recordings that have an unmatched DeskshareStartedEvent
The previous code looked for stop events and tried to find their
associated start event. This obviously doesn't work if there was
no stop event. But if there was a start event, we need to show the
deskshare… so rework to code to try to find the matching stop to each
start instead, and use the end of the meeting if no matching stop was
found.
2017-09-13 17:17:17 -04:00
Calvin Walton
399b1cb543 RnP: Don't fail processing if an image can't be converted to png 2017-09-05 11:21:16 -04:00
Calvin Walton
b810939643 RnP: Fix parsing poll fields as numbers rather than text 2017-08-30 14:51:52 -04:00
Calvin Walton
e81d77a318 RnP: Fix shape type name for poll shapes 2017-08-30 14:42:29 -04:00
Calvin Walton
2d19cd7b7b Make the fallback slide images transparent, so the logo is visible 2017-08-25 16:05:46 -04:00
Calvin Walton
195b499e06 RnP: Fix square/circle rendering
Different parts of the code were using symbol vs string keys, so
the circle/square code never got applied. Use symbols everywhere for
consistency.
2017-08-25 15:46:03 -04:00
Calvin Walton
a3a530553a RnP: Force re-encoding text from textfiles into UTF-8
Some old recordings might have invalid or legacy encoding stuff
in the text files. To allow processing to continue, just re-encode int
UTF-8 with the invalid option set to replace, to remove the invalid
characters.
2017-08-25 14:02:09 -04:00
Calvin Walton
dba121e6f4 Merge pull request #3998 from kepstin/caption-fixes
Update caption track generation based on feedback
2017-08-25 12:04:59 -04:00
Calvin Walton
0d91b9444e RnP: Some shapes in BBB 2.0 now have sharp corners 2017-08-25 11:39:00 -04:00
Calvin Walton
243afcd90c RnP: Make 'presentation_props' a global var so it can be accessed in functions 2017-08-23 12:22:46 -04:00
Calvin Walton
ba1e0e09c2 RnP: Add image id to shape ids
This ensures that the same shape in two different images will
get different ids for each, so that the drawing code will handle it
correctly.
2017-08-21 16:40:53 -04:00
Calvin Walton
62465d4c47 RnP: Convert BBB 2.0 cursor positions to be relative to viewbox
In BBB 2.0, the cursor positions are given relative to the page
size (like annotation positions). Since the recording cursors
aren't actually drawn in the page like annotations, it's more
convenient to have them relative to the visible area (viewbox),
so do that conversion.

While I'm in here - since we switched to new incompatible scripts
for BBB 2.0 anyways - remove an extra factor in the cursor positions
in cursor.xml, and just use a simple ratio of width/height instead.
2017-08-21 14:44:41 -04:00
Calvin Walton
c925a36c7b RnP: Calculate the cursor position based on pan/zoom info 2017-08-21 12:24:19 -04:00
Calvin Walton
08f00eb35e RnP: Fix variable name of bbb 2.0 version check 2017-08-18 17:50:34 -04:00
Calvin Walton
919bb1a60f RnP: Don't unconditionally hide cursor if no updates 2017-08-18 17:45:46 -04:00
Calvin Walton
33a511d800 Move the custom_hash require to publish rap worker where it's used 2017-08-18 17:45:15 -04:00
Calvin Walton
21255cf04a RnP: Hide the cursor when it goes offscreen
Remove the old 'hide cursor on inactivity' code, and just hide the
cursor when the cursor events say it should be hidden.
2017-08-18 17:16:16 -04:00
Calvin Walton
f66d4a2849 RnP: Syntax fixes for presentation text fix... 2017-08-18 17:07:14 -04:00
Calvin Walton
2b51f39c62 RnP: Fix issues in presentation publish
- Need to look in the process dir to find the images (and create new ones)
- Don't set the text attributes on slides that do not have text (logo)
2017-08-18 16:56:45 -04:00
Calvin Walton
1390224efc RnP: Use correct dir to find presentation images 2017-08-18 16:39:18 -04:00
Calvin Walton
dba5cd9196 Various recording script fixes & cleanups
This is just a bundle of a few things I've been fixing up in the past
while.

= Workaround for BBB 1.1 beta deskshare timestamp bug

This is unlikely to be used, but I have the code for it, might as
well merge it in.

= Rework video tiling code for ffmpeg

Render video using the 'hstack' and 'vstack' filters rather than the
'overlay' filter. This is somewhat faster, particularly with lots of
videos.

= Etc.

- Remove usage of the streamio-ffmpeg gem.
  The video rendering code has some stuff to directly read 'ffprobe'
  output, so re-use that instead of this gem (which is kind of old and
  has issues with newer ffmpeg versions).

- Don't hardcode the deskshare video area size, pull it from the
  properties file

- Remove some code that worked around missing video end events.
  In some cases this could cause flickering or strange video issues.
  It's no longer strictly needed, the new tiling code doesn't break if
  the seekpoint is after the end of the video.
2017-08-18 15:24:54 -04:00
Calvin Walton
321119a79e Create a new 2.0 recording playback directory, revert 0.9.0 to old shapes code.
The new shapes code, required for handling smooth shape updates & multi-user
whiteboard in the 2.0 BigBlueButton, hits a bug in old recordings where
the pencil tool incorrectly used "line" in its shape names, meaning that
there could be both a pencil mark and a line with the same shape name.

The old recording code didn't rely on the shape name to match shapes, since
there was no chance of concurrent shapes. As this is an incompatible playback
change, we need to make a new playback directory for the updated files.
2017-08-18 11:34:15 -04:00
Calvin Walton
d24c8f8af2 RnP: BBB <0.9 also had off-by-one on the undo and clear messages 2017-08-17 15:44:13 -04:00
Calvin Walton
04002f687f Revert to the pre-2.0 capitalization of 'userid' in presenter event 2017-08-17 14:29:54 -04:00
Calvin Walton
af4217c53e Set cursor opacity to match BBB flash client 2017-08-17 13:54:42 -04:00
Calvin Walton
50bf20f726 Rewrite recording processing handling of shapes, panzooms, cursor
The old code was very difficult to follow, and I couldn't figure out
a good way to retrofit the BigBlueButton 2.0 undo by shape id and clear
by user id into it - so I rewrote the entire thing instead.

It now generates the shapes.svg, panzooms.xml and cursor.xml all at the
same time during a single pass through the event.xml file. The result
is compatible with the existing recording javascript (at least once a few
minor issues in writing.js were fixed by earlier commits).
2017-08-17 13:33:00 -04:00
Calvin Walton
f0304a120a Handle panzoom at same time as slide change correctly.
Because of the >=, a panzoom at the same time as a slide change was matching
the previous slide rather than the expected new slide.
2017-08-17 11:59:06 -04:00
Calvin Walton
0087139f0d rnp: Fix playback to handle shape updates correctly.
The previous code would cause shapes to "blink" during updating if
the updates weren't continuous - in a gap between updates, the shape
would disappear.

Rework the logic for looking up "current" shapes to return the
nearest previous update rather than only exact matching timestamps,
and simplify the logic that decides whether to make a shape visible
or hidden.
2017-08-14 18:18:16 -04:00
Calvin Walton
aac50a077e Fix dot thickness for degenerate pencil shapes 2017-08-09 14:04:17 -04:00
Calvin Walton
005965e4b1 Pencil commands are strings 2017-08-03 12:42:38 -04:00
Calvin Walton
8a36ac5469 Fix typo in 'commands' variable name 2017-08-03 12:40:56 -04:00
Calvin Walton
05d6859170 Shape commands is spelt with an s 2017-08-03 12:24:35 -04:00
Calvin Walton
98fad425aa Add path 'command' handling for BBB 2.0 smooth drawing 2017-08-03 12:17:48 -04:00
Calvin Walton
8f142b9541 Shape thickness is a percentage, not fraction 2017-08-03 11:41:28 -04:00