Split into three loops to make site accessible even when video encoding is in progress