PDA

View Full Version : 15p or 60i >> 24p...


joshbm
19th February 2005, 07:02
Since I have a Sony VX2000 it has the ability to record in 60i or 15p. Now since my desired output is 24p, I was wondering is it best to record in 15p and convert it to 24p? Or do the usual bob 60 fields and convert it down to 24p.

The crisp picture I see in the progressive is great and I don't think it would be that hard to convert the 15p to 24p (9 frames per second are needed to make up the difference). Although I am unsure.

Any suggestions would be great!

Regards,
Joshbm

scharfis_brain
19th February 2005, 13:43
15p to 24p is a mess.

you'll either get extreme stutter (frame repetition),
extreme ghosting/blending with slightly smoother motion (frame blending)

or a mostly smooth motion but also motion compensation artifacts when using MC.

have a look on my script mvbob()

you should get a very nice 24p out of this:

mvbob()
mvfps(23.976,10)

joshbm
19th February 2005, 21:42
Would you recommend that method? I've been always using:

TDeint()
convert60ito24p()

Would you use:

TDeint()
mvfps(23.976,10)

Instead?

PS- I would use MVBob(), but it is pretty slow, even for my 3.2 Ghz P4 (with all the filtering I am doing).

Regards,
Josh

scharfis_brain
20th February 2005, 04:11
convert60ito24p should do a fine job.

there also exists mvconvert60ito24p() but I never made it work with never mvtools.

however, convert60ito24p will give you the most reliable result at the cost of some ghosting while mvconvert60ito24p() and mvfps() will output superior motion they may tend to produce blocking artifacts.

try them yourself I cannot to the jugdement for you.

tdeint is a nice choice, if you are afraid of the slowness of mvbob().

I suggest these settings:

tdeint(mode=1,tryweave=false,mode=3)

joshbm
20th February 2005, 05:46
I don't understand...

TDeint(mode=1,tryweave=false,mode=3)

??

PS- I attempted mvfps()... It works great except it takes my script from 6-7fps rendering to about 1fps.

Here is my script. I don't know if it can be optimized at all.


LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")

function AspectRatio(clip a, float "ratio", float "top", float "letterbox", bool "stretch")
{
orig_width=a.width
orig_height=a.height
ratio=default(ratio,(16./9.))
top=default(top,30)
stretch=default(stretch,false)
letterbox=default(letterbox,0)
recip_letter=(letterbox!=0) ? float(1./letterbox) : 1
anewheight2=(recip_letter*orig_width)
topbot2=round((orig_height-round(anewheight2))/2.)

recip=float(1./ratio)
anewheight1=(recip*orig_width)
topbot=round((orig_height-round(anewheight1))/2.)
shift=-round((top/100.)*topbot)
cuttop=(topbot+shift)
cutbot=(topbot-shift)
dosub=(round(anewheight1)-(orig_height-(Abs(cuttop)+Abs(cutbot))))
cuttop=(cuttop!=0) ? cuttop-dosub : cuttop
cutbot=(cutbot!=0) ? cutbot-dosub : cutbot

a=a.Crop(0,cuttop,-0,-cutbot).Crop(0,0,orig_width,round(anewheight1))
a=(stretch==true) ? a.Lanczos4Resize(orig_width,orig_height) : a
a=((stretch==true) && (letterbox!=0)) ? a.Letterbox(topbot2,topbot2) : a
a=((letterbox!=0) && (stretch==false)) ? a.AddBorders(0,topbot,0,topbot).Crop(0,0,orig_width,orig_height) : a
return a
}

AVISource("G:\test.avi")

ConvertToYUY2(interlaced=true)
ReInterpolate411()

ConvertToYV12(interlaced=true)

TDeint(mode=1,type=2,tryweave=false)

ConvertToYUY2(interlaced=false)
AspectRatio(letterbox=0).AddBorders(0,1,0,2)

ConvertToYV12(interlaced=false)
ColorYuv(levels="TV->PC")

convert60ito24p(2,0)

Levels(10,1.0,255,0,255)

LimitedSharpen(overshoot=5,strength=70)

AddBorders(0,37,0,36)

ConvertToRGB()

GiCoCU("J:\link2\s-curve.amp",photoshop=true)

ConvertToYV12()


Regards,
Joshbm

scharfis_brain
20th February 2005, 12:19
why do you use THAT much colorspace conversions?

which format is your goal? mpeg-2 or avi?

