Some applications lie to xwininfo about their geometry, but the true information is still available.
TIL that x264 requires height and width to be divisble by 2. Also you have to cat filenames if you want to read them. Derp.
Totally redesigned the whole script. It's a lot nicer now :D