[MPlayer-users] TELECINE or not TELECINE?

Rainer Koehler koehler at mpia-hd.mpg.de
Fri Oct 10 13:46:53 CEST 2003


Thank you very much, Corey and Rich, that was very instructive!
I hope I'm now able to ask the right questions...


D Richard Felker writes:

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> On Thu, Oct 09, 2003 at 01:47:13PM -0700, Corey Hickey wrote:
>> 
>> From looking at the frame numbers in your log, it would appear that most
>> of the progressive sequences are only a second long; I've found this
>> often happens at scene changes on some DVDs, but since the log also
>> shows them to happen at 1%, I might also guess that you're seeing the
>> intro part of the movie or something. Either way, take a close look at
>> your source file and see if you can see the interlacing then (in cases
>> like this it might be hard to even notice if your eye isn't trained to
>> watch for interlacing).

It should have written in my first post that the movie is one episode
of a US TV series.  There's no intro or anything, and the switches
don't seem to happen at scene changes (although it could be that they
appear a couple of frames after a scene change).

>> Once you find the interlacing, you should figure out if it's
>> hard-telecined or not. Read this if you don't know what I mean by
>> hard-telecine:
>> http://mplayerhq.hu/pipermail/mplayer-users/2003-July/035503.html
>> (note that the last two paragraphs are obsolete)

For the record (i.e. the archive): The guide at divx.com about 
interlacing, telecine etc. is now at
http://www.divx.com/support/guides/guide.php?gid=10
(at least I think that's what you meant).

>> Play that part of the video with -fps 1 and look closely at the
>> pattern of interlaced frames. If every single frame is interlaced, then
>> there's no telecine to remove, and you'll have to decide between using
>> a deinterlacing filter (pp=lb, etc.) or just leaving those few frames
>> interlaced.

I looked *very* closely at my file (I dumped the first seconds to PNG
files).  I find no trace of interlacing in the telecined part, but
some (not all) frames in the progressive part are interlaced.  Am I
right that this is one of those movies with hard and soft-telecine
mixed?

>> If some but not all of the frames are interlaced, then you
>> ought to be able to de-telecine using either softpulldown+ivtc or
>> pullup. The usual sequence of progressive and interlaced "frames" that
>> you see in a hard-telecined sequence is:
>> p,p,p,i,i,p,p,p,i,i .... etc.
>> I say "frames" because really it's a sequence of alternate fields, but
>> for our viewing mplayer combines them into frames. Other telecine
>> patterns might also be workable, but I haven't encountered one; Rich
>> could explain further.

I had a look at the only definitive documentation (the sources) and
found where all this telecine/progressive detection is done and that I
can get some debug output of it.  Here is a short excerpt of a "grep
-i telecine":

 telecine = 1.0  -2.500
 telecine = 1.0  -2.500
 telecine = 1.0  -2.500
 telecine = 1.0  -2.500
 telecine = 1.5  -2.000
 telecine = 1.0  -2.050
 telecine = 1.0  -2.095
 telecine = 1.0  -2.135
 telecine = 1.0  -2.172
 telecine = 1.5  -1.705
 telecine = 1.5  -1.284
 telecine = 1.5  -0.906
 telecine = 1.0  -1.065
 telecine = 1.0  -1.209
 telecine = 1.0  -1.338
 telecine = 1.5  -0.954
 telecine = 1.5  -0.609
 telecine = 1.5  -0.298
demux_mpg: 3:2 TELECINE detected, enabling inverse telecine fx. FPS changed to 23.976!
 telecine = 1.0  -0.518
 telecine = 1.0  -0.716
 telecine = 1.0  -0.895
 telecine = 1.5  -0.555
 telecine = 1.5  -0.250
 telecine = 1.5  0.025
 telecine = 1.0  -0.227
 telecine = 1.0  -0.454
 telecine = 1.0  -0.659
 telecine = 1.5  -0.343
 telecine = 1.5  -0.059
 telecine = 1.5  0.197

If I understand this correctly, the first number after "telecine ="
indicates how long a frame should be displayed, so 1.5 should mean
that the frame should be displayed longer to do the soft-telecine.
Nearly all of the frames in the progressive sequence have "telecine =
1.0", but some of them look interlaced, so they are hard-telecined.
Am I right so far?

>> If you eventually choose to use one of the telecine filters, you should
>> make sure to apply them before cropping/scaling. Doing otherise can be
>> problematic. For example:
>> -vf softpulldown,ivtc=1,crop=708:358:6:62,scale=672:288

> Nice advice. You can also use the pullup filter now (it supports mixed
> hard+soft telecine!) but it won't (yet) work with -ofps 23.876. I'll
> fix that later if I can think clearly enough to work out the
> input:ouput frame ratio regulation right...

So, should I use -ofps at all?  And if yes, with which framerate?
Or would the right way to figure out the output framerate be to
average all the 1.0s and 1.5s in the debug output and divide the input
framerate by it?

Thanks again,
Rainer



More information about the MPlayer-users mailing list