what does aspectratio do?
though I don't know, I knocked it out (because of color space conversion you made!)
at all costs try to stay in yuy2 here.
sampling to yv12 will hurt the image.
let your encoder to the chroma subsampling itself.
do not convert to yv12 at the end of the script.
the common mpeg-encoders do NOT accept YV12.
(It will be converted to an intermediate yuy2, which is subsampled again by the encoder :( )

why do you add such weird borders (1 & 2) and (37 & 36)?
this will hurt compression cause it is not block-aligned.

also get a DV-CoDec that delivers YUY2. this will speed up things and give you a better quality

AVISource("G:\test.avi")
crop(0,36,0,-36) #NTSC 16:9 letterboxed

ReInterpolate411()

TDeint(mode=1,type=3,tryweave=false)
ColorYuv(levels="TV->PC")
convert60ito24p(2,0)
Levels(10,1.0,255,0,255)
LimitedSharpen(overshoot=5,strength=70)

AddBorders(0,36,0,36)

ConvertToRGB()
GiCoCU("J:\link2\s-curve.amp",photoshop=true)
#maybe:
#converttoyuy2() #NOT YV12


I hope you took one of these: http://forum.doom9.org/showthread.php?s=&threadid=63368&highlight=convert60ito24p%2A (in the last post)

joshbm
20th February 2005, 20:10
I use Sony DV plugin. It is good quality, but it delivers it in RGB. Also if I use that script it knocks down my fps almost in half. My ultimate goal, by the way, is MPEG-2 (DVD).

Regards,
joshbm

scharfis_brain
20th February 2005, 20:16
Also if I use that script it knocks down my fps almost in half.

but the chroma quality is much improoved!
and as I told before:
using another dv-decoder that puts out yuy2 should speed up things, too!


and again, what does aspectratio() do?

also try this: it should gain the speed.

function blend(clip i, clip j, float "w")
{w=default(w,0.5)
i.mergechroma(j,w).mergeluma(j,w)}

function convert60ito24p (clip video, int mode)
{
work = video


out = (mode==2) ? interleave(
\selectevery(blend(trim(work, 1, 0), blend(work, trim(work, 2, 0)),0.5), 5, 0),
\selectevery(blend(work, trim(work, 1, 0)), 5, 3)) :

\ (mode==1) ? interleave(
\selectevery(trim(work, 1, 0), 5, 0),
\selectevery(blend(work, trim(work, 1, 0)), 5, 3)) :

\ (mode==0) ? selectevery(work, 5, 1, 4) :

\ (mode==3) ? interleave(
\selectevery(blend(trim(work, 1, 0), blend(work, trim(work, 2, 0)),0.66), 5, 0),
\selectevery(blend(blend(work.duplicateframe(0),work.trim(2,0)),blend(work, work.trim(1, 0)),0.66), 5, 3))

\ : work

assumeframebased(out)
}

joshbm
20th February 2005, 20:59
:) ... The convert60ito24p() function I already had changed to accomodate the blend() function (except mine is called merge()). I still get around 4-5fps, but I may be able to live with it :p.

The AspectRatio() function does just what it says it does. I created it to either crop the edges, stretch, or add black.

float "ratio": Desired aspect ratio, default is 16:9.

float "top" (-100 to 100): 0 is center (no shift of video), Default is 30, this is the shift of the video. Instead of merely cropping pixels off the top and bottom, first it shifts the entire video down. I made this function so that it will not chop off the actors heads. -100 shifts the video down to the bottom, 100 shifts it to the top.

float "letterbox": 0=no,1=yes,1< adds this many pixels as a letterbox.

bool "stretch": Stretches video to original size (anamorphic).

By the way I add such weird borders because YV12 colorspace, borders must be multiples of 2. The best thing would be to try the function.

Regards,
Joshbm

scharfis_brain
20th February 2005, 21:06
The AspectRatio() function does just what it says it does. I created it to either crop the edges, stretch, or add black.


hm.. I don't like to rely on functions to resize my video.
I like to do that manually.

The convert60ito24p() function I already had changed to accomodate the blend() function

Okay.

By the way I add such weird borders because YV12 colorspace, borders must be multiples of 2. The best thing would be to try the function.

That's one of the reasons I try to avoid yv12 in all circumstances!
Another reason - the very reduced chroma quality - I mentioned already above.

I always go for quality, and not for speed.

joshbm
20th February 2005, 21:12
Okay thanks for your help!

Modified Script:


LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")

AVISource("G:\test.avi",fourCC="CDVC")
TrimTime("00:21:00:00","00:21:20:00")

FixBrokenChromaUpsampling()
ReInterpolate411()

TDeint(mode=1,type=2,tryweave=false)
AspectRatio().AddBorders(0,1,0,2)
ColorYuv(levels="TV->PC")
convert60ito24p(2)
Levels(10,1.0,255,0,255)

LimitedSharpen(overshoot=7,strength=100)

AddBorders(0,37,0,36)
AddAudio()

ConvertToRGB().GiCoCU("J:\link2\s-curve.amp",photoshop=true)

ConvertToYUY2()