Improve height detection in frame + extract to file.