Log in

View Full Version : Dynamic Decimation


420MuNkEy
5th February 2010, 01:07
I have a progressive video I need to repair. For the most part, every 5th frame is a duplicate, but when stepping through it frame by frame I see that every once in a while the duplicate frame might come 1 frame early and sometimes the frame duplicates twice and sometimes the frame doesn't even duplicate.

So, for example (N=Normal, D=Duplicate):
N N N N D N N N N D N N N D N N N N D N N N N D D N N N N N N N N N


I can't seem to find a pattern that would both remove all the duplicate frames and leave the normal frames. I thought about doing conditional frame comparison, but that would remove any two empty frames (black) next to each other. Anyone know something that could help?

Guest
5th February 2010, 01:10
TDecimate() with appropriate selection of the cycle and cycleR parameters.

420MuNkEy
5th February 2010, 02:25
Thanks for the reply.
This is working for everywhere except where there is multiple duplicates in a row. There isn't a static m-in-n setting that is repeated throughout the video.
For example, 100 frames in a row could be normal (1 duplicate every 5 frames), and then the next 100 frames could be filled with frames that duplicated twice and the next 100 frames with no duplicates at all.
The video isn't sectioned up that nicely, but I'm just trying to explain, it's a mixed bag. Is there anything else I could try?

Guest
5th February 2010, 03:23
It's easy to remove all the duplicates, but it causes two complications.

1. If the duplicates are non-uniformly distributed, A/V sync will wander.

2. The resulting video duration is now shorter than the audio duration. If the result is some non-standard rate, then you probably will just have to add fields/frames anyway to reach a standard rate. Or retain the weird rate and compress the audio; who wants that?

So just choose the best cycle/cycleR producing a standard frame rate that you can find.