So everything has to be inside in a html file? That's seems like a rather odd choice, but okay, I guess base64 might be your only option.
That said, I don't see any flicker on the demo you linked to here. Where are exactly do you see flicker? And in what browser and operating system?