01-20-2004, 11:24 AM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This is the script I use to convert my 29.97fps Interlaced (non-telecined!) movies to 23.976fps.
The function convert60ito24p is from scharfis_brain, whose site is here: http://home.arcor.de/scharfis_brain/
Just change the relevant lines to what your source and target will be, using MovieStacker or FitCD.
And also, this script (my portion) is not really optimized. But it just works great
-kwag
Code:
## DLL Section ##
#
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
#
Mpeg2Source("F:\Movie\styx.d2v")
bob()
converttoyuy2().convert60ito24p(2,0).converttoyv12()
BicubicResize(336, 448, 0, 0.6, 0, 0, 720, 480)
STMedianFilter(3, 3, 0, 0 )
MergeChroma(blur(1.5))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
AddBorders(8, 16, 8, 16)
#
############### the function #############
#
function convert60ito24p (clip video, int mode, int offset)
{
work = assumefieldbased(video)
out = (mode==2) ? interleave(
\selectevery(
\layer(trim(work, 1, 0),
\layer(work, trim(work, 2, 0), "fast"),
\"fast"), 5, 0 + offset),
\selectevery(
\layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\ (mode==1) ? interleave(
\selectevery(trim(work, 1, 0), 5, 0 + offset),
\selectevery(layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\ (mode==0) ? selectevery(work, 5, 1 + offset, 4 + offset) : work
assumeframebased(out)
}
#################################
#
#
## Functions ###
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}
#
####
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
01-20-2004, 02:05 PM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Kwag, you where fast, cause Im writing a interlacing-deinterlacing Guide and its basics which I also wanted to post as sticky as the last weeks there where a lot of Threads according to this and its encoding problems.
I see you're still using a simple bob above, I did some tests a time ago using
Fielddeinterlace(full=false)
as it works smart and only the combed parts will be treated.
Even more quality gives
Smoothdeinterlace(doublerate=true, TFF=true, blend=false).selectodd()
EDIT: In case of the 60ito24p function as showed above you HAVE TO USE: Smoothdeinterlace(doublerate=true, TFF=true, blend=false) WITHOUT Selectodd() !! As a full 60fps deinterlacer is needed!
Also be aware which fieldorder is used in the source in case of "bottomfield first" use TFF=false! And also here do test blend with true or false as shown below.
... wich won't result in blendings but only good on Videos which do not contain fine static! text and lines ... but the image comes out more clear, more sharp (even deinterlaced parts) and do have the right contrast which disappears when frames come out blended.
Did you try to do first the filtering on the fieldbased data and afterwards doing the 29.976 23.976 conversion?
Here a little comparison of the blending in case of deinterlacing (just a part of the guide) watch the drops above right. All images here are safed in Jpeg, quality 45%
And here comes a sample where we should use blend=true (no matter if fielddeinterlace() or Smoothdeinterlace() ... as you see very fine Typo is contained which would be destroyed but her eyes do look correct.
Because the typo is static and blend=false would cause problems.
I know that Girl Sonja from the station Pro7 does have everything a man really wants
|
01-20-2004, 03:00 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by incredible
I see you're still using a simple bob above, I did some tests a time ago using
Fielddeinterlace(full=false)
as it works smart and only the combed parts will be treated.
|
Yes I know, but as I posted, the script is not optimized. It just works fine as it is, and anyone is free to improve it.
It was just posted as a basic framework, to be improved upon
Obviously, Smoothdeinterlace is far better
-kwag
|
01-20-2004, 03:16 PM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
YEP! You're right I did read to fast as you mentioned it, but as we know some noobs could read even more faster and just eat the food they see.
I only say one word: "maxThreshold" in MA
You can also use Fielddeinterlace(full=false,blend=false)
but I did the last weeks a lot of tests and Smoothdeinterlace with doublerate and discarted evenfields ("selectodd()") did look better.
|
01-26-2004, 07:08 AM
|
Free Member
|
|
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Any suggestions for a smooth progressive 29.97 fps source (like an avi or mpeg-1) to 23.976 fps convertion?[/b]
|
01-26-2004, 07:43 AM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
a progressive 29.97 ???? Are you shure?
Well in that case if NO! interlacing apperas in fast moving areas, you just perform a
Decimate()
wich inverses the pulldown ... means RESTORES the amount of 29.97 Frames per second to 23.976 FPS. IF the movie is in a correctly pulldowned state!
or use
smartdecimate()
(look for the plugin at Warpenterprises)
It gots a threshold routine inside which auto detects the pulldown method within your source. But still risky as it works smart
|
06-12-2004, 01:57 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here's a developed version of the original function (props to scharfis_brain and Manao):
Usage:
Code:
MPEG2Source("path\clip.d2v")
KernelBob(order=x,sharp=true,threshold=7)
MVConvert60ito24p()
#the rest as usual
You'll need the following:
- MVTools.dll, see my next post
- MVConvert60ito24p(), see my next post
- KernelDeint() , must be version 1.5 or above!, http://www.avisynth.org/warpenterprises
The original discussion thread is here: http://forum.doom9.org/showthread.php?s=&threadid=76041
Replace order=x by order=1 for top field first video or order=0 for bottom field first video.
|
06-12-2004, 02:16 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here's the version which works with v0.9.3:
Code:
function mvconvert60ito24p(clip x, int "mode")
{
mode = default(mode,2)
mbl=0.1
vectorsforward = x.mvanalyse(isb = false)
vectorsbackward = x.mvanalyse(isb = true)
y = x.mvinterpolate(vectorsbackward, vectorsforward, nb = 4, bl = 0.5 - mbl, el = 0.5 + mbl, wf = "hat")
interleave(y,x)
mode0=selectevery(5,2)
mode1=overlay(selectevery(5,3),selectevery(5,2),opacity=0.5)
mode2=overlay(overlay(selectevery(5,1),selectevery(5,3),opacity=0.5),selectevery(5,2),opacity=0.3)
mode3=overlay(overlay(selectevery(5,0),selectevery(5,3),opacity=0.5),overlay(selectevery(5,1),selectevery(5,2),opacity=0.5),opacity=0.5)
(mode==0) ? mode0 : (mode==1) ? mode1 : (mode==2) ? mode2 : mode3
}
http://jourdan.madism.org/~manao/MVTools-v0.9.3.zip
|
08-31-2004, 10:35 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The latest script is now up-to-date again. The only change was that KernelBob is now included in KernelDeint since v1.5.0.
|
09-09-2004, 04:52 PM
|
Free Member
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I tried mvconvert60ito24p to convert 29.97 to 23.976 in order to save some bits for movie and found it considerably slowed the encoding speed. Is it normal or my script needs optimising. I put mvconvert60ito24p before other actions such as Crop, BicubicResize and AddBorders.
|
09-10-2004, 01:13 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Doing the conversion is very slow, that's normal. The function that Kwag posted might be faster, but you'll have to remember that the script I posted evolved from that one as both are scharfis_brain's creations.
|
All times are GMT -5. The time now is 06:21 PM — vBulletin © Jelsoft Enterprises Ltd
|