Log in

View Full Version : I'm so confused (telecine/pulldown/ivtc)


microchip8
29th July 2007, 14:54
Hi,

Not sure if this is the right place to post it, but here it goes. I'm having trouble understanding the process of making a video telecined and reversing the telecine process.

I've read the wiki on Telecine, but there are still a few questions left over. Let me present a few scenario's

1) I have a NTSC DVD which runs at 23.976fps (progressive) and I want to encode it but I want the output FPS of the encode to be 29.97. I use MEncoder for this job, so I have to use a telecine filter during encoding and force the output frame rate to be 29.97fps (or 30000/1001). Is this the way Telecine is done?

2) I have a NTSC DVD which runs at 29.97fps and is Telecined. However I want to remove the telecine part and slow it down to 23.976fps, so I have to use a inverse telecine filter (like the pullup or filmdint filters in MEncoder) and force the output to be 23.976fps (or 24000/1001). Is this the way how reversing the telecine is done and obtaining a progressive movie at film rate of 23.976fps?

3a) I want to telecine a PAL movie. As PAL runs at 25fps, am I correct to assume that I only have to use a telecine filter during encoding to make the encode telecined? Forcing the output frame rate to a different value is not needed in this case as PAL runs at 25fps, right?

3b) After the above process of 3a) is done, does the movie now has 50 fields/second? And if so, to remove the telecine process one has to only apply a inverse telecine filter and the "telecine stair stepped" effects will be gone, is this correct?

Thanks in advance

Tack
29th July 2007, 15:09
1) You shouldn't do this. Hard telecine is awful and unnecessary and hurts bitrate (or quality). But if you absolutely must, you could do -vf telecine -fps 30000/1001 -ofps 30000/1001

2) Use -vf pullup,softskip -ofps 24000/1001

3a) If you have a PAL movie that is 25 progressive frames per second, then your encode will be 25 fps and telecine isn't involved. You could think of that as 50 fields per second, but that's not useful unless you're dealing with interlaced displays, which are rapidly going out of style.

3b) Again with a 25fps PAL movie containing all progressive frames (i.e. 24fps was sped up to 25fps) then there will be no extra necessary work to inverse telecine as you can simply treat 50 fields as 25 progressive frames. However there is 2:2:2:2:2:2:2:2:2:2:2:3 pulldown which I think is rare (I'm not European, but my experience with PAL is such that most PAL films at sped up from 24fps). I don't know if MPlayer's pullup filter will handle this pattern.

microchip8
29th July 2007, 15:24
1) You shouldn't do this. Hard telecine is awful and unnecessary and hurts bitrate (or quality). But if you absolutely must, you could do -vf telecine -fps 30000/1001 -ofps 30000/1001

Thanks for the answers, made the issues a lot clearer now. However I'm still confused about the above answer. Why use -fps 30000/10001 while the DVD runs at 24000/1001? Won't this introduce A/V sync problems, since the DVD is sped up?

Tack
29th July 2007, 15:31
However I'm still confused about the above answer. Why use -fps 30000/10001 while the DVD runs at 24000/1001? Won't this introduce A/V sync problems, since the DVD is sped up?You're not wrong to be confused. :) In fact -fps 30000/1001 is necessary specifically to prevent A/V desync. This is specifically documented in MPlayer's manpage. I believe this is more a kluge to work around limitations in MPlayer's architecture which doesn't behave too well when filters output more frames than they receive.

Frame doubling deinterlacers will also have this problem. So if you use, say, -vf yadif=1, you must also use -fps 60000/1001 along with -ofps 60000/1001. (Assuming NTSC of course.)

microchip8
29th July 2007, 15:38
hmmm, I just tried it here on a sample file which is 23.976fps progressive. When I used the below settings, A/V was desynced, sound was running a bit slower than video

mencoder Video/300.mkv -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts bitrate=1100 -o 1.avi -vf scale=512:384,telecine -fps 30000/1001 -ofps 30000/1001

When I did the same, except this time I only changed -fps from 30000/1001 to 24000/1001 (which is the original speed of this file), A/V sync was perfect

mencoder Video/300.mkv -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts bitrate=1100 -o 1.avi -vf scale=512:384,telecine -fps 24000/1001 -ofps 30000/1001

Still confused here, lol

Tack
29th July 2007, 15:50
Ah, yes, sorry I forgot to mention you'll also need the softskip filter. So -vf telecine,softskip -ofps 30000/1001 -fps 30000/1001

