We encountered this problem designing and developing a site with a hero section that features a dark colored background and mp4 video animation. No matter what we did, we could not get the background color of the video to match the background color of the hero. (And to make things extra fun, the colors looked different on different browsers, mobile, etc.)
Our creative hack?
We made the entire hero background an Mp4 (4×4 pixels).
This ensures that the colors match.
Solves the problem? Absolutely.