VideoHelp Forum


Try NordVPN to access Netflix or other streaming services from any country and also surf safe!
+ Reply to Thread
Page 3 of 3
FirstFirst 1 2 3
Results 61 to 89 of 89
Thread
  1. Originally Posted by jagabo View Post
    PotPlayer won't let an AviSynth script change the frame size internally. If the script enlarges the frame horizontally you will only see the left portion of the frame.
    Bummer.

    So why do your earlier screenshots look okay, with borders each side as expected?
    Quote Quote  
  2. It says so right on the dialog:
    Image
    [Attachment 58542 - Click to enlarge]
    Image Attached Thumbnails Click image for larger version

Name:	noresize.png
Views:	11
Size:	25.1 KB
ID:	58541  

    Quote Quote  
  3. Originally Posted by hello_hello View Post
    Originally Posted by jagabo View Post
    PotPlayer won't let an AviSynth script change the frame size internally. If the script enlarges the frame horizontally you will only see the left portion of the frame.
    Bummer.

    So why do your earlier screenshots look okay, with borders each side as expected?
    Because it was being used to fill the black borders of an existing frame (4:3 video in a 16:9 DAR frame).
    Quote Quote  
  4. Originally Posted by jagabo View Post
    PotPlayer won't let an AviSynth script change the frame size internally. If the script enlarges the frame horizontally you will only see the left portion of the frame.
    I still like your script the best! With that being said, is it possible to have your script zoom into the video? Like hello_hello suggested below?


    ImageSource("D:\script.jpg")
    ConvertToYV12()
    CropResize(704,468, 0,0,0,-32)
    CropResize(832,468, NoResize=true, Borders=true, Frosty=true)


    Or does that fall into the same limitation you described that potplayer has?

    I have saved a custom frame size preset in potplayer, but it would be nice if I could have it changed automatically. My desired outcome would be something like pictured below.
    Image Attached Thumbnails Click image for larger version

