rearrange video processing to avoid duplication