PDA

View Full Version : Cropping problems not sure how to fix


Socio
27th November 2004, 04:21
I have strange and very frustrating cropping problem and I have been working off and on, on this problem for days. I need to crop but if I use either “crop(16,8,-16,-8)” or “crop(16,8,-16,-8, true) calls in my settings the image gets scrambled? See pics:

What it should look like

http://img96.exs.cx/img96/4842/grabnorm.jpg

What happens if I try to crop

http://img96.exs.cx/img96/8719/grabbad.jpg


This is how my settings look with crop:

SetMemoryMax(96)

Import("C:\Program Files\AviSynth 2.5\plugins\IIP.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools-p4-5.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dustv5.dll")

crop(16,8,-16,-8)

iip (duststr=2, dustweight=1.0,
\ ss1_x=2.0, ss1_y=2.0,
\ detailcontr1=104, detailcontr2=208,
\ contr_radius=2, PixSharp=0.0,
\ ss2_x=2.0, ss2_y=2.0,
\ XSmode=3, Xstren=50, Xradius=2, XLmode=2,
\ Xovershoot=1, Xwide=false, Xsoft=false,
\ subpelstren=0.0, flatweight=0,
\ antiflicker1=true, antiflicker2=true,
\ protect_floor=4, protect_bias=20,
\ dering=-60, dering_weight=1.0,
\ dering_floor=8, dering_bias=8,
\ detail_floor=16,
\ EQ=2, exborder=true,
\ warp_Y=false, warp_UV=false,
\ debug="dering | protect | detail | compareH | compareV | compareT | showall",
\ cropx=8, cropy=8
\ )

ColorMatrix()


Any ideas?

Thanks

Mug Funky
27th November 2004, 07:57
in VDMod, what does it say is decoding your video?

YV12 should be decoded by either xvid or ffdshow, or something else that doesn't produce the image you got there :)

you can hack the registry to change what decodes YV12.

[edit]

wait a sec - it looks like it's being fed to IIP like that. very strange indeed.

what's your whole script?

Socio
27th November 2004, 14:44
Mug Funky,

That is my whole settings script, if you are refering to the IIP/LimitedSharpen script the I am using Didee's IIP/Limitedsharpen combo script from the LimitedSharpen thread.

I have ffdshow, but just downloaded and installed xvid where can I find info on the registry hack to force it to xvid to see if it fixes the problem?

Thanks


Another thought; if it is using ffdshow for YV12 would my current ffdshow settings for on the fly DVD watching via Zoomplayer which is also YV12 output be effecting the out come of YV12 in other programs with out actually making some kind of call to ffdshow?

Now this would be very interesting because if so then any filters could be used in ffdshow a long with the Avisynth script, you could even run dual Avisynth scripts, one inside ffdshow and another one prior to encoding or re-encoding if you wanted to. Also if true, the question would be which comes first the ffdshow filters\script or external Aviscript script\filters?

tedkunich
27th November 2004, 19:59
Originally posted by Socio
That is my whole settings script,

That is NOT your whole script... what is the vid source? avisource? mpeg2source?


Originally posted by Socio
you could even run dual Avisynth scripts, one inside ffdshow and another one prior to encoding or re-encoding if you wanted to. Also if true, the question would be which comes first the ffdshow filters\script or external Aviscript script\filters?


Probably a very bad idea... Avisynth is not multithreaded - we won't even go into the pluggins... this setup would undoubtedly result in really really strange behaviour.

T

Socio
27th November 2004, 21:57
I found the registry hack and changed the YV12 output to DivX but I still get the strange scrambled image using it if I try to crop.

I am re-encoding my Starwars EP1 dvd using scripts|filters in the script I posted via DVD Rebuilder.

The actuall AVS script would be this if I try to crop:


#------------------
# AVS File Created by DVD Rebuilder
# VOBID:01, CELLID:01
#------------------
mpeg2source("E:\MOVIES\D2VAVS\V04.D2V")
trim(0,89)
SetMemoryMax(96)

Import("C:\Program Files\AviSynth 2.5\plugins\IIP.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools-p4-5.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dustv5.dll")

crop(16,8,-16,-8)

iip (duststr=2, dustweight=1.0,
\ ss1_x=2.0, ss1_y=2.0,
\ detailcontr1=104, detailcontr2=208,
\ contr_radius=2, PixSharp=0.0,
\ ss2_x=2.0, ss2_y=2.0,
\ XSmode=3, Xstren=50, Xradius=2, XLmode=2,
\ Xovershoot=1, Xwide=false, Xsoft=false,
\ subpelstren=0.0, flatweight=0,
\ antiflicker1=true, antiflicker2=true,
\ protect_floor=4, protect_bias=20,
\ dering=-60, dering_weight=1.0,
\ dering_floor=8, dering_bias=8,
\ detail_floor=16,
\ EQ=2, exborder=true,
\ warp_Y=false, warp_UV=false,
\ debug="dering | protect | detail | compareH | compareV | compareT | showall",
\ cropx=8, cropy=8
\ )

ColorMatrix()

Boulder
27th November 2004, 22:10
Try to change the cropping values slightly and see what happens. You could also try installing the Helix YV12 codec, search on this forum should provide a link.

Socio
28th November 2004, 15:55
I will give that Helix YV12 codec a try it sounds interesting, but for now I found a work around, I can use ffdshow for YV12 and just crop in ffdshows avisynth plugin, then re-encode with my main script via DVD-rebuilder in effect running Avisynth twice which makes it a bit slower but it works.

This also proves you can easily use ffdshow filters, a second Avisynth script, or even Dscaler filters via ffdshow when encoding YV12 using ffdshow. I am not using the latest version of ffdshow because the SSE version give Aviscript errors but I believe it even has a VDMod plugin so you could even using VDMod filters as well, I think.

Leak
29th November 2004, 08:18
Originally posted by Socio
I will give that Helix YV12 codec a try it sounds interesting, but for now I found a work around, I can use ffdshow for YV12 and just crop in ffdshows avisynth plugin, then re-encode with my main script via DVD-rebuilder in effect running Avisynth twice which makes it a bit slower but it works.

Ugh... that doesn't sound like much fun... :)

Anyway, maybe try adding "align=true" to your crop, that might fix it.

Wilbert
29th November 2004, 11:08
Try

SetMemoryMax(96)

mpeg2source("E:\MOVIES\D2VAVS\V04.D2V")
trim(0,89)
crop(16,8,-16,-8)

first. Do you still see it?