/bin/sh compatibility, video resolution as variable, flush cache on each iteration