Basic stuff for dealing with raw video, plus some stuff that should be split out elsewhere