Hi to all, I got this problem that I can't just solve algorithmically.
Let's say i have a video capture that always captures video frames at a fixed rate F (let's say 30 frames per second).
What I want is to "split" this frame sequence in n (say four) subsequences. Each subsequence has its framerate fn, that's obviously < F. Frames in a subsequence are equally spaced in time, so for example some valid 10 fps sequence f1 will be contructed like that for F = 30 fps and time = 1 second:
(0s are frames that don't belogn to the subsequence, 1s are frames that do):
100 (in 1 second it will repeated like: 100100100100100100100100100100)
or
010 (again, in 1 sec it will go like: 010010010010010010010010010010)
or, for F = 30 and f = 8:
100000001
(and it would take MCD (30,8) = 120 frames before a second restarts with an "1").
The problem is that subsequences can't collide, so if F=30, f1 = 10 fps (every three frames) and f2 = 5 fps (every six frames), this sequence is ok:
102100 (again, in a second: 102100102100102100102100102100)
But if we add f3 = 6 fps
132100 (1 AND 3) <--- collides! 02100102100102100102100
or
102103102130102 (1 AND 3) <--- collides! 00102100102100
The third subsequence would collide with the first.
The question is:
- Is there a way to find every combination of the framerates of the n (with n <= 4) subsequences that won't collide and would be equally spaced?
(I need the general case, but in this particular case, I would need all the valid combinations for one sequence only (trivial), all the valid combinations for two sequences, all the valid combinations of three sequences, and all for four sequences).
Hope someone could enlighten my mind. Thank you!