ES-Alexander / pythonic-cv

Performant pythonic wrapper of unnecessarily painful opencv functionality
MIT License
41 stars 2 forks source link

VideoReader Looping/Bouncing #7

Open ES-Alexander opened 3 years ago

ES-Alexander commented 3 years ago

Would be useful to be able to loop videos back to the start once reaching the end, or even bounce between the start and end.

ES-Alexander commented 3 years ago

Spent a bit of time trying to implement this but couldn't get it working at the time.

Proposed interface is a loop variable in the VideoReader initialisation, where:

'''
'loop' is a boolean specifying whether or not to continually restart 
    playback when out of frames, or a positive integer specifying the 
    number of times to restart playback, or a negative integer 
    specifying the number of times to bounce playback. Start and end
    points are respected when looping/bouncing.
'''