This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Not working Preview and Avisynth preview
Not working Preview and Avisynth preview
The Preview crashes since it opens the Avisynth script and that crashes.
Looking at the Avisynth script
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\LimitedSharpenFaster.avs")
# loading source: C:\1.mkv
#  input color sampling YV12
#  input luminance scale tv
Source = FFVideoSource("C:\1.mkv",cachefile="C:\Windows\Temp\mkv_c320a4c829187fb5c9c9083a7ece468a_853323747_1_0.ffindex",fpsnum=25,colorspace="YV12")
# current resolution: 720x576
SourceFiltered = Source
SourceFiltered = SourceFiltered.AssumeFrameBased().SeparateFields()
# cropping to 708x448
SourceFiltered = SourceFiltered.Crop(2,31,-10,-33)
# current resolution: 708x448  (SourceFiltered)
Source = Source.AssumeFrameBased().SeparateFields()
Source = Source.Crop(2,31,-10,-33)
# current resolution: 708x448  (Source)
# filtering
# color modifications
SourceFiltered = SourceFiltered.Tweak(sat=1.20,dither=true)
SourceFiltered = SourceFiltered.Levels(0,1.00,255,0,255,dither=true)
# sharpening
SourceFiltered = SourceFiltered.LimitedSharpenFaster(Smode=1,strength=160,edgemode=0)
# scaling
Source = Source.BicubicResize(768,456)
# current resolution: 768x456
Source = Source.Weave()
SourceFiltered = SourceFiltered.nnedi3_rpow2(rfactor=2,cshift="GaussResize",fwidth=768,fheight=456)
SourceFiltered = SourceFiltered.Weave()
# stacking horizontal for filter preview
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec709")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
return last
The problem I see is:
SourceFiltered = SourceFiltered.Crop(2,31,-10,-33)
Yv12 on itself requires mod2 crop values for width and height.
Interlaced Yv12 content requires mod4 crop values.
Normally this is not a problem since Hybrid deinterlaced by default and thus it's only restricted to mod2, but since you choose not to deinterlace and clearly didn't know enough about the color sampling you ran into this problem.

I could:
a. write some code next week (busy over the weekend), to catch this warn the User and not show the preview
b. write additional code to do a ConvertToRGB before applying the cropping and convert back afterwards. Normally I would advice against this (due to the impact on the speed), but for preview purposes only it is probably okay.
-> not sure how and if I will implement any of these. For the time being make sure to crop the height with mod4 values and the preview should be fine.

Cu Selur
Quote:not sure how and if I will implement any of these. For the time being make sure to crop the height with mod4 values and the preview should be fine.
Now and always I put mod4 values, but preview not working.
You misunderstood what I wrote:
You resize to mod4, but at least the values you used for cropping for the preview the script was from were mod2.
SourceFiltered = SourceFiltered.Crop(2,31,-10,-33)
So your crop values were:
left: 2
top: 62 <- which is mod2
right: 10
bottom: 66 <- which is mod2

For further understanding:
What happens is that the fields get separated by SeparateFields() and each field has half of the height of the original, now they get cropped for which the top and bottom values need to be halved to accommodate the halved height.
Thus each frame get's cropped at the top by 31 and at the bottom by 33, problem is that the field is still YV12 and thus does not allow cropping by odd numbers. Smile

Cu Selur

Forum Jump:

Users browsing this thread: 1 Guest(s)