View Single Post
Old 23rd December 2010, 17:45   #4  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
You can look at the p60to24p function:
http://forum.doom9.org/showthread.ph...547#post814547
However this may be not the best tool to achieve what you need.

The following function deinterlaces 60i credits on the top of a 24 fps telecined footage. It virtually oversamples the video to 120 fps with motion interpolation on credits only, and decimates to 24 fps. It has the advantage of avoiding footage frames interpolation, leaving them very clean, whatever the motion they contain. However, the drawback is that it requires to manually measure the origin of the 3:2 pulldown pattern (and split the clip in parts if it changes).

Code:
# Version 1.1
Function ivtc_txt60mc (clip src, int frame_ref, bool "srcbob", bool "draft")
{
	srcbob    = Default (srcbob, false)
	draft     = Default (draft,  false)

	field_ref = (srcbob) ? frame_ref : frame_ref * 2
	field_ref =      field_ref  % 5
	invpos    = (5 - field_ref) % 5
	pel       = (draft) ? 1 : 2

	src
	  (srcbob) ? last
\	: (draft ) ? Bob ()
\	:            QTGMC (SourceMatch=3, Lossless=2, tr0=1, tr1=1, tr2=1)

	clean  = SelectEvery (5, 1 - invpos)
	jitter = SelectEvery (5, 3 - invpos, 4 - invpos)
	jsup   = jitter.MSuper (pel=pel)
	vect_f = jsup.MAnalyse (isb=false, delta=1, overlap=4)
	vect_b = jsup.MAnalyse (isb=true,  delta=1, overlap=4)
	comp   = jitter.MFlowInter (jsup, vect_b, vect_f, time=50, thSCD1=400)
	fixed  = comp.SelectEvery (2, 0)
	Interleave (clean, fixed)
	Trim (invpos / 2, 0)
}
The src parameter is a 30 fps interlaced clip. The frame_ref parameter indicates on which frame begins the 3:2 pattern (first frame number of a clean-combed-combed-clean-clean sequence). Add SetMemoryMax (1500) at the beginning of your script if you are processing HD content.

I've put in this archive examples showing several common methods to deinterlace 60i credits. The one covered by the above script is correct.mp4.

If you can read french, I wrote a more detailed article about this kind of issue:
http://qualiter.fr/viewtopic.php?f=11&t=24
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding

Last edited by cretindesalpes; 9th May 2011 at 04:05. Reason: Added srcbob and draft parameters.
cretindesalpes is offline   Reply With Quote