backport video scaling