VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Page 4 of 4
FirstFirst ... 2 3 4
Results 91 to 110 of 110
Thread
  1. I thought I'd try adding a "luma ramp" to the borders. After a bit of messing around I finally worked out how to make it work in practice much the way it was working in my head. I used jagabo's method for creating a "ramp", only I used the very edge pixels from the video to create the ramp rather than a greyscale ramp as such. That seemed to work better, although I'm still not sure I like the ramp idea after all that.

    I also added a InPixelAR option to the script, so it'll resize anamorphic sources to square pixels now, and add frosty borders as required.
    I think I discovered a silly in the previous method of copping/resizing while I was at it, so that's now fixed.

    See post #72 for details. The new version is FrostyBorders 2017-10-28.avsi

    Here's screenshots. With and without the gradient option enabled.
    Image Attached Thumbnails Click image for larger version

Name:	top-bottom.jpg
Views:	9
Size:	155.1 KB
ID:	43510  

    Click image for larger version

Name:	top-bottom gradient.jpg
Views:	9
Size:	157.1 KB
ID:	43511  

    Click image for larger version

Name:	left-right.jpg
Views:	9
Size:	160.5 KB
ID:	43512  

    Click image for larger version

Name:	left-right gradient.jpg
Views:	11
Size:	162.1 KB
ID:	43513  

    Last edited by hello_hello; 27th Oct 2017 at 21:59.
    Quote Quote  
  2. I had a thought..... maybe instead of a InDAR option, I should have added as source pixel aspect ratio option instead.
    The logic being, if you crop a DVD, the display aspect ratio obviously changes, whereas the pixel aspect ratio remains unchanged (referring to the Input pixel aspect ratio).

    What do you think? I'd use the Yoda Resize Calculator to work out the new InDAR after cropping so it's not a big deal for me, as long as I remember to do it.

    Edit: The "2017-10-27" version of the script might result in an error. I must have had two instances of it open at some stage and made changes using the second instance and saved them, only to over-write them when I saved the first instance of the script again.

    I'll replace the InDAR option with an InPixelAR option while I'm at it, so the fixed version won't be uploaded until that's done.
    It might even have to be tomorrow as I've not got much time today. It depends how long it takes me to get it right.
    Last edited by hello_hello; 28th Oct 2017 at 01:20.
    Quote Quote  
  3. When you use
    Eval("""
    """)
    In a function, why does Avisynth tell you any syntax errors/illegal operations are after
    Eval("""
    """)
    rather than somewhere inside it, where they really are. It makes it harder to track down problems when Avisynth says every error is on the same line.
    Quote Quote  
  4. I've made the switch to InPixelAR instead of InDAR. I'll confess I've only testing it briefly but it worked correctly when I did. I'll test again tomorrow, just in case....

    I've also toned down the border gradient just a little bit (when gradient=true).

    New version: FrostyBorders 2017-10-28.avsi
    Last edited by hello_hello; 27th Oct 2017 at 22:09.
    Quote Quote  
  5. mmmm exactly in this moment both the script seems to work well, however I keep as good the latest. I'm using Avisynth+ R1576

    Code:
    Import("v:\automazioneclip\avisynth\plugins\IResize.avsi")
    Import("v:\automazioneclip\AviSynth\plugins\FrostyBorders.avsi")
    Import("V:\automazioneclip\AviSynth\plugins\CropResizeBorder_ColouredBorders3.avsi")
    LoadPlugin("v:\automazioneclip\AviSynth\Lsmash64perVirtualDub64\LSMASHSource.dll")
    LoadPlugin("V:\automazioneclip\AviSynth\plugins64\ffms2.dll")
    LoadCPlugin("v:\automazioneclip\avisynth\plugins64\yadif.dll")  
    FFVideoSource("C:\Users\Administrator\Desktop\Nuova cartella\Test1.mp4", timecodes="timecodes.txt") 
    vfrtocfr(fpsnum=50000, fpsden=1000, timecodes="timecodes.txt") 
    assumeFPS(50, sync_audio=false)  
    #TurnRight()
    #Turn180()
    #TurnLeft()      
    #robocrop()
    ConvertToYUY2(interlaced=false)
    SmoothFPS2(50000,1000)
    x = float(width) / float(height)         
    LancZosResize(m4(x * 1080.0),1080)        
    #FuzzyBorders(16,9)
    FrostyBorders(1920,1080)
    #BlackBorders(1920,1080)
    function m4(float x) {return( x<16?16:int(round(x/4.0)*4))}
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    AssumeFPS(25)
    Last edited by marcorocchini; 28th Oct 2017 at 06:13.
    Quote Quote  
  6. please cat I need to reduce a little the granularity of the colored/blurred borders, how to do it? thanks
    Quote Quote  
  7. As a rule, reading the instructions at the top of the script helps. The options are listed there. For my script, I think the option you want is Texture, but my script probably won't look as good as raffriff42's without it, because it doesn't use as many pixels from the edge of the video to create the borders.
    Quote Quote  
  8. Originally Posted by marcorocchini View Post
    please cat I need to reduce a little the granularity of the colored/blurred borders, how to do it? thanks

    FrostyBorders
    (..., Texture=1)
    or
    SuperSexyWidescreen(..., noise=2)

    >reading the instructions at the top of the script helps
    I found it very helpful, thanks, but then I always was a RTFM kind of guy.
    Quote Quote  
  9. oh yea yea thanks I'm reading the avsi instruction

    Image
    [Attachment 43528 - Click to enlarge]
    Quote Quote  
  10. Originally Posted by hello_hello View Post
    When you use
    Eval("""
    """)
    In a function, why does Avisynth tell you any syntax errors/illegal operations are after
    Eval("""
    """)
    rather than somewhere inside it, where they really are. It makes it harder to track down problems when Avisynth says every error is on the same line.
    Yes, that's the way the Wiki says to do multi-line statement blocks, but for large blocks, there are better ways to get what you need - break them into functions, for example (see attached - I tried to change as few lines as possible in your script). Using AVS+ it is way easier; you can use GScript if {...} else {...} statements.
    Image Attached Files
    Quote Quote  
  11. That makes sense. Using Eval hasn't been a problem for me except on an occasion where there's a syntax error and I don't know where to start looking. I think I spent over half an hour tracking down something stupid like a missing line break or a closing bracket that wasn't particularly obvious yesterday, which is when I developed my workaround.......

    Return c

    I added it near the top of a multiline statement block and if the source opened, I moved it down a few lines and tried again, then again.... and when the syntax error appeared I'd know where to to look.

    A question if I may...... you used global variables in the modified version of the script. Are they not quite the work of Satan as I'd been led to believe? I assume you could copy the defaults into the individual functions instead of making them global, but is there any need?

    The new version of the cropping script I should get around to finishing, originally had lines like this:

    Uncropped = c
    Autocropped1 = c.Autocrop(some options)
    Autocropped2 = c.Autocrop(some other options)
    Cropping = (sunny day) ? Uncropped : (cloudy day) ? Autocropped1 : Autocropped2

    And logically to me that'd mean autocrop wouldn't get involved on sunny days, but I assume it was anyway, as the script was slow to open, so I started wrapping the slow stuff in Eval, which seemed to do the trick. Thinking about it, I guess turning Autocropped1 and Autocropped2 into functions would do the same job?
    I'm still relatively new to creating functions so it's still a learning process, and for some reason I haven't quite got my head around GScript yet. I'll have another look later.

    Cheers.
    Quote Quote  
  12. Originally Posted by hello_hello View Post
    A question if I may...... you used global variables in the modified version of the script. Are they not quite the work of Satan as I'd been led to believe?
    Yes they are! If I was really doing this, I would split up the arguments properly.

    Originally Posted by hello_hello View Post
    And logically to me that'd mean autocrop wouldn't get involved on sunny days, but I assume it was anyway,
    Yes, I am surprised by this sometimes too. In the script I attached, I had to test each condition twice, with a Nop on the "fail" branch, to avoid executing both alternatives. Still not sure why it should be needed.
    Code:
    CWIDE = (Float_Total_Aspect > Float_Video_Aspect) ? C.FrostyBorders_wide : Nop
    CTALL = (Float_Total_Aspect < Float_Video_Aspect) ? C.FrostyBorders_tall : Nop
    
    return (Float_Total_Aspect > Float_Video_Aspect) ? CWIDE
    \    : (Float_Total_Aspect < Float_Video_Aspect) ? CTALL
    \    : (Total_Width==Video_Width) && (Total_Height==Video_Height) 
    \        ? c
    \    : c.Spline36Resize(Total_Width, Total_Height)
    EDIT fixed a small bug too... moved c.Spline36Resize to the other branch
    Last edited by raffriff42; 29th Oct 2017 at 11:11.
    Quote Quote  
  13. One other question if you don't mind......

    I was reading the info on the Apply function earlier, and then I tried standing on my head and reading it again, but no matter which way I tried, I can't see how it'd make life easier. It says here that "it simplifies calling functions by their name", but either there's a definition of "simplifies" with which I'm not familiar that actually means "makes harder", or I'm seriously missing the point. Does Apply get used much?

    Thanks.
    Quote Quote  
  14. Never used or even recall reading about Apply before.

    Seems you might use it to allow the user to name the function that will be called (EDIT like the wiki page shows)
    It's a little easier to code than Eval, maybe.
    Code:
    #RandomResize_Eval("PointResize", 1024, 768)
    RandomResize_Apply("GaussResize", 1024, 768)
    return Last
    
    function RandomResize_Eval(clip C, string resizer, int width, int height)
    {
        C
        Eval(resizer + "("+String(width)+","+String(height)+")")
        return Last
    }
    
    function RandomResize_Apply(clip C, string resizer, int width, int height)
    {
        Apply(resizer, C, width, height)
        return Last
    }
    Last edited by raffriff42; 29th Oct 2017 at 11:37.
    Quote Quote  
  15. Originally Posted by raffriff42 View Post
    Yes, I am surprised by this sometimes too. In the script I attached, I had to test each condition twice, with a Nop on the "fail" branch, to avoid executing both alternatives. Still not sure why it should be needed.
    Code:
    CWIDE = (Float_Total_Aspect > Float_Video_Aspect) ? C.FrostyBorders_wide : Nop
    CTALL = (Float_Total_Aspect < Float_Video_Aspect) ? C.FrostyBorders_tall : Nop
    
    return (Float_Total_Aspect > Float_Video_Aspect) ? CWIDE
    \    : (Float_Total_Aspect < Float_Video_Aspect) ? CTALL
    \    : (Total_Width==Video_Width) && (Total_Height==Video_Height) 
    \        ? cCWIDE = (Float_Total_Aspect > Float_Video_Aspect) ? C.FrostyBorders_wide : Nop
    \    : c.Spline36Resize(Total_Width, Total_Height)
    EDIT fixed a small bug too... moved c.Spline36Resize to the other branch
    I did wonder if something like:

    return (Float_Total_Aspect > Float_Video_Aspect) ? C.FrostyBorders_wide : C.FrostyBorders_tall

    would produce the same error I'd been using Eval to avoid. I was going to test it a little later, but now there's no need and I know to use something like this instead.

    return (Float_Total_Aspect > Float_Video_Aspect) ? Eval(""" C.FrostyBorders_wide """) : Eval(""" C.FrostyBorders_tall """)

    (I'm very tired and I think it's making me silly)
    Quote Quote  
  16. Originally Posted by raffriff42 View Post
    Never used or even recall reading about Apply before.

    Seems you might use it in the following way - to allow the user to name the function that will be called.
    It's a little easier to code than Eval, maybe.
    Code:
    #RandomResize_Eval("PointResize", 1024, 768)
    RandomResize_Apply("GaussResize", 1024, 768)
    return Last
    
    function RandomResize_Eval(clip C, string resizer, int width, int height)
    {
        C
        Eval(resizer + "("+String(width)+","+String(height)+")")
        return Last
    }
    
    function RandomResize_Apply(clip C, string resizer, int width, int height)
    {
        Apply(resizer, C, width, height)
        return Last
    }
    I'm definitely too tired. I didn't take any of that in so I'll try again tomorrow.

    Thanks.
    Quote Quote  
  17. I get it in theory now but I'll probably have to play with it to lock it in, because at the moment I'm still not seeing the "simplify"aspect of using it.
    Mind you I think I may have a problem, as I appear to have developed a bit of an Eval addiction. I want to Eval everything.

    Cheers.
    Quote Quote  
  18. I finally got around to having a less rushed look at the script today and found a couple of bugs. The only one that matters in respect to adding borders was a potential aspect error when resizing the width (I forgot a bracket). If there was an error, it should have only been wrong by a few pixels.

    The script also wasn't resizing as it should when not adding borders. That's now fixed.

    FrostyBorders 202017-11-22.avsi
    Image Attached Thumbnails Click image for larger version

Name:	Frosty Borders A.jpg
Views:	5
Size:	116.3 KB
ID:	43737  

    Click image for larger version

Name:	Frosty Borders B.jpg
Views:	5
Size:	101.1 KB
ID:	43738  

    Last edited by hello_hello; 22nd Nov 2017 at 09:05.
    Quote Quote  
  19. I fixed a stupid error in my version of the script when specifying a pixel aspect ratio (it worked fine if you didn't), and it now adds plain black borders until they're 16 pixels wide rather than producing an error saying the borders are too narrow. The new version is attached to the post above this one.
    Quote Quote  



Similar Threads