ali1234 / vhs-teletext

Software to recover teletext data from VHS recordings.
GNU General Public License v3.0
179 stars 21 forks source link

Clicking on the vbiview window prints the line, but throws an "out of bounds" error and crashes #82

Open PEevoo opened 6 months ago

PEevoo commented 6 months ago

Recently, I've been facing with this issue where I click on a line, inside vbiview, and it crashes, throwing an out of bounds error:

    print(md, s[steps])
IndexError: index 1838 is out of bounds for axis 0 with size 1440
GLUT Mouse callback <bound method VBIViewer.mouse of <teletext.vbi.viewer.VBIViewer object at 0x0000022E533F8AF0>> with (0, 0, 46, 135),{} failed: returning None index 1838 is out of bounds for axis 0 with size 1440

With some help, I managed to fix it, by changing the number "2048" on this line of viewer.py: steps = np.floor(np.linspace(0, 2048 - 5, num=11)).astype(np.uint32)[[1, 5, 9]]

to

steps = np.floor(np.linspace(0, 1440 - 5, num=11)).astype(np.uint32)[[1, 5, 9]]

Card used: Hauppauge USB-Live2 (SAA7131)