Preparing video for Matlab analysis