Name:	3.jpg
Views:	7
Size:	50.2 KB
ID:	58544  

    Quote Quote  
  5. Here's how to make FrostyBorders work with Potplayer.

    - Install the ffdshow raw video decoder. You can install all the ffdshow goodies, but the raw video decoder is all that's needed.



    - Add it to Potplayer as an external filter. Set it to "prefer".



    - Double click on the filter to open it's configuration.



    - Now it works.



    thebib62,
    I assume you could crop to a wider aspect ratio than 4:3 with CropResize, then use jagabo's script to add the borders, but I assume you'll need to use the ffdshow method. I think I have a wrapper function for CropResize that can be used to zoom-in and crop regardless of the source resolution. I'll see if I can find it soonish.
    Quote Quote  
  6. Here's my contribution. The function is called CR15 as it's a wrapper function for CropResize that crops to an aspect ratio of 1.5 (within a mod4 limitation) to reduce the border size. It should crop more from the bottom than the top and if you specify an input DAR/SAR for an anamorphic source, it'll take care of resizing to square pixel dimensions.

    I've followed it with FrostyBorders, but you can ask jagabo to replace FrostyBorders with his function instead.

    Code:
    # ===============================================================================
    
    function CropAR(clip Source, \
    int "OutWidth", int "OutHeight", \
    int "CL", int "CT", int "CR", int "CB", val "CropDAR", int "CSplit", bool "CAlign", \
    bool "AutoC", int "CThresh", int "CStart", int "CSample", \
    int "CPreview", int "CLine", \
    val "InDAR", val "InSAR", val "OutDAR", val "OutSAR", bool "AutoAspect", \
    int "Mod", int "HMod", \
    bool "NoResize", bool "ResizeWO", \
    bool "Borders", bool "CleanBorders", val "BColor", bool "Frosty", \
    int "ColorCorrect", string "ColorMode", string "Resizer", int "GMode", bool "RMode", \
    int "PicDim", bool "Position", bool "Info")   {
    
    Source_Width = width(Source)
    F_Source_Width = float(Source_Width)
    Source_Height = height(Source)
    F_Source_Height = float(Source_Height)
    
    CL = default(CL, 0)
    CT = default(CT, 0)
    CR = default(CR, 0)
    CB = default(CB, 0)
    CR = (CR == 0) ? 0 : (CR < 0) ? CR : CR - Source_Width + CL
    CB = (CB == 0) ? 0 : (CB < 0) ? CB : CB - Source_Height + CT
    CropDAR = default(CropDAR, 1.5)
    InDAR = default(InDAR, 0.0)
    InSAR = default(InSAR, 0.0)
    Mod = default(Mod, 4)
    HMod = default(HMod, 4)
    Borders = default(Borders, false)
    
    F_Cropped_Source_Width = F_Source_Width - CL + CR
    F_Cropped_Source_Height = F_Source_Height - CT + CB
    
    Cropped_Source_StorageAR = F_Cropped_Source_Width / F_Cropped_Source_Height
    Cropped_Source_DAR = (InDAR > 0) ? \
    F_Cropped_Source_Width * F_Source_Height * InDAR / F_Cropped_Source_Height / F_Source_Width : \
    (InSAR > 0) ? F_Cropped_Source_Width * InSAR / F_Cropped_Source_Height : Cropped_Source_StorageAR
    
    CB = (Cropped_Source_DAR >= CropAR) ? CB : CB - (floor(F_Cropped_Source_Height * 0.02) * 2)
    
    CropResize(Source, \
    OutWidth=OutWidth, OutHeight=OutHeight, \
    CL=CL, CT=CT, CR=CR, CB=CB, CropDAR=CropDAR, CSplit=CSplit, CAlign=CAlign, \
    AutoC=AutoC, CThresh=CThresh, CStart=CStart, CSample=CSample, \
    CPreview=CPreview, CLine=CLine, \
    InDAR=InDAR, InSAR=InSAR, OutDAR=OutDAR, OutSAR=OutSAR, AutoAspect=AutoAspect, \
    Mod=Mod, HMod=HMod, \
    NoResize=NoResize, ResizeWO=ResizeWO, \
    Borders=Borders, CleanBorders=CleanBorders, BColor=BColor, Frosty=Frosty, \
    ColorCorrect=ColorCorrect, ColorMode=ColorMode, Resizer=Resizer, GMode=GMode, RMode=RMode, \
    PicDim=PicDim, Position=Position, Info=Info)   }
    
    # ===============================================================================)   }
    Code:
    Clip = ffdshow_source()
    CropAR(Clip, InDAR=15.0/11.0)
    W = width()
    H = height()
    FrostyBorders(floor(H * 16.0 / 9.0 / 4.0) * 4, H)
    Image
    [Attachment 58547 - Click to enlarge]


    Image
    [Attachment 58548 - Click to enlarge]


    Original

    Image
    [Attachment 58549 - Click to enlarge]
    Last edited by hello_hello; 23rd Apr 2021 at 07:46.
    Quote Quote  
  7. I tried using what you just posted, but I get this error.



    I saved
    Code:
    function CR15(clip Source, \
    int "OutWidth", int "OutHeight", \
    int "CL", int "CT", int "CR", int "CB", val "CropDAR", int "CSplit", bool "CAlign", \
    bool "AutoC", int "CThresh", int "CStart", int "CSample", \
    int "CPreview", int "CLine", \
    val "InDAR", val "InSAR", val "OutDAR", val "OutSAR", bool "AutoAspect", \
    int "Mod", int "HMod", \
    bool "NoResize", bool "ResizeWO", \
    bool "Borders", bool "CleanBorders", val "BColor", bool "Frosty", \
    int "ColorCorrect", string "ColorMode", string "Resizer", int "GMode", bool "RMode", \
    int "PicDim", bool "Position", bool "Info")   {
    
    Source_Width = width(Source)
    F_Source_Width = float(Source_Width)
    Source_Height = height(Source)
    F_Source_Height = float(Source_Height)
    
    CL = default(CL, 0)
    CT = default(CT, 0)
    CR = default(CR, 0)
    CB = default(CB, 0)
    CR = (CR == 0) ? 0 : (CR < 0) ? CR : CR - Source_Width + CL
    CB = (CB == 0) ? 0 : (CB < 0) ? CB : CB - Source_Height + CT
    CropDAR = default(CropDAR, 1.5)
    InDAR = default(InDAR, 0.0)
    InSAR = default(InSAR, 0.0)
    Mod = default(Mod, 4)
    HMod = default(HMod, 4)
    Borders = default(Borders, false)
    
    F_Cropped_Source_Width = F_Source_Width - CL + CR
    F_Cropped_Source_Height = F_Source_Height - CT + CB
    
    Cropped_Source_StorageAR = F_Cropped_Source_Width / F_Cropped_Source_Height
    Cropped_Source_DAR = (InDAR > 0) ? \
    F_Cropped_Source_Width * F_Source_Height * InDAR / F_Cropped_Source_Height / F_Source_Width : \
    (InSAR > 0) ? F_Cropped_Source_Width * InSAR / F_Cropped_Source_Height : Cropped_Source_StorageAR
    
    CB = (Cropped_Source_DAR >= 1.5) ? CB : CB - (floor(F_Cropped_Source_Height * 0.02) * 2)
    
    CropResize(Source, OutWidth, OutHeight, CL, CT, CR, CB, CropDAR, CSplit, CAlign, AutoC, CThresh, CStart, \
    CSample, CPreview, CLine, InDAR, InSAR, OutDAR, OutSAR, AutoAspect, Mod, HMod, NoResize, ResizeWO, \
    Borders, CleanBorders, BColor, Frosty, ColorCorrect, ColorMode, Resizer, GMode, RMode, PicDim, Position, Info)   }
    to a .avsi and placed it in C:\Program Files (x86)\AviSynth+\plugins

    and I put
    Code:
    CR15(InDAR=15.0/11.0)
    W = width()
    H = height()
    FrostyBorders(floor(H * 16.0 / 9.0 / 4.0) * 4, H)
    in FFDSHOW raw video decoder.
    Image Attached Thumbnails Click image for larger version

