Log in

View Full Version : Is this video sortable? + ApplyRange ?


Arshad07
1st June 2009, 14:40
http://i40.tinypic.com/15y90ux.jpghttp://i44.tinypic.com/zu04sx.jpg

script:-

DGDecode_mpeg2source("D2V.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate()
crop( 0, 50, 0, -56)
Addborders(0,68,0,68)
Spline64Resize(720,480)

Sample (http://www.sendspace.com/file/5iux9s)

This movie has variable a/r all the way, is there a method to sort this out? like resize differently at different frames?

Any help appreciated!

thetoof
1st June 2009, 15:45
Croma is a mess in a few fields.

You can see it with a simple mpeg2source("file.d2v").bob() around 0:18.285

You'll need the help of the expert deblenders of this forum. At first I thought chroma_rep would help... but in the end not much since there's more than 2 messed up frames in a row after bobbing.

scharfis_brain
1st June 2009, 16:00
mpeg2source("F:\forum\Arshad07\VTS_04_1.demuxed.d2v") #,cpu=6)
tfm(pp=0).mergechroma(tdeint(type=2))
tdecimate()

Arshad07
1st June 2009, 17:37
mpeg2source("F:\forum\Arshad07\VTS_04_1.demuxed.d2v") #,cpu=6)
tfm(pp=0).mergechroma(tdeint(type=2))
tdecimate()

thank you, works like a charm.

Anyone can tell me how to use applyrange to crop differently at different frames?

thetoof
1st June 2009, 23:08
Mmmh actually not completely. The problem is still present (even if less apparent). One can see (even at playback speed) some green and red flashes near his shirt

For applyrange, dunno, never used. I prefer:
s=source
a=s.crop.resize
b=s.crop.resize
c=.....
a+b+c......

kemuri-_9
2nd June 2009, 01:52
Anyone can tell me how to use applyrange to crop differently at different frames?

in keeping with the constant frame size requirement, this could be done like:

function ApplyCrop(clip clip, float left, float top, float right, float bottom, bool stretch, int "color") {
color = Default(color, $000000)
return (stretch) ? Spline36Resize(clip, Width(clip), Height(clip), left, top, right, bottom) :\
Crop(clip, Int(left), Int(top), Int(right), Int(bottom)).AddBorders(Int(left), Int(top), Abs(Int(right)), Abs(Int(bottom)), color)
}

ColorBars()
ApplyRange(10,30,"ApplyCrop",0,80.8,-60.6,0,true)
ApplyRange(60,100,"ApplyCrop",40.4,0,0,-20.2,false,$FF0000)


where the method of returning to the original frame resolution depends on if you want to stretch or pad back after the crop.

Gavino
2nd June 2009, 02:29
Crop(clip, Int(left), Int(top), Int(right), Int(bottom)).AddBorders(Int(left), Int(top), Abs(Int(right)), Abs(Int(bottom)), color)
I think this only works when right/bottom are negative/zero. For positive values, the border size needs to be calculated differently, by subtracting from width/height.

kemuri-_9
2nd June 2009, 03:07
I think this only works when right/bottom are negative/zero. For positive values, the border size needs to be calculated differently, by subtracting from width/height.

yeah, but i prefer doing it by the crop values on all 4 sides rather than 2 crop values and destination resolution.

Gavino
2nd June 2009, 08:20
If the function is not intended to work with positive values (when stretch=false), it would be better to add an Assert statement to give an error in these cases. You may prefer never to use them, but how were we supposed to know that?

kemuri-_9
2nd June 2009, 17:56
it's mostly meant as an example of how to use ApplyRange to crop.
naturally as i intended it to be an example, i did not add in stipulations to handle the other use cases of Crop()

JohannesL
2nd June 2009, 18:36
I recommend JDL_ApplyRange, it's much better than the internal ApplyRange and allows multiple filters.

Arshad07
3rd June 2009, 18:34
Mmmh actually not completely. The problem is still present (even if less apparent). One can see (even at playback speed) some green and red flashes near his shirt



so what do u suggest i do? :o

thetoof
3rd June 2009, 21:32
either a more powerful deblending option or fft3d filtering with optimized filtering for sigma, sigma2, sigma3 and sigma4 on plane=3.

You will most likely need to increase the saturation afterwards if your filtering is agressive enough to remove the flashing spots.