Rework video initialization and shutdown.
A window is only opened when required.