Name:	Clipboard-20210422.png
Views:	14
Size:	144.4 KB
ID:	58551  

    Last edited by thebib62; 22nd Apr 2021 at 20:15.
    Quote Quote  
  8. Originally Posted by hello_hello View Post
    So why do your earlier screenshots look okay, with borders each side as expected?
    Oops. I took a closer look at the script I gave earlier. I remembered incorrectly what it does. It's for playing 4:3 videos. It horizontally squeezes the 4:3 frame as if it's making an anamorphic 16:9 video, then overlays that onto a blurry version of the original video. So the frame size remains the same, but the user has to force the player to stretch it to 16:9.
    Quote Quote  
  9. Originally Posted by jagabo;26That's01
    I took a closer look at the scripts I gave earlier. I remembered incorrectly what it does. It's for playing 4:3 videos. It horizontally squeezes the 4:3 image as if it was packing it into a 16:9 DAR frame and overlays that onto a blurry version of the video. So the frame size remains the same, but the user has to force the player to stretch it to 16:9.
    That's what I have been doing. And it works fantastically. I wanted to know if it's possible to use hello's script above in your script? More specifically his script's ability to zoom into the 4x3 video a little bit so the blurred edges aren't as noticeable.
    Quote Quote  
  10. Originally Posted by thebib62 View Post
    Izoom into the 4x3 video a little bit so the blurred edges aren't as noticeable.
    I created a script with a zoom feature but I was working with the wrong assumption about the source. I was assuming the source was already a 4:3 image pillarboxed in at 16:9 frame. So I have to re-write it to make it work like the earlier script. I'll do that later when I have some time.
    Quote Quote  
  11. Originally Posted by thebib62 View Post
    I tried using what you just posted, but I get this error.
    Nothing is ever easy.
    I don't know why you're getting that error, but I've edited the scripts in my previous post, which should eliminate any possible argument name ambiguity. Try the new versions to see if they work.

    Edit: I've added them to this post too. The function is now called CropAR, as you can change the cropping aspect ratio. See the example below.

    Code:
    # ===============================================================================
    
    function CropAR(clip Source, \
    int "OutWidth", int "OutHeight", \
    int "CL", int "CT", int "CR", int "CB", val "CropDAR", int "CSplit", bool "CAlign", \
    bool "AutoC", int "CThresh", int "CStart", int "CSample", \
    int "CPreview", int "CLine", \
    val "InDAR", val "InSAR", val "OutDAR", val "OutSAR", bool "AutoAspect", \
    int "Mod", int "HMod", \
    bool "NoResize", bool "ResizeWO", \
    bool "Borders", bool "CleanBorders", val "BColor", bool "Frosty", \
    int "ColorCorrect", string "ColorMode", string "Resizer", int "GMode", bool "RMode", \
    int "PicDim", bool "Position", bool "Info")   {
    
    Source_Width = width(Source)
    F_Source_Width = float(Source_Width)
    Source_Height = height(Source)
    F_Source_Height = float(Source_Height)
    
    CL = default(CL, 0)
    CT = default(CT, 0)
    CR = default(CR, 0)
    CB = default(CB, 0)
    CR = (CR == 0) ? 0 : (CR < 0) ? CR : CR - Source_Width + CL
    CB = (CB == 0) ? 0 : (CB < 0) ? CB : CB - Source_Height + CT
    CropDAR = default(CropDAR, 1.5)
    InDAR = default(InDAR, 0.0)
    InSAR = default(InSAR, 0.0)
    Mod = default(Mod, 4)
    HMod = default(HMod, 4)
    Borders = default(Borders, false)
    
    F_Cropped_Source_Width = F_Source_Width - CL + CR
    F_Cropped_Source_Height = F_Source_Height - CT + CB
    
    Cropped_Source_StorageAR = F_Cropped_Source_Width / F_Cropped_Source_Height
    Cropped_Source_DAR = (InDAR > 0) ? \
    F_Cropped_Source_Width * F_Source_Height * InDAR / F_Cropped_Source_Height / F_Source_Width : \
    (InSAR > 0) ? F_Cropped_Source_Width * InSAR / F_Cropped_Source_Height : Cropped_Source_StorageAR
    
    CB = (Cropped_Source_DAR >= CropDAR) ? CB : CB - (floor(F_Cropped_Source_Height * 0.02) * 2)
    
    CropResize(Source, \
    OutWidth=OutWidth, OutHeight=OutHeight, \
    CL=CL, CT=CT, CR=CR, CB=CB, CropDAR=CropDAR, CSplit=CSplit, CAlign=CAlign, \
    AutoC=AutoC, CThresh=CThresh, CStart=CStart, CSample=CSample, \
    CPreview=CPreview, CLine=CLine, \
    InDAR=InDAR, InSAR=InSAR, OutDAR=OutDAR, OutSAR=OutSAR, AutoAspect=AutoAspect, \
    Mod=Mod, HMod=HMod, \
    NoResize=NoResize, ResizeWO=ResizeWO, \
    Borders=Borders, CleanBorders=CleanBorders, BColor=BColor, Frosty=Frosty, \
    ColorCorrect=ColorCorrect, ColorMode=ColorMode, Resizer=Resizer, GMode=GMode, RMode=RMode, \
    PicDim=PicDim, Position=Position, Info=Info)   }
    
    # ===============================================================================
    Code:
    Clip = ffdshow_source()
    CropAR(Clip, InDAR=15.0/11.0)
    W = width()
    H = height()
    FrostyBorders(floor(H * 16.0 / 9.0 / 4.0) * 4, H)
    Unless the source is anamorphic, you don't need to specify an InDAR.

    Code:
    Clip = ffdshow_source()
    CropAR(Clip)
    W = width()
    H = height()
    FrostyBorders(floor(H * 16.0 / 9.0 / 4.0) * 4, H)
    The CropAR function doesn't zoom as such. It just crops a little top and bottom to widen the aspect ratio. If it crops from the sides, it'd be only what's required to prevent aspect error. You can force it to crop a minimum amount from the sides though, to ensure the edges are nice and clean.

    CropAR(Clip, CL=4, CR=-2, InDAR=15.0/11.0)

    To change the size of the borders, you can specify a cropping display aspect ratio other than the default of 1.5.
    The following would cause the script to crop the source to 1.6 instead, making the borders smaller.

    CropAR(Clip, CL=4, CR=-2, CropDAR=1.6, InDAR=15.0/11.0)
    Last edited by hello_hello; 23rd Apr 2021 at 07:44.
    Quote Quote  
  12. Here's another border idea for you.

    Code:
    function QGaussBlur(clip v)   {
    return v\
    .BilinearResize(max(16, floor(float(width(v)) / 100.0 / 2.0) *2), max(16, floor(float(height(v)) / 100.0 / 2.0) * 2))\
    .GaussResize(v.width, v.height, p=19)   }
    Code:
    Clip = ffdshow_source()
    CropAR(Clip, CropDAR=1.6)
    
    OutputClip = last
    CWidth = width(OutputClip)
    
    H = height()
    LRB = (floor(H * 16.0 / 9.0 / 2.0) * 2) - CWidth
    LB = floor(LRB / 4.0) * 2
    RB = LRB - LB
    
    Background = StackHorizontal(OutputClip.crop(0, 0, -CWidth+64, 0), \
    OutputClip.crop(CWidth-64, 0, 0, 0))\
    .TemporalSoften(7, 255, 255, 20, 2).ColorYUV(gain_y=-50)
    
    Left1 = Background.crop(0, 0, -width(Background)+16, 0)
    Right1 = Background.crop(width(Background)-16, 0, 0, 0)
    Left2 = Overlay(Left1, FlipHorizontal(Right1), Opacity=0.2)
    Right2 = Overlay(Right1, FlipHorizontal(Left1), Opacity=0.2)
    LeftBorder = Left2.QGaussBlur().Blur(1.4).Blur(1.4).Spline36Resize(LB, H)
    RightBorder = Right2.QGaussBlur().Blur(1.4).Blur(1.4).Spline36Resize(RB, H)
    
    StackHorizontal(LeftBorder, OutputClip, RightBorder)

    Image
    [Attachment 58566 - Click to enlarge]


    Image
    [Attachment 58567 - Click to enlarge]
    Last edited by hello_hello; 23rd Apr 2021 at 07:55.
    Quote Quote  
  13. Here's my script modified to accept a zoom value:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.167
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    You can change the zoom value. For non-anamorphic 4:3 videos a zoom value of 1.0 is equivalent to my original script. 1.333 is fully zoomed (and cropped, no borders). 1.167 is about half way in between. As with the original script, you must force PotPlayer to a 16:9 aspect ratio.
    Last edited by jagabo; 26th Apr 2021 at 16:18.
    Quote Quote  
  14. Originally Posted by jagabo View Post
    Here's my script modified to accept a zoom value:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.167
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0)
    Spline36Resize(uncropped.width, uncropped.height)
    You can change the zoom value. For non-anamorphic 4:3 videos a zoom value of 1.0 is equivalent to my original script. 1.333 is fully zoomed (and cropped, no borders). 1.167 is about half way in between. As with the original script, you must force PotPlayer to a 16:9 aspect ratio.
    Thanks to both you and hello_hello. You both have taken a lot of your time helping me get this script fine tuned for use with potplayer.
    I wiill be using jagabo's script, since it doesn't require any more software to be installed, other than avisynth. The code is shorter, and much easier for me to understand and change the values. The CPU usage remains the same with or without the script enabled. CPU usage is important for me since I use cheap mini pc's with a slow CPU. Anything too intensive that runs on that PC will slow it down and make viewing videos not a possibility. The script is PERFECT and is exactly what I wanted. Thanks again for taking the time to read, reply and edit your scripts for potplayer!

    I could report back to this thread if I come across any issues. I've been using jagabo's script all afternoon and everything plays fine.
    Quote Quote  
  15. By the way, if you don't want to use the ITU cropping just set src = uncropped (leave out the following crop). Most of my 4:3 videos have black borders at the left and right.
    Quote Quote  
  16. Originally Posted by jagabo View Post
    By the way, if you don't want to use the ITU cropping just set src = uncropped (leave out the following crop). Most of my 4:3 videos have black borders at the left and right.
    After using the script for a couple of days, I've noticed that the zoom part of the script is applied, even to 16 x 9 videos. Is it possible to not have the zoom value applied to 16 x 9 videos? The blurred edges effect is not applied to 16 x 9 videos. Only the zoom value is.
    Quote Quote  
  17. Originally Posted by thebib62 View Post
    Originally Posted by jagabo View Post
    By the way, if you don't want to use the ITU cropping just set src = uncropped (leave out the following crop). Most of my 4:3 videos have black borders at the left and right.
    After using the script for a couple of days, I've noticed that the zoom part of the script is applied, even to 16 x 9 videos. Is it possible to not have the zoom value applied to 16 x 9 videos? The blurred edges effect is not applied to 16 x 9 videos. Only the zoom value is.
    It looks liked I missed the last line when I cut/pasted. Add this at the end:

    Code:
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    I'll edit the earlier post and put it in.
    Quote Quote  
  18. Originally Posted by jagabo View Post
    Originally Posted by thebib62 View Post
    Originally Posted by jagabo View Post
    By the way, if you don't want to use the ITU cropping just set src = uncropped (leave out the following crop). Most of my 4:3 videos have black borders at the left and right.
    After using the script for a couple of days, I've noticed that the zoom part of the script is applied, even to 16 x 9 videos. Is it possible to not have the zoom value applied to 16 x 9 videos? The blurred edges effect is not applied to 16 x 9 videos. Only the zoom value is.
    It looks liked I missed the last line when I cut/pasted. Add this at the end:

    Code:
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    I'll edit the earlier post and put it in.

    Thanks for that fix. Everything works perfectly now!
    Since you seem to be so familiar with AVIsynth would you be able to tell me if feathering the borders of the video is possible?
    I've attached two pictures. The first picture is how your script acts now. The second one is what I'm referring to in my question.
    Image Attached Thumbnails Click image for larger version

