@johnmeyer
Opening your source screenshot in Photoshop, selecting the inner image area and displaying a histogramm shows, that the image possibly has undergone a levels adjustment. The levels of the inner area lay in the range 0 ... 255 (well, deepest luma is a bit higher), so that searching for a minium might not land in the border area. After a levels adjustment the borders are not in a deeper black.
Nevertheless in one case the script produced also a bad result with my own recordings. That was recorded from TV with a very cheap PAL VHS recorder.