VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Trying to use an upscaling script on some video, and I am getting this error. "for yv12, yv411, yuy2 and yv16 input width must be mod 4". I understand this is because the width isn't divisible by 4?

    This is the script:

    Code:
    LWLibavVideoSource(SOURCE)
    
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=854, fheight=480)
    aWarpSharp2(depth=3)
    Sharpen(0.3)
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=1280, fheight=720)
    aWarpSharp2(depth=5)
    Sharpen(0.5)
    Is there some way to get around this? I don't really want to re-encode all the file first as that will lose quality.
    Quote Quote  
  2. first things that come to mind,...
    your could:
    a. pad the with to mod4 and later remove the padding
    or
    b. convert to RGB24 before the resizing, convert to YV24 before aWarpsharp2 (since it doesn't support YV24) and at the end convert to the color space and sampling you need for your output.
    or
    c. convert to YV24 after loading the source and at the end convert to the color space and sampling you need for your output.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Or change the 854 to 852.
    Quote Quote  
  4. Originally Posted by manono View Post
    Or change the 854 to 852.
    If I change it in the script it doesn't work sadly, I think it's just reading the file regardless of what I set it to.
    Quote Quote  
  5. What's the error message? And what's the source file resolution? If it's non-mod4, you can take one of Selur's suggestions.
    Quote Quote  
  6. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by bradwiggo View Post
    If I change it in the script it doesn't work sadly, I think it's just reading the file regardless of what I set it to.
    That's because you have to change its size to a multiple of 4 BEFORE calling the nnedi3_rpow2() function. fwidth/fheight are only the desired output resolution, they're not related to the input source.

    nnedi3_rpow2() scales your source to exactly the double (with 2 as parameter, like in your case) of its size FIRST (if it's mod4) , THEN it rescale it to fwidth/fheight..
    Quote Quote  
  7. Easiest way is simply use 'c.' and add 'ConvertToYV24()' after the 'LWLibavVideoSource'-line and add for example 'ConvertToYV12()', assuming the source files are not interlaced and YV12.

    --
    when sticking with the input color space even if one changes the input resolution to mod4, 854 still needs to be changed to 852.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  8. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by Selur View Post
    when sticking with the input color space even if one changes the input resolution to mod4, 854 still needs to be changed to 852.
    Obviously.. or you would incur in the same problem when calling the second nnedi3_rpow2().. since that would be the input resolution after the first one, if still 854 been used as target resolution
    Quote Quote  
  9. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    If you don't want to switch between color modes.. then this:

    Code:
    #xRes and yRes must be nearest mod 4 to your source resolution
    
    xRes = 852
    yRes = 480
    
    #I used spline36 as an example, but you can use any avisynth resizer you want, simply change the function.
    
    LWLibavVideoSource(SOURCE).Spline36Resize(xRes,yRes)
    
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=xRes, fheight=yRes)
    aWarpSharp2(depth=3)
    Sharpen(0.3)
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=1280, fheight=720)
    aWarpSharp2(depth=5)
    Sharpen(0.5)
    should work.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!