Log in

View Full Version : Apply 3:2 Pulldown


speedyrazor
15th February 2015, 08:28
I have a 23:98 video which I want to go to 29.97 via 3:2 pulldown. What would the avisynth script be to achieve this?
I can see plenty of stuff around to remove 3:2, but can't find anything to apply it.

Kind regards.

Reel.Deel
15th February 2015, 09:51
AviSynth has an internal pulldown filter: http://avisynth.nl/index.php/Pulldown

A better alternative might be a tool that can apply the pulldown after encoding:

DGPulldown (http://rationalqm.us/dgpulldown/dgpulldown.html)
DGAVCPulldown (http://rationalqm.us/mine.html#tools)

TheSkiller
15th February 2015, 12:21
There is an example in the AviSynth doc actually, hidden in the SelectEvery() section.


AssumeTFF()
SeparateFields()
SelectEvery(8, 0,1, 2,3,2, 5,4, 7,6,7)
Weave()


Or:

ChangeFPS(60000,1001)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()



However, as Reel.Deel was suggesting, if possible soft-pulldown should be preferred. If you are mixing native 29.97 content with 23.976p content (on the same timeline) it's much easier to go with hard-pulldown though.

colours
15th February 2015, 15:14
AviSynth has an internal pulldown filter: http://avisynth.nl/index.php/Pulldown

Misleadingly enough, Pulldown is for undoing 3:2 pulldown, not for doing it.

speedyrazor
15th February 2015, 15:16
ChangeFPS(60000,1001)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()


The second example worked a treat for me thanks.
I now need to know how to take a 25fps progressive source, slow it down to 23.976 via a speed change, then apply 3:2 pulldown in the same script.

I am trying this, but its now working:

LSMASHVideoSource(source="Source_25p.mov", format="YUY2")
Spline64Resize(720, 480)
AssumeFPS(2997, 125)
ChangeFPS(60000,1001)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()

Any ideas how this can be done please?

colours
15th February 2015, 16:59
"23.976" fps usually means 24000/1001, not 23976/1000; try changing the AssumeFPS line to AssumeFPS(24000,1001).

Also, you can't just say "it's not working" without providing any more details and then expect us to exercise our psychic debugging powers to figure out how exactly it's not working…

Reel.Deel
15th February 2015, 17:16
Misleadingly enough, Pulldown is for undoing 3:2 pulldown, not for doing it.

Indeed you are correct. I've never used Pulldown() but going by the name I thought that would be it. I even read the first paragraph, which is also misleading...

TheSkiller
15th February 2015, 20:22
I now need to know how to take a 25fps progressive source, slow it down to 23.976 via a speed change, then apply 3:2 pulldown in the same script.Give us some more details about what you are doing and trying to accomplish.
Technically you don't have to slow down a 25p video to 23.976 and then apply traditional 3:2 pulldown – you might as well leave the video at 25 fps speed and apply pulldown to 25p. Works the same. Only difference is the resulting pattern is somewhat uncommon, but not that it would be a problem.

The script to do that would be exactly the same (the second one with ChangeFPS).

So unless you have a good reason to slow down from 25 to 23.976 (such as it has been speed up before) I suggest not to do it and apply pulldown to 25p right away, saving you from having to change the speed of the audio (which can be nasty).

Stereodude
15th February 2015, 23:22
Just say no to telecining! :)

Interlaced encoding is evil. Pulldown flag the encode if you must.

TheSkiller
16th February 2015, 00:48
Pulldown flag the encode if you must.We don't know yet what the OP is up to but if you're mixing native 29.97 content with 24p content on the same timeline hard-pulldown is pretty much the only option.

speedyrazor
16th February 2015, 08:08
I need to take a 25p file, and get to 29.97. I need to apply standard 3:2 pulldown, so I end up with a Prores 29.97 which has standard 3:2 applied.

TheSkiller
16th February 2015, 12:37
I need to take a 25p file, and get to 29.97. I need to apply standard 3:2 pulldownI don't get it. Why does it have to be standard 3:2 pulldown? The resulting file will be 29.97i anyways, so why does the pulldown pattern matter?

videoh
16th February 2015, 17:15
I need to take a 25p file, and get to 29.97. I need to apply standard 3:2 pulldown, so I end up with a Prores 29.97 which has standard 3:2 applied. You simply can't get 29.97 from 25 fps with standard 3:2 pulldown.

johnmeyer
16th February 2015, 17:45
You simply can't get 29.97 from 25 fps with standard 3:2 pulldown.That is absolutely correct. Perhaps the OP doesn't understand what "3:2 pulldown" actually does.

You can take a video of any speed and, by adding repeated fields (fields, not frames) you can let that video be played back on a device that is hard-wired to play at a different number of frames per second, but still maintain the correct playback speed so it doesn't look like slow motion or time lapse.

So, as has already been stated, there is absolutely no reason to slow down your 25 fps to 23.976, and then apply 3:2 pulldown. That would be the wrong thing to do, unless you want your video to play in slow motion. Instead, simply apply the same code that you used for the 24 fps material, and use it for the 25 fps material. It will create a different pulldown pattern, with fewer repeats, but the resulting video will play at 29.97 fps, and the motion will be the identical speed to the original.

manono
18th February 2015, 09:35
You simply can't get 29.97 from 25 fps with standard 3:2 pulldown.
He wasn't planning on doing that. He was explaining why he needed to use 3:2 pulldown on what was originally a progressive 25fps source:

I now need to know how to take a 25fps progressive source, slow it down to 23.976 via a speed change, then apply 3:2 pulldown in the same script.
However, nothing I've read from this person has justified hard telecining a progressive source. TheSkiller provided a possible explanation, but that doesn't seem to be the case here.

TheSkiller
18th February 2015, 13:16
He wasn't planning on doing that. He was explaining why he needed to use 3:2 pulldown on what was originally a progressive 25fps source:I still don't get it. :p How does that explain why it has to be standard 3:2 pulldown? What's wrong with 25p -> 29.97i pulldown? No need to slow down the audio. :)
You can even do soft 25p -> 29.97i pulldown for both DVD compatible MPEG2 and Blu-ray compatible AVC streams, no problem.

manolito
18th February 2015, 18:19
What's wrong with 25p -> 29.97i pulldown? No need to slow down the audio. :)
You can even do soft 25p -> 29.97i pulldown for both DVD compatible MPEG2 and Blu-ray compatible AVC streams, no problem.

This is exactly the question... :confused:

Living in PAL land I do not really care about pulldown, but sometimes I have to convert some clips for a friend in the US (his standalone player chokes on PAL DVDs).

I do remember an older post by videoh (under his previous incarnation) where he said something like the standard 23.976 -> 29.97 pulldown is easier on the eyes / looks better than the 25 -> 29.97 pulldown. Maybe because people are more used to it? Or are the duplicated fields spread more evenly?


Cheers
manolito

manono
18th February 2015, 20:01
I still don't get it. :p How does that explain why it has to be standard 3:2 pulldown?
It doesn't, of course, but that's his justification for doing it that way. He seems to claim it has to be hard 3:2 (and not 3:2:2) telecine to be used with Prores. I've never used that program but have a little trouble believing anything requires a hard telecine of any kind. I'm inclined to believe he doesn't know what he's doing and has misunderstood what he's read. But I could be wrong.

I do remember an older post by videoh (under his previous incarnation) where he said something like the standard 23.976 -> 29.97 pulldown is easier on the eyes / looks better than the 25 -> 29.97 pulldown. Maybe because people are more used to it?
I've read similar claims myself, and have made DVDs both ways (soft 3:2 and 3:2:2 pulldown), and have never noticed the slight difference in cadence. Maybe it's because I'm in NTSC land and am so used to jerky-playing DVDs that I don't notice one that's jerky in a slightly different way. I would never intentionally hard telecine a film source.

johnmeyer
19th February 2015, 00:17
I would never intentionally hard telecine a film source.Amen to that. Encoders hate duplicate fields.

colours
19th February 2015, 07:53
He seems to claim it has to be hard 3:2 (and not 3:2:2) telecine to be used with Prores.

Minor nitpick: 25 frames/s to 60 fields/s is 3:2:3:2:2 pulldown (or 3:3:2:2:2), not 3:2:2.

manono
19th February 2015, 08:20
Minor nitpick: 25 frames/s to 60 fields/s is 3:2:3:2:2 pulldown (or 3:3:2:2:2), not 3:2:2.
Not minor at all. And I knew that, too. Don't know what I was thinking. Thanks for the correction.

speedyrazor
16th March 2015, 21:36
There is an example in the AviSynth doc actually, hidden in the SelectEvery() section.


ChangeFPS(60000,1001)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()



If I wanted bottom filed first, could I just use BFF instead of TFF?

ChangeFPS(60000,1001)
AssumeBFF()
SeparateFields().SelectEvery(4,0,3).Weave()

johnmeyer
17th March 2015, 00:20
If I wanted bottom filed first, could I just use BFF instead of TFF?It is a simple thing to test, which you need to do yourself. Take the result of your effort, and add a separatefields() or bob(). Look at that result and make sure you haven't ended up with field reversal. This is easy to spot because, if you reverse the fields, you will get a "two steps forwards, one step backwards" back and forth movement. When you play such a video, you won't see the back and forth, but the video will appear to "vibrate" and jitter during fast motion.

If you do see field reversal, you can try using BFF instead of TFF, but you might also need to change the selectevery statement to SelectEvery(4,1,2).

I wish I could be more definitive but, as always, there are lots of variables to everyone's workflow beyond just the AVISynth script.