Name:	current script.jpg
Views:	11
Size:	103.8 KB
ID:	58615  

    Click image for larger version

Name:	feather.jpg
Views:	14
Size:	102.2 KB
ID:	58616  

    Quote Quote  
  19. Something like:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.167
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height)
    bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    Quote Quote  
  20. Wow! I am so impressed at the final result. Your script once again does exactly what I want it to do.
    I didn't think implementing the feathering feature would be possible to do in real time. Your expertise clearly shows with these scripts.
    Thank you for taking the time to help me with these revisions. I have taken far too much of your time.
    Your time, patience, and knowledge are all greatly appreciated!
    Quote Quote  
  21. Originally Posted by jagabo View Post
    Something like:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.167
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height)
    bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    Been using your updated script for 2 weeks, and love it. Although, I came across some videos that the script does not seem to work with. The video is under the frame size constraint you gave it float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped and it is 4:3 but I do not understand why the script is bypassing the video.

    I have posted the actual video along with the media info. I hope someone could help me with this.

    Code:
    General
    Complete name                            : F:\Live Action\Unsolved Mysteries\Season 8\Unsolved.Mysteries.S08E02.720p.AMZN.WEBRIP.AAC2.0.H.264-RYOTING_H.265.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/mp41)
    File size                                : 248 MiB
    Duration                                 : 43 min 30 s
    Overall bit rate                         : 796 kb/s
    Movie name                               : s08e02 - Episode: 2
    Performer                                : Unsolved Mysteries: Original Robert Stack Episodes - 1996
    Recorded date                            : 1995-12-31T05:00:00
    Writing application                      : Lavf58.77.100
    Comment                                  : This episode includes: Deadly Doses & UD, Missing Bird People, Baby's Breath and Fawzi's Son & UD.
    
    Video
    ID                                       : 1
    Format                                   : HEVC
    Format/Info                              : High Efficiency Video Coding
    Format profile                           : Main@L5.1@Main
    Codec ID                                 : hvc1
    Codec ID/Info                            : High Efficiency Video Coding
    Duration                                 : 43 min 30 s
    Bit rate                                 : 660 kb/s
    Width                                    : 640 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate mode                          : Constant
    Frame rate                               : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.072
    Stream size                              : 205 MiB (83%)
    Color range                              : Limited
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    Codec configuration box                  : hvcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 43 min 30 s
    Source duration                          : 43 min 30 s
    Source_Duration_LastFrame                : -6 ms
    Bit rate mode                            : Constant
    Bit rate                                 : 128 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 46.875 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 40.0 MiB (16%)
    Source stream size                       : 40.0 MiB (16%)
    Title                                    : Stereo
    Default                                  : Yes
    Alternate group                          : 1
    mdhd_Duration                            : 2610341
    Quote Quote  
  22. It's working here.

    Image
    [Attachment 58831 - Click to enlarge]


    In case my version has changed, cut and past from PotPlayer:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.167
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height)
    bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped
    You might want to lower the 1.77 threshold value in case a few widescreen videos have a little cropping at the left and right edges (making the AR a little less than 1.77). Maybe 1.70. Or as low as 1.4.
    Quote Quote  
  23. I found out that it is not working for me, along with the preloaded avisnth scrtips such as colorbars.avs, because of the h265 codec. They run properly while playing H264 videos, though.
    I was not able to get avisynth working with H265 videos. I am curious as to how you got it working with h265?

    Did you change any settings in potplayer other than enabling AVIsynth and stretching the video in potplayer? Do you have it installed or using the portable version? Which version of AVIsynth are you using?
    Quote Quote  
  24. Potplayer has a built in h.265/HEVC decoder. That's what I'm using. It's not my primary player so I haven't changed much from the defaults. And I use the portable version.

    If you're talking about AviSynth scripts outside of Potplayer you need to use a source filter that supports h.265/AVC. I usually use LSMASH. Sometimes ffms2.
    Quote Quote  
  25. After spending over 30 minutes I figured out what my problem was. I remember briefly seeing something about the fact that Nvidia graphics cards are not able to decode H265 videos natively. That codec was made to be decoded by Intel CPUs and their integrated graphics.

    So if you want to be able to use this wonderful script with H265 videos then you will need to go Start>Settings>Graphics Settings>Browse> pot player location> options> power saving (Intel)
    If you have an Nvidia graphics card, you will need to do this.

    After doing that the script works!


    I was testing other videos and I noticed that a common practice with 4 x 3 videos that are encoded these days seem to commonly have a widescreen (720p) resolution but have a 4 x 3 aspect ratio. I don't know if your script would be able to have the option to decipher the difference between a true widescreen video with a 16 x 9 ratio versus a 4 x 3 video with a widescreen resolution. I would be very curious to find out if it was able to. I will upload and another example video.
    Last edited by thebib62; 11th May 2021 at 22:10.
    Quote Quote  
  26. You must have an old Nvidia graphics card. Most of their cards since the 1xxx series have h.265/hevc hardware decoding.

    https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
    Quote Quote  
  27. My computer isn't that old. I bought it last year. I think it's simply a problem with how Windows 10 handles graphics. The same solution is also applied to OBS. When someone wants to broadcast their desktop using that software, All you'll see is a black screen until you apply the same fix that I described above.

    I forgot to mention that when I tried playing the last sample video clip with your script, it doesn't recognize the aspect ratio, because I believe the 720p resolution is what's throwing it off and not working as intended. Are you able to get your script working with the sample video on your end?
    Quote Quote  
  28. Originally Posted by jagabo View Post
    It's working here.

    Image
    [Attachment 58831 - Click to enlarge]


    In case my version has changed, cut and past from PotPlayer:

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.08
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height)
    bg = Spline36Resize(width/16*2,height/16*2).FastBlur(4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).AddGrainC(3)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.76 ? last : uncropped
    You might want to lower the 1.77 threshold value in case a few widescreen videos have a little cropping at the left and right edges (making the AR a little less than 1.77). Maybe 1.70. Or as low as 1.4.


    I'm assuming it's not possible to have your script recognize 4x3 videos in 16x9 resolutions(like the sample provided), and have it applied to them. Perhaps you already addressed not being able to in your earlier posts. I did see your post and the screenshot that showed the message in potplayer
    "Here you can use avisynth filters that are installed on your system. With this, only YV12 colorspace output will be allowed and video resize processing cannot be used."

    If that is the case, can you remove the framesize restriction and have your script apply even to widescreen videos? I will just have to switch between Scripts when I come across a video like I mentioned above.

    I am not familiar with scripting in general, and I try my best to understand, and update your script without having to bother you...



    This is my current script, which uses yours and some ideas from hello_hello

    Code:
    uncropped = potplayer_source()
    src = uncropped.Crop(8,0,-8,-0)
    
    ZOOM = 1.08
    
    Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2)
    Crop(0, (height-src.height)/4*2, -0, src.height)
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height)
    bg = Spline36Resize(width/16*2,height/16*2).FastBlur(3).FastBlur(2).FastBlur(2).Spline36Resize(uncropped.height*16/18*2,uncropped.height).AddGrainC(3)
    Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha)
    Spline36Resize(uncropped.width, uncropped.height)
    
    float(uncropped.width)/float(uncropped.height) < 1.76 ? last : uncropped

    With that being said, which value is responsible for being able to Increase the feather effect? I wish to have the feathered area increase.
    Image Attached Thumbnails Click image for larger version

