Merge pull request #5478 from kepstin/recording-updates-21

Fix handling webcam videos that end early in recording processing
This commit is contained in:
Calvin Walton 2018-05-07 13:41:38 -04:00 committed by GitHub
commit b312b35859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,8 +403,8 @@ module BigBlueButton
else else
# Webcam videos are variable, low fps; it might be that there's # Webcam videos are variable, low fps; it might be that there's
# no frame until some time after the seek point. Start decoding # no frame until some time after the seek point. Start decoding
# 30s before the desired point to avoid this issue. # 10s before the desired point to avoid this issue.
seek = video[:timestamp] - 30000 seek = video[:timestamp] - 10000
seek = 0 if seek < 0 seek = 0 if seek < 0
end end
@ -443,10 +443,18 @@ module BigBlueButton
ffmpeg_filter << ",fps=#{FFMPEG_WF_FRAMERATE}:start_time=#{ms_to_s(video[:timestamp])}" ffmpeg_filter << ",fps=#{FFMPEG_WF_FRAMERATE}:start_time=#{ms_to_s(video[:timestamp])}"
# Reset the timestamps to start at 0 so that everything is synced # Reset the timestamps to start at 0 so that everything is synced
# for the video tiling, and scale to the desired size. # for the video tiling, and scale to the desired size.
ffmpeg_filter << ",setpts=PTS-STARTPTS,scale=#{scale_width}:#{scale_height}" ffmpeg_filter << ",setpts=PTS-STARTPTS,scale=#{scale_width}:#{scale_height},setsar=1"
# And finally, pad the video to the desired aspect ratio # And finally, pad the video to the desired aspect ratio
ffmpeg_filter << ",pad=w=#{tile_width}:h=#{tile_height}:x=#{offset_x}:y=#{offset_y}:color=white" ffmpeg_filter << ",pad=w=#{tile_width}:h=#{tile_height}:x=#{offset_x}:y=#{offset_y}:color=white"
ffmpeg_filter << "[#{pad_name}];" ffmpeg_filter << "[#{pad_name}_movie];"
# In case the video was shorter than expected, we might have to pad
# it to length. do that by concatenating a video generated by the
# color filter. (It would be nice to repeat the last frame instead,
# but there's no easy way to do that.)
ffmpeg_filter << "color=c=white:s=#{tile_width}x#{tile_height}:r=#{FFMPEG_WF_FRAMERATE}"
ffmpeg_filter << "[#{pad_name}_pad];"
ffmpeg_filter << "[#{pad_name}_movie][#{pad_name}_pad]concat=n=2:v=1:a=0[#{pad_name}];"
tile_x += 1 tile_x += 1
if tile_x >= tiles_h if tile_x >= tiles_h