Compute displayed video size2

Rebased version of PR #243 with review comments addressed.