This is probably childs play for most of you… But I lack the
experience/knowledge at this time, to do what I have in mind, in any
language (let alone Ruby). Side effect of working two jobs and being
very selective of what I do during downtime I suppose…
I guess I’ll start by what I am trying to do. I would make it a
point that I’m trying NOT to have prefab code handed to me, or others
do all the work - unless it really is that simple a task. But
recommended reading on functions, or good places I might find an
explanitory “learn as you copy the examples” type lesson on this
subject would be nice as well.
This is largely to be a one time, throw-away bit of code I guess, as
I only need to use it a couple times.
I will be reading in pattern matches from a Yatta (Yet Another
Telecide Tool for Anime) project file, and the goal is to look at
groups of 5 frames at a time for their pattern, and then mark a
specific frame for decimation, in an overrides file, for the
decimation utility I use. However manually parsing 10’s of
thousands of frames is a laborious task at the least and the big
problem with pattern matching is that no -current- method is fool
proof except the manual way. In Anime especially, the pattern can
shift at any time, or you may run into a section of 30fps video that
you want to avoid decimating at all.
YATTA is a great tool, but still too time consuming for me to use when
it comes to manual IVTC. So I am looking into the possibility of
writing a small utility that will import those pattern matches, in
blocks of 5 frames at a time, and compare them against a pre-defined
list of possible patterns, until the program finds an exact match, can
ID what frame that match is, and specify that frame number in the
The problem is… How do I generate all possible combinations of a 5
letter pattern, using only the letters “C” and “N” (the only
letters used by the particular IVTC filter I am using to ID frames)
i.e I may have a group of 20 frames that follows the standard
telecine pattern of
CCCNN CCCNN CCCNN CCCNN
But then it may shift out of nowhere into NNCNC or CCNCN or any
other possible 5 digit combination of those letters. Then it may
shift back again only after 5 frames, to the previous pattern. The
point is that the pattern can shift at any time, in any place,
sometimes even in the middle of a 5 frame section.
I think I can work out the program itself. But I am looking for a
quick and easy way to generate every possible 5 digit combination of
the letters " C" and “N” so I have the database I need to compare
each 5 frame segment.
Any helpful code, links, or suggestions would be appreciated.