Name:	PotPlayerMini_xDeDW0cMTH.jpg
Views:	13
Size:	245.7 KB
ID:	59052  

    Last edited by thebib62; 21st May 2021 at 20:27.
    Quote Quote  
  29. Originally Posted by thebib62 View Post
    I'm assuming it's not possible to have your script recognize 4x3 videos in 16x9 resolutions(like the sample provided), and have it applied to them.
    Not reliably. Automatically detecting the black pillarbox bars can be done by calculating the average luma of the pillarbox area. But differentiating black pillarbox bars from just a shot with dark edges is a problem. Also, the calculations require AviSynth's runtime filters -- which may not work in PotPlayer.

    I originally wrote the script assuming a pillarboxed 4:3 video in a 16:9 frame (without auto-detection). But realized later that the OP wanted it to work with 4:3 sources and changed the script. Given I hate the entire concept I'm not inclined to recreate it.

    Originally Posted by thebib62 View Post
    If that is the case, can you remove the framesize restriction and have your script apply even to widescreen videos?
    No, the frame size cannot be changed. Actually, the script can resize the frame but PotPlayer will not display it properly. If the frame is enlarged PotPlayer will only show the top left corner of that larger size. If the frame is shrunken Potplayer will show the smaller frame in the top left corner.

    Originally Posted by thebib62 View Post
    which value is responsible for being able to Increase the feather effect? I wish to have the feathered area increase.
    In the "alpha =" line change "PointResize(width/16*2, width)". Instead of 16 use a bigger number, to get a wider feather, and use BilinearResize instead of PointResize.

    Code:
    alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).BilinearResize(width/24*2, width).BilinearResize(width,height)
    Quote Quote  



Similar Threads