Your second example does probably does have correct A/V sync, but I'm guessing the telecine pattern isn't right. If you step through the frames I think you'll see that one of the frames is a duplicate. So instead of seeing the 3-2 pattern, you'll see 2-1-2 where the first two are progressive, the third is a duplicate of the previous progressive frame, and the last two are combed.

microchip8
29th July 2007, 16:09
Ah, yes, sorry I forgot to mention you'll also need the softskip filter. So -vf telecine,softskip -ofps 30000/1001 -fps 30000/1001

Your second example does probably does have correct A/V sync, but I'm guessing the telecine pattern isn't right. If you step through the frames I think you'll see that one of the frames is a duplicate. So instead of seeing the 3-2 pattern, you'll see 2-1-2 where the first two are progressive, the third is a duplicate of the previous progressive frame, and the last two are combed.

Ah, yes, you were correct, I tried it together with the softskip filter and now it looks good. Another question, where should the scale filter be placed? before the telecine and softskip filters or after them? I think the below example is correct, right?

-vf scale=512:384,telecine,softskip

Here is a link to the telecined file converted to 29.97fps - original was progressive @ 23.976fps...... can you tell me if the pattern is correct?

http://www.fileden.com/files/2006/11/28/434355/1.avi.zip

Tack
29th July 2007, 16:21
Another question, where should the scale filter be placed? before the telecine and softskip filters or after them? I think the below example is correct, right?You can safely scale wherever you have a progressive frame. So scaling before the telecine filter is correct, however with pullup, you should scale after pullup,softskip.

Here is a link to the telecined file converted to 29.97fps - original was progressive @ 23.976fps...... can you tell me if the pattern is correct?The pattern is correct, but notice at this low bitrate, it is blurring the combing caused by pulldown. You would either need to use a much higher bitrate to preserve the detail here, or use interlaced encoding with xvid. Neither of these are good options.

So I just want to reiterate that this telecine discussion is academic, and you shouldn't actually ever do this because you'll either need a much higher bitrate or you'll sacrifice quality for really no benefit. Pulldown, if necessary at all, should be done during playback.

microchip8
29th July 2007, 16:27
Yes, I know but I wanted to understand this process, and what is a better way than playing with it and trying stuff out? ;)

I know the bitrate is low, it was just a quick test to see if all works like it should....

Something else, is it possible to convert 29.97fps progressive material to PAL in a easy way? I read somewhere a while back that it's not that easy

Tack
29th July 2007, 16:33
That's out of my area of expertise. I'm inclined to agree that it can't be easy (to do it properly). I imagine it must involve temporally interpolating frames, which AFAIK MPlayer can't do.

microchip8
29th July 2007, 16:37
OK, thanks for the answers so far, you really helped a European understand the NTSC telecine process :D

Tack
29th July 2007, 16:39
Happy to help. :)

Guest
29th July 2007, 17:04
Something else, is it possible to convert 29.97fps progressive material to PAL in a easy way? I read somewhere a while back that it's not that easy If it's telecined, you can IVTC it back to 23.976 first. Then if you are making MPEG2 for your encode, you can use DGPulldown to pull it down to 25fps. If you can't use pulldown for your encode, you can speedup the video and audio by 4% in the classic manner to get 25fps.

microchip8
29th July 2007, 17:37
If it's telecined, you can IVTC it back to 23.976 first. Then if you are making MPEG2 for your encode, you can use DGPulldown to pull it down to 25fps. If you can't use pulldown for your encode, you can speedup the video and audio by 4% in the classic manner to get 25fps.

Thanks for the tip, I'll try it out :)

Tack
29th July 2007, 17:45
Hard telecined content technically isn't progressive. If it's truly progressive then I don't think there's anything simple you can do to coerce it to 25fps, except for brutishly dropping frames, which will of course suck. Conceptually, I think temporally interpolating frames is the only way you can smoothly convert it to 25fps.

But if it is hard telecined, you're in luck, and you can follow neuron2's advice. :)

microchip8
29th July 2007, 18:06
OK, so I did a reverse pulldown with the pullup filter and the result which is 23.97fps looks really good, no jumps, stuttering or A/V desyncs.... now if I could find out how to do a 2:2:2:2:2:2:2:2:2:2:2:3 pulldown to bring it from 23.97 to 25fps. I don't like this 4% increase in sound pitch which is used by the older method.....

Guest
29th July 2007, 19:09
If your target is MPEG2 you can use DGPulldown on the MPEG2 elementary stream to pull it down to 25fps.

microchip8
29th July 2007, 22:47
Ok, another question....

Besides the increasing of frame rate and making new frames from the odd and even ones, what is the other difference (if any) between Telecine and Interlacing?

Tack
29th July 2007, 22:58
Film material pulled down to 30fps is still fundamentally progressive, it's just represented in an interlaced manner. With truly interlaced video, each field (where two fields comprise a frame) represents two discrete moments in time. The same is not true of telecined content, except for two out of every five frames, but that's only an artificial characteristic of the process, which can be losslessly reversed.

microchip8
29th July 2007, 23:16
Aahh, ok, I get it... thanks a lot Tack for all the info. I read the wiki on Telecine and Interlace twice but still didn't get it. With your help it is clear now :D

Tack
29th July 2007, 23:22
No problem. Here is another good article on the subject (http://www.hometheaterhifi.com/volume_14_1/feature-article-1080p-3-2007-part-1.html) that might help elucidate things.

microchip8
30th July 2007, 09:38
Can you soft-telecine a H.264 or a Xvid encoding with MEncoder? I see that it has a softpulldown filter but they only mention to use it on MPEG-2 streams.

foxyshadis
30th July 2007, 10:21
I don't think MPEG-4 ASP telecine exists. I know Elecard studio has AVC pulldown, but mencoder and dgpulldown don't, so it's a little tough to work with. Oh yeah, just remembered, the patched h264info has it: http://forum.doom9.org/showthread.php?t=125568

microchip8
2nd August 2007, 10:30
OK, another stupid question. When you want to interlace a progressive content during encoding do you also have to change the frame rate? MEncoder supports interlacing of content with the tinterlace and tfields filters...

Tack
2nd August 2007, 13:01
When you want to interlace a progressive content during encoding do you also have to change the frame rate?Yes, you will reduce your frame rate by half. So if you have 59.94 fps progressive NTSC, you'd use -fps 60000/1001 -vf tinterlace=4 -ofps 30000/1001

MEncoder supports interlacing of content with the tinterlace and tfields filters...
Note that tfields does the opposite of tinterlace. It is essentially a bob deinterlacer.

microchip8
2nd August 2007, 14:30
hmmm, is this the same procedure for PAL. I have a 25fps progressive PAL DVD and I want to interlace it with tinterlace... so I have to use something like

-vf tinterlace=4,softskip -fps 25025/1001 -ofps 50050/1001

microchip8
4th August 2007, 19:21
OK, so I've been doing a few tests here on a 25fps progressive PAL DVD. First, I made it interlaced with the tinterlace filter...

-vf tinterlace=4,softskip -ofps 12513/1001

then I did 2 tests

1) I encoded the resulting interlaced file and used a deinterlacing filter to remove the interlacing from it

-vf pp=l5

2) I did the same, but this time I also added the -ofps option to bring it back to 25fps

-vf pp=l5 -ofps 25025/1001

What got me confused here is that in the case of 1) the resulting file was deinterlaced but it played just fine at a frame rate of 12.5fps. In the case of 2) the file was also deinterlaced but had a 25fps frame rate, and again played just fine...

How come a 12.5fps file plays normal (eg, not slowed down or other weird stuff) after interlacing has been removed/filtered out?

akupenguin
7th August 2007, 03:24
-fps 12513/1001
Only NTSC framerates are weird fractions. PAL uses 50 or 25 or 12.5 exactly.

How come a 12.5fps file plays normal (eg, not slowed down or other weird stuff) after interlacing has been removed/filtered out?

-ofps will generate whatever framerate you request, by duplicating or dropping frames. -ofps 1000 will be 1000fps, but that doesn't mean it's 1000 real frames.

microchip8
7th August 2007, 03:28
Only NTSC framerates are weird fractions. PAL uses 25 exactly.



-ofps will generate whatever framerate you request, by duplicating or dropping frames. -ofps 1000 will be 1000fps, but that doesn't mean it's 1000 real frames.

so it is not correct to use -ofps 25025/1001 for PAL? I'm also subscribed to the MEncoder list and sometimes they use 25025/1001 when giving examples

Tack
7th August 2007, 14:29
so it is not correct to use -ofps 25025/1001 for PAL? I'm also subscribed to the MEncoder list and sometimes they use 25025/1001 when giving examples25025/1001 == 25000/1000. I'm not sure why 25025/1001 is used with mplayer examples except perhaps for consistency in the denominator between PAL and NTSC. Or perhaps there's some implementation reason I'm not familiar with.

But 12513/1001 != (25025/1001/2). So you should use 12500/1000 here.

microchip8
7th August 2007, 15:10
But this doesn't bring any problems when using fractions with -ofps for PAL content, right? eg, I can use 25025/1001 or 25000/1000 without a problem for PAL?