try and cherry pick changes i need for capturing a video buffer