[1, 2, 3, 4, 8, 9, 10, 20] should become [(1, 5), (8,11), (20, 21)]
The seconds only mean it start's at this second. So the end value has to be incremented.
You might want to think about going down to the level of frames. I imagine a change in brightness that takes one second would be not much of a problem for people with epilepsy.
for example:
[1, 2, 3, 4, 8, 9, 10, 20] should become [(1, 5), (8,11), (20, 21)] The seconds only mean it start's at this second. So the end value has to be incremented.