View Full Version : Getting back to 29.97FPS after doubleweave()


fmctm1sw
5th April 2005, 07:20
I've been digging through documentation and theory of operation for various avisynth functions relating to IVTC. I understand that my capture card captures video without concern for proper telecine patterns as noted in the avisynth documentation. I also understand how doubleweave() can be used to ensure that individual fields are properly matched to combat this. Where I am stuck is how to get this back to 29.97 (or 23.97) and maintain the proper field matching achieved with doubleweave(). I tried pulldown last night and found the first 10 or 15 minutes of my movie was great. After that it appeared the pattern got mixed up and the rest of the movie was horrible. If I use the selectodd() function, the fields of frame c (I have all this written on paper) never match up, even if used in conjunction with telecide(). Painstakingly stepping through all the frames is out of the question. My next idea was to try to use avisynth to step through each frame after doing a doubleweave() and try to determine if it is a duplicate of the previous one and/or try to determine the combed frames and delete accordingly. I am having trouble figuring out how to write that in a language avisynth can understand. Kind of like:

1] Look at frame 1 compared to frame 0 and determine if it is a duplicate. I know decimate() will do this but setting up the parameters looks like it will force it to delete something that I may not want to delete.

or

2] Look at each frame and determine if it is combed or not. How would I use the iscombed() function for this? Then delete the frames determined as combed (after figuring out the proper metrics for determining what exactly is combed and what isn't of course).

After that I would need to make sure the framerate is totally screwed up, which it probably will be. Any help appreciated...

*edit* I actually made some headway with the iscombed() function. After my doubleweave, I set up a scriptclip() and got the threshold() parameter tweaked so that combed frames are being detected very well. The trouble now is that I'm only getting 18 non combed frames out of 60! That won't work well with my DVD player obviously. Oh well, at least I'm off the ground...

ppera2
5th April 2005, 08:18
And what about external AVS filter Decomb?

fmctm1sw
5th April 2005, 08:41
Originally posted by ppera2
And what about external AVS filter Decomb?

I tried this approach as well but then couldn't get the framerate back to 30 (or 24) with pulldown() seemingly because the 2:3 pattern in my movie got changed somewhere. I should have mentioned the target is DVD compliant MPEG-2.

ppera2
5th April 2005, 09:25
Your post is little confusing.
If you capture FILM, but telecined (29.976 fps) with good quality, you must get back progressive 23.97 fps video with Decomb.

If you get jerky movement and interlaced frames in such case then:
1: Source is not FILM
2: It is already screwed up in TV studio, so no chance to get back orig.
3: Too noisy, distorted video
4: Something is wrong by capture - drivers, software etc..

stickboy
5th April 2005, 09:51
Originally posted by fmctm1sw
I tried this approach as well but then couldn't get the framerate back to 30 (or 24) with pulldown() seemingly because the 2:3 pattern in my movie got changed somewhere. I should have mentioned the target is DVD compliant MPEG-2. Don't use Pulldown.

You also don't need to use DoubleWeave.

Just use Telecide() and Decimate() by themselves.

fmctm1sw
5th April 2005, 10:17
Here's why I'm thinking the way I am:

After reading this...

The reason you need to use DoubleWeave first is that capture cards combine fields in the wrong way. In terms of fields, the 3:2 pulldown sequence is simply "A A B B B C C D D D ...", where "A" through "D" represent the original film frames. But the capture cards combine the fields into frames with no respect for the pulldown pattern, and you get this:

A B C D D (30fps)
A B B C D

In this pattern frame C is never shown by itself. After DoubleWeave every pair of fields gets its own frame, so the video stream will begin like this:

A A B B C C D D D (60fps)
A B B B B C C D D
* * * *

Now each movie frame has at least one video frame to itself. At this point the Pulldown filter with arguments of 0,3 will select the frames marked with a *, and you'll get

A B C D (24fps)
A B C D


I understand what this is telling me. I base my assumption that Telecide() by iteslf will not work correctly on the first example on the theory of operation I read in the manual.

Here's what Telecide does by default. When it receives a request for a frame it gets access to the next frame and the requested one (called the current frame). Here is what he sees (where N=next, C=current, t=top field, b=bottom field):

Ct Nt
Cb Nb

Telecide makes 2 combinations of frames from the available fields. Here are the combinations:

Nt
Cb

Ct
Cb

Now both of these frames are checked for combing. The least combed frame is the output frame (assuming no pattern guidance). It is that simple.


In the first scenario, the top and bottom of field c will never be shown together with telecide(). That's why I'm experimenting with other ways to do this. The doubleweave() step ensures the all frames are shown as intended. The trouble there is, you have to get rid of half of them. I have also struggled with that. Pulldown() worked well for a while. Somewhere along the line, I believe the telecine pattern got changed in the movie and the wrong frames got deleted. I was able to get the iscombed() function to work for me but after doubleweave(), I noticed I only had 18 progressive frames out of 30. I suppose I could go back to doubleweave() and pulldown(), then use showfiveversions() to check each of the pulldown patterns. Then get the frame number at which point things go wrong and somehow use avisynth to apply different pulldown to different segments of the video. I don't know, maybe I'm just way overdoing this...

*edit* Part of the problem is that my doubleweave() doesn't come out anything like what is described. I end up with 5 combed frames in a row.

*edit 2* I am confounded by only having 18 progressive frames out of 30 also. I thought film stuff (this is a simple movie) was supposed to have 24. Maybe it's getting too late tonight... :(

Guest
5th April 2005, 14:25
Originally posted by fmctm1sw
In the first scenario, the top and bottom of field c will never be shown together with telecide(). No, that's not correct. Do you think if Telecide() didn't work with BFF clips, it wouldn't have been reported and fixed by now???

Telecide() has the order parameter that tells it which field to match on. I agree that the APPENDIX could be revised to explain that better.

It works like this. Consider:

A B
C D

For the first frame, if order=1, the matches CA and CB are considered; if order=0, the matches AC and AD are considered.

The order parameter was added to eliminate the need for testing backward matches. That made it faster and eliminated some cases where allowing backwards matches could skip a frame. You can still turn on backward matching via an option, but in the vast majority of cases it isn't needed.

fmctm1sw
5th April 2005, 23:12
Originally posted by neuron2
No, that's not correct. Do you think if Telecide() didn't work with BFF clips, it wouldn't have been reported and fixed by now???

Telecide() has the order parameter that tells it which field to match on. I agree that the APPENDIX could be revised to explain that better.

It works like this. Consider:

A B
C D

For the first frame, if order=1, the matches CA and CB are considered; if order=0, the matches AC and AD are considered.

The order parameter was added to eliminate the need for testing backward matches. That made it faster and eliminated some cases where allowing backwards matches could skip a frame. You can still turn on backward matching via an option, but in the vast majority of cases it isn't needed.

I cetainly didn't mean any disrespect for the tools. This obviously stems from me not understanding how it works. I assumed that the A's were suppose to line up with the A's and the B's with the B's, etc.

Guest
5th April 2005, 23:28
Originally posted by fmctm1sw
I assumed that the A's were suppose to line up with the A's and the B's with the B's, etc. Well, that's correct! I used the A B C D notation just to unambiguously refer to the 4 fields. It doesn't mean they come from four frames A B C and D. In the original notation:

Ct Nt
Cb Nb

For TFF, we compare Cb-Ct and Cb-Nt. For BFF, we compare Ct-Cb and Ct-Nb.

Sorry for equivocating on the notation. Is it clear now?

fmctm1sw
6th April 2005, 09:11
Originally posted by neuron2
Well, that's correct! I used the A B C D notation just to unambiguously refer to the 4 fields. It doesn't mean they come from four frames A B C and D. In the original notation:

Ct Nt
Cb Nb

For TFF, we compare Cb-Ct and Cb-Nt. For BFF, we compare Ct-Cb and Ct-Nb.

Sorry for equivocating on the notation. Is it clear now?

I think that's what confused me. For TFF, we use the bottom field for comparison and for bottom, the top is used... Thanks!