pythonic-cv icon indicating copy to clipboard operation
pythonic-cv copied to clipboard

VideoReader Looping/Bouncing

Open ES-Alexander opened this issue 5 years ago • 1 comments

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 avatar Oct 11 '20 06:10 ES-Alexander

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.
'''

ES-Alexander avatar Oct 11 '20 06:10 ES-Alexander