--- telecine.d2.txt 2004-01-05 14:06:55.000000000 -0800 +++ telecine.txt 2004-01-07 17:41:00.000000000 -0800 @@ -1,9 +1,9 @@ TELECINE, INTERLACING, AND MENCODER HOWTO -Initial (DRAFT 2) version by Corey Hickey, with advice and contributions by D +Initial (DRAFT 3) version by Corey Hickey, with advice and contributions by D Richard Felker III. -2004-01-05 +2004-01-07 Notes: @@ -12,7 +12,7 @@ actual use. They are simply the bare minimum required to encode the pertaining video category. How to make good DVD rips or fine-tune lavc for maximum quality is not within the scope of this document. -3. If you see something like [1], check the footnote at the end of the document. +3. If you see something like [1], check the footnotes at the end of the document. What isn't here, but maybe ought to be: 1. How to use -vf filmdint @@ -67,12 +67,12 @@ From this point forward, demux_mpg should never say it finds "30fps NTSC content." -When you watch progressive video, you should never see any interlacing. Watch -out, however, because sometimes there is a tiny bit of telecine mixed in, where -you wouldn't expect. I've encountered TV show DVDs that have one second of -telecine at every scene change, or at seemingly random places. I once watched a -DVD that had a progressive first half, and the second half was telecined. If you -want to be _really_ thorough, you can scan the entire movie: +When you watch progressive video, you should never see any interlacing. Beware, +however, because sometimes there is a tiny bit of telecine mixed in, where you +wouldn't expect. I've encountered TV show DVDs that have one second of telecine +at every scene change, or at seemingly random places. I once watched a DVD that +had a progressive first half, and the second half was telecined. If you want to +be _really_ thorough, you can scan the entire movie: $ mplayer dvd://1 -nosound -vo null -benchmark Using -benchmark makes mplayer play the movie as quickly as it possibly can; still, depending on your hardware, it can take a while. Every time demux_mpg @@ -218,25 +218,42 @@ that accomplish this natively, but a better solution most of the time is to use two filters in conjunction (read onward for more detail). -Pullup doesn't really work well with the current mencoder, and is intended for -use with mencoder G2 (whenever it's ready). It works fine without -ofps, but --ofps is needed to prevent choppy output. With -ofps, it sometimes fails. - -I haven't used filmdint myself, but here's what D Richard Felker III has to say: - "It's ok, but IMO it tries to deinterlace rather than doing inverse telecine - too often (much like settop DVD players & progressive TVs) which gives ugly - flickering and other artefacts. If you're going to use it, you at least need - to spend some time tuning the options and watching the output first to make - sure it's not messing up." - -Currently the most reliable method to deal with this type of video is to, rather -than inverse-telecine the telecined parts, telecine the non-telecined parts and -then inverse-telecine the whole video. Sound confusing? softpulldown is a filter -that goes through a video and makes the entire file telecined. If we follow -softpulldown with either detc or ivtc, the final result will be entirely -progressive. Cropping and scaling should be done after the inverse-telecine -operations, and -ofps 23.976 is needed. -$ mencoder dvd://1 -nosound -vf softpulldown,ivtc=1 -ovc lavc -ofps 23.976 +1. Currently the most reliable method to deal with this type of video is to, + rather than inverse-telecine the telecined parts, telecine the non-telecined + parts and then inverse-telecine the whole video. Sound confusing? + softpulldown is a filter that goes through a video and makes the entire file + telecined. If we follow softpulldown with either detc or ivtc, the final + result will be entirely progressive. Cropping and scaling should be done + after the inverse-telecine operations, and -ofps 23.976 is needed. + $ mencoder dvd://1 -nosound -vf softpulldown,ivtc=1 -ovc lavc -ofps 23.976 + +2. -vf pullup is designed to inverse-telecine telecined material while leaving + progressive data alone. Pullup doesn't really work well with the current + mencoder, though, and is really intended for use with mencoder G2 (whenever + it's ready). It works fine without -ofps, but -ofps is needed to prevent + choppy output. With -ofps, it sometimes fails. The problems arise from + mencoder's behavior of dropping frames to maintain synchronization between + the audio and video: it drops frames before sending them through the filter + chain, rather than after. As a result, pullup is sometimes deprived of the + data it needs. + + If mencoder drops too many frames in a row, it starves pullup's buffers and + causes it to crash. + + Even if mencoder only drops one frame, pullup still doesn't get to see it, + and will end up operating on an incorrect sequence of frames. Even though + this doesn't cause a crash, pullup won't be able to make correct decisions on + how to reassemble progressive frames, and will either match fields together + incorrectly or drop several fields to compensate. + +3. I haven't used -vf filmdint myself, but here's what D Richard Felker III has + to say: + "It's ok, but IMO it tries to deinterlace rather than doing inverse + telecine too often (much like settop DVD players & progressive TVs) which + gives ugly flickering and other artefacts. If you're going to use it, you + at least need to spend some time tuning the options and watching the + output first to make sure it's not messing up." + --Mixed progressive and interlaced-- @@ -244,19 +261,29 @@ compromise. You should decide based on the duration/location of each type. 1. Treat it as progressive. The interlaced parts will look interlaced, and some - of the interlaced frames will have to be dropped, resulting in a bit of + of the interlaced fields will have to be dropped, resulting in a bit of uneven jumpiness. You can use a postprocessing filter if you want to, but it may slightly degrade the progressive parts. This option should definitely not be used if you want to eventually display - the video on an interlaced device (with a TV card, for example). It may also - be a bad idea for progressive display, too. It will drop interlaced fields, - resulting in a discontinuity of 1/24.976 second, which can be more noticable than - the next option, which will make some frames display for 1/29.97 second - longer than they would otherwise. Either way, it's best to consider your - content. If it's 90% progressive, you should favor a progressive approach. If - it's only half progressive, you probably want to encode it as if it's all - interlaced. + the video on an interlaced device (with a TV card, for example). If you have + interlaced frames in a 23.976 frames per second video, they will be telecined + along with the progressive frames. Half of the interlaced "frames" will be + displayed for three fields' duration (3/59.94 seconds), resulting in a + flicking "jump back in time" effect that looks quite bad. If you even attempt + this, you _must_ use a deinterlacing filter like lb or l5. + + It may also be a bad idea for progressive display, too. It will drop pairs of + consecutive interlaced fields, resulting in a discontinuity that can be more + visible than with the second method, which shows some progressive frames + twice. 29.97 frames per second interlaced video is already a bit choppy + because it really should be shown at 59.94 fields per second, so the + duplicate frames don't stand out as much. + + Either way, it's best to consider your content and how you intend to display + it. If your video is 90% progressive and you never intend to show it on a TV, + you should favor a progressive approach. If it's only half progressive, you + probably want to encode it as if it's all interlaced. 2. Treat it as interlaced. Some frames of the progressive parts will need to be duplicated, resulting in uneven jumpiness. Again, deinterlacing filters may @@ -286,7 +313,7 @@ and offsets be multiples of four. Horizontal can stay even. For telecined video, I recommend that cropping take place after inverse - telecining. Once the video is progressive you only need to crop by even by + telecining. Once the video is progressive you only need to crop by even numbers. If you really want to gain the slight speedup that cropping first may offer, you must crop vertically by multiples of four or else the inverse-telecine filter won't have proper data. @@ -300,7 +327,7 @@ increases quality the most, and you should always use at least those two unless the drop in encoding speed is prohibitive (e.g. realtime encoding). There are many other options to lavc that increase encoding quality (and - decrease encoding speed, but that is beyond the scope of this document. + decrease encoding speed) but that is beyond the scope of this document. END OF FILE