k started at 0 which meant that while it was intended to search back to front so it would be "total # of frames - k frames", doing [-k:] when k is 0 was actually [0:] (front to back). By changing the loop to start at 1 instead, it now searches back to front where it should.
The reason why it was alternating was that the last two parameters (..., len(print1) / 16) - k, 0) assume that the [-k:] thing is back to front. The matching was working properly but the offsets used to figure out where the matched frames are was wrong for the first episode in each pair.
Changes
ffmpeg_fingerprint.py
to optionally not delete theframes
folder after runningIssues
This line: https://github.com/mueslimak3r/tv-intro-detection/blob/ccbc50f9060ea2ddf67bd476cd9285a3a8aa8c06/decode.py#L105
k started at 0 which meant that while it was intended to search back to front so it would be "total # of frames - k frames", doing [-k:] when k is 0 was actually [0:] (front to back). By changing the loop to start at 1 instead, it now searches back to front where it should.
The reason why it was alternating was that the last two parameters
(..., len(print1) / 16) - k, 0)
assume that the [-k:] thing is back to front. The matching was working properly but the offsets used to figure out where the matched frames are was wrong for the first episode in each pair.