VideoHelp Forum

+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 89
Thread
  1. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Originally Posted by smrpix View Post
    Originally Posted by butterw View Post
    Couldn't bring myself to watch through those uninspired 16/9 music videos, but it's pretty clear they have nothing to do with the topic of this thread.
    If you don't understand the point in the context of this thread you started, you're beyond hope.
    I've wondered and commented on some of his myopic posts before and he's confirmed he/she has no understanding or appreciation of video or art.
    Quote Quote  
  2. Couldn't care less about your feelings about art. You guys post the same nonsense in every single thread.

    Please don't feel compelled to reply unless it is related to the topic of video player software.
    Quote Quote  
  3. No. there is nothing that automatically does what you want.
    Quote Quote  
  4. 1. The feature isn't required to be automatic.
    2. Be specific about which fullscreen non-black border fill modes you are referring to. I am assuming you mean blurred fill.
    3. Which video players/renderers have you tested ?
    Quote Quote  
  5. Mpv also has an option to set the screen background color, ex: gray160
    Code:
    mpv --background=0.627 "video.mp4"
    Color can be specified as R/G/B each in the range [0, 1] or with hexadecimal color #ff00aa

    A few colors seem to work quite well.

    On my setup with non-daylight non-video-optimized monitor/windows settings, I've found that black16 (limited black) gives better results than the default black0 (tested with old black&white films).
    Quote Quote  
  6. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Off topic again: you can do what you want, and you might prefer it otherwise, but because:

    1. Detail & contrast are best preserved when there is something to contrast them against. IOW, you get the most out of your image when the image is set up properly on the display AND the background & environment are as close to totally BLACK as possible.

    2. It has been psychologically proven that, when letterboxing/pillarboxing is the same as the background environment, it is the least distracting. In absence of being exactly the same, BLACK (absence of light) is the next least distracting. Of course, if you follow #1, BLACK = background environment, so the best of both alternatives.

    There's opinion, and you can have a different opinion of whatever you like.
    And there's fact. The above are facts. Empirically/experimentally & formulaically provable and repeatable scientific facts.

    But have fun finding a player to do what you want. Personally, I think you'll have the easiest time (w/o re-encoding) by going the AVISynth script route.


    Scott
    Quote Quote  
  7. Some players, like PotPlayer, let you apply an AviSynth script to any video that's playing. A 4:3 video pillarboxed on a stretched, blurred, darkened, 16:9 background:

    Image
    [Attachment 56032 - Click to enlarge]
    Quote Quote  
  8. Print "Good luck with that!"
    End
    "Well, my days of not taking you seriously are certainly coming to a middle."
    Quote Quote  
  9. @Cornucopia: What you state are valid theoretical considerations. But the issue in practice is that PC monitors can be quite poor at displaying black0.
    Outside of movie watching, least distracting is not necessarily desired also.

    @jagabo: are you using the FrostyBorders script ?
    Quote Quote  
  10. Originally Posted by butterw View Post
    @jagabo: are you using the FrostyBorders script ?
    No, I used my own. It was a little tricky because PotPlayer doesn't allow (as far as I could tell) the script to enlarge the frame. So I had to keep the original 720x480 frame (4:3 DAR) of the AVI source. To get it to display as 16:9 I had to force the DAR in the player.

    Code:
    potplayer_source()
    Crop(8,0,-8,-0)
    Overlay(Spline36Resize(16,12).Spline36Resize(width,height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(width-(width*3/4))/2, y=0)
    The crop was to remove small black borders in the original 720x480 video. For the blurry background I downscaled the source and upscaled back to the original size, then darkened it a little. I had to downscale the original video to make it display as 4:3 when the 720x480 frame was stretched to 16:9 by PotPlayer, then it was overlaid (centered) over the blurry background.

    <edit>

    I just noticed the black border at the right edge of the frame and saw the bug in the script:

    Code:
    src = potplayer_source()
    Crop(src, 8,0,-8,-0)
    Overlay(Spline36Resize(16,12).Spline36Resize(src.width,src.height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(src.width-(width*3/4))/2, y=0)
    Last edited by jagabo; 1st Dec 2020 at 21:00.
    Quote Quote  
  11. According to the changelog, this avisynth directshow filter: https://github.com/CrendKing/avisynth_filter now has the ability to resize the frame.

    EDIT: From what I understand, your script doesn't use a gaussian blur, but instead relies on downscaling to a low resolution of (16x12, ratio of 40). There are some artifacts but it's very fast. The result has much more artifacts if a higher downscaled resolution is used, w=16, h=12 have some restrictions(must be mod-2, lower values causes crashes).
    I was thinking of using a soft cubic method (bspline) to resize the background, which may be preferable ?
    src.BicubicResize(w, h, b=1, c=0).BicubicResize(src.width, src.height, b=1, c=0)
    Last edited by butterw; 2nd Dec 2020 at 05:48.
    Quote Quote  
  12. Note that this script is running within PotPlayer. It's not an external script. That allows the script to be applied to whatever video PotPlayer is playing. Hence, the problem isn't that AviSynth can't change the frame size, it's that PotPlayer still uses the frame size of the video it's playing. If you enlarge the frame from 720x480 to 856x480 in AviSynth Potplayer will only use the left 720x480 and you will lose the right edge of the picture.

    You can use whatever downscale size you want. You can combine downscaling with blurring to get faster processing than blurring the full frame. For example: Spline36Resize(32,24).Blur(1.4).Blur(1.4).Blur(1.4 ).Spline36Resize(src.width,src.height) delivers less artifacts but is still fast.

    Instead of using a fixed downscaled frame size you can use a size relative to the source: Spline36Resize(width/16*2,height/16*2). Note that "/16*2" assures that you will get a mod2 frame size that's about1/8 the original. If you really want to use odd frame sizes you can convert to YV24 or RGB first, then back to YV12 later.

    Code:
    src = potplayer_source()
    Crop(src, 8,0,-8,-0)
    Overlay(Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(src.width,src.height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(src.width-(width*3/4))/2, y=0)
    Image
    [Attachment 56043 - Click to enlarge]


    Even with a 1440x1080 source I'm only getting 2 percent CPU usage.

    In any case, this was a proof-of-concept example. You can do whatever processing you want. I would never do this.
    Quote Quote  
  13. avisynth_filter works the same but can change the source frame size, at least in mpc-hc/be.
    This has the added benefit that you can also bypass the software player resizer.
    Quote Quote  
  14. To avoid blocking/posterization artifacts (with the live-updated blurred background):
    - use a higher downscaled resolution
    w, h: src resolution/4*2
    or w, h = 256
    - use bspline resizer (smooth cubic)
    - use external plugins Fastblur and Addgrain (used by FrostyBorders)
    Fastblur is a stronger adjustable gaussian blur + it also has a dithering option.
    Addgrain noise helps mask artifacts.

    bg = src.BicubicResize(w, h, b=1, c=0).ColorYUV(gain_y=-30).FastBlur(8, iterations=3, dither=yes).BicubicResize(1920, 1080, b=1, c=0).AddGrain(var=2.0)

    From my testing Portrait mode video would benefit most from this type of blurred background.

    If a moving background is undesirable, a high quality static blurred image could be used instead:
    bg = ImageSource("blurred_image", 0, src.FrameCount-1)
    Quote Quote  
  15. With mpv portable_config/scripts/autocrop.lua: All black borders are automatically cropped.

    It's based on ffmpeg cropdetect which feeds the parameters to crop vf.
    Quote Quote  
  16. Originally Posted by jagabo View Post
    Note that this script is running within PotPlayer. It's not an external script. That allows the script to be applied to whatever video PotPlayer is playing. Hence, the problem isn't that AviSynth can't change the frame size, it's that PotPlayer still uses the frame size of the video it's playing. If you enlarge the frame from 720x480 to 856x480 in AviSynth Potplayer will only use the left 720x480 and you will lose the right edge of the picture.

    You can use whatever downscale size you want. You can combine downscaling with blurring to get faster processing than blurring the full frame. For example: Spline36Resize(32,24).Blur(1.4).Blur(1.4).Blur(1.4 ).Spline36Resize(src.width,src.height) delivers less artifacts but is still fast.

    Instead of using a fixed downscaled frame size you can use a size relative to the source: Spline36Resize(width/16*2,height/16*2). Note that "/16*2" assures that you will get a mod2 frame size that's about1/8 the original. If you really want to use odd frame sizes you can convert to YV24 or RGB first, then back to YV12 later.

    Code:
    src = potplayer_source()
    Crop(src, 8,0,-8,-0)
    Overlay(Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(src.width,src.height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(src.width-(width*3/4))/2, y=0)
    Image
    [Attachment 56043 - Click to enlarge]


    Even with a 1440x1080 source I'm only getting 2 percent CPU usage.

    In any case, this was a proof-of-concept example. You can do whatever processing you want. I would never do this.


    After spending nearly an hour trying and failing to get the AVIsynth scripts to work properly in pot player, I came across your post. Yours was the simplest and most effective way to fill those black borders with a blurred background video. Thank you very much for taking the time to create that script. This is something that I didn't even know was possible to do in real time. It's an excellent way to consume 4 x 3 on widescreen displays!

    I would like to know if someone is able to add onto this script and have it automatically disable the effect on videos that are natively 16 x 9? The way this script is now, it will automatically squish the 16 x 9 video two 4 x 3 and blur the borders to a 16 x 9 ratio. It would be perfect if the script would realize when it was handling 4 x 3 videos versus 16 x 9 videos. I'm not nearly smart enough to be able to change the script to my liking. Hopefully you, or someone else who's more knowledgeable in scripting would be able to help me out. Much appreciated and thanks again!
    Quote Quote  
  17. Originally Posted by thebib62 View Post
    I would like to know if someone is able to add onto this script and have it automatically disable the effect on videos that are natively 16 x 9?
    This is complicated by the fact that AviSynth only knows the frame size here, not the display aspect ratio. For example, NTSC DVD uses a 720x480 frame size for both 4:3 and 16:9 video. So you can't use the frame size to reliably determine the display aspect ratio. But for square pixel videos you can use something like:

    Code:
    src = potplayer_source()
    Crop(src, 8,0,-8,-0) # assuming ITU cap
    Overlay(Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(src.width,src.height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(src.width-(width*3/4))/2, y=0)
    float(src.width)/float(src.height) < 1.77 ? last : src
    The first part is the same as before. The last line detects whether the original frame size is less than 16:9. If it is it applies the edge blur effect. If not, it returns the original video frame. You may want to change the threshold from 1.77 to something smaller in case some videos are slightly under 16:9 from mild cropping.
    Quote Quote  
  18. Originally Posted by jagabo View Post
    Originally Posted by thebib62 View Post
    I would like to know if someone is able to add onto this script and have it automatically disable the effect on videos that are natively 16 x 9?
    This is complicated by the fact that AviSynth only knows the frame size here, not the display aspect ratio. For example, NTSC DVD uses a 720x480 frame size for both 4:3 and 16:9 video. So you can't use the frame size to reliably determine the display aspect ratio. But for square pixel videos you can use something like:

    Code:
    src = potplayer_source()
    Crop(src, 8,0,-8,-0) # assuming ITU cap
    Overlay(Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(src.width,src.height).ColorYUV(gain_y=-50), Spline36Resize(width*3/4, height), x=(src.width-(width*3/4))/2, y=0)
    float(src.width)/float(src.height) < 1.77 ? last : src
    The first part is the same as before. The last line detects whether the original frame size is less than 16:9. If it is it applies the edge blur effect. If not, it returns the original video frame. You may want to change the threshold from 1.77 to something smaller in case some videos are slightly under 16:9 from mild cropping.

    Thank you very much! That seems to be exactly what I asked for! Works Perfectly! I appreciate your very quick reply. I just love this script, and I can't wait to watch all my old 4x3 videos with it.
    Quote Quote  
  19. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    Of course in a theatre there are black bars on the screen albeit black velvet's that slide into position to suit the aspect ratio of the film. It's just that in a theatre with an audience and the lighting most people don't see or aware of them until the operator opens them for the next film that is in Cinemascope. Like Lingyi, Cornucopia, Jagabo you can add me to the list who prefers to see films as they were shot. My SONY 75" Android really does have blacker than black and I simply don't notice when I'm looking at an old film like the original King Kong with Faye Raye etc. However everyone to their taste?
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 7 Ultimate, QNAP NAS TS851
    Quote Quote  
  20. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Just let people watch movies the way they want,i bet most dont care at all about black borders and don't try to to say what can be told in a thread,if it's nonsense no one will listen,if its rude it will be deleted.
    I think,therefore i am a hamster.
    Quote Quote  
  21. Plasma owners (I'm one of them) can prevent burn-in by filling in the black borders with some sort of image.

    Edit: I just realised butterw had linked to the FrostyBorders script in post #6, so sorry for going over old ground again, but seeing as I'd already submitted this post I'll leave it anyway.

    For anyone interested, the FrostyBorders function in my signature fills in borders, and there's options for border brightness and contrast etc. It won't be as fast as the script jagabo posted, but for standard definition, if you just add borders for 16:9 and upscale with the player, it should be fast enough. It'll probably be fine with HD too if you have a fast CPU. The CropResize script in my signature also has the same functionality. The FrostyBorders function can resize and allows you to specify a display/sample aspect ratio for an anamorphic source, but it's designed for a source with already clean, cropped edges, whereas the CropResize function can crop them for you.

    I borrowed jagabo's earlier screenshot to use as an example.

    ImageSource("D:\script.jpg")
    ConvertToYV12()
    FrostyBorders(832,468)



    I know it's not everyone's cup of tea, but personally I watch a lot of 4:3 stuff by zooming in and moving the picture down a little, as the important stuff is usually in the middle to top half of the 4:3 frame. For MPC-HC it's roughly 9 taps of the "2" key on the numeric keypad while holding down the Ctrl key (moves the picture down) then using the "9" key to zoom in. The "5" key resets everything.



    Even somewhere in-between if borders on a 4:3 image are a bit too distracting.

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



    Neither function will let you distort the picture, as long as you specify the correct DAR or SAR for an anamorphic source. If the source is 16:9 and you specify 16:9 output dimensions, borders won't be added even if they're enabled.
    Last edited by hello_hello; 21st Apr 2021 at 09:07.
    Quote Quote  
  22. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    You could put black curtains on the sides of a tv screen and pretend it's a cinema release.
    I think,therefore i am a hamster.
    Quote Quote  
  23. Originally Posted by hello_hello View Post
    Plasma owners (I'm one of them) can prevent burn-in by filling in the black borders with some sort of image.

    Edit: I just realised butterw had linked to the FrostyBorders script in post #6, so sorry for going over old ground again, but seeing as I'd already submitted this post I'll leave it anyway.

    For anyone interested, the FrostyBorders function in my signature fills in borders, and there's options for border brightness and contrast etc. It won't be as fast as the script jagabo posted, but for standard definition, if you just add borders for 16:9 and upscale with the player, it should be fast enough. It'll probably be fine with HD too if you have a fast CPU. The CropResize script in my signature also has the same functionality. The FrostyBorders function can resize and allows you to specify a display/sample aspect ratio for an anamorphic source, but it's designed for a source with already clean, cropped edges, whereas the CropResize function can crop them for you.

    I borrowed jagabo's earlier screenshot to use as an example.

    ImageSource("D:\script.jpg")
    ConvertToYV12()
    FrostyBorders(832,468)



    I know it's not everyone's cup of tea, but personally I watch a lot of 4:3 stuff by zooming in and moving the picture down a little, as the important stuff is usually in the middle to top half of the 4:3 frame. For MPC-HC it's roughly 9 taps of the "2" key on the numeric keypad while holding down the Ctrl key (moves the picture down) then using the "9" key to zoom in. The "5" key resets everything.



    Even somewhere in-between if borders on a 4:3 image are a bit too distracting.

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



    Neither function will let you distort the picture, as long as you specify the correct DAR or SAR for an anamorphic source. If the source is 16:9 and you specify 16:9 output dimensions, borders won't be added even if they're enabled.
    how do i get this to work within potplayer? were you able to get it to work with that player ?
    i was not able to get it to work.
    Quote Quote  
  24. I've not used it with PotPlayer, but it works fine with ffdshow and MPC-HC, which is no doubt where PotPlayer originally got it's ability to run scripts from.

    Don't worry about the aspect ratio of the screenshot below. I just used a pic on my hard drive, which is why I added ConvertToYV12() to ffdshow, but normally it shouldn't be needed. FrostyBorders should be in the Avisynth auto-loading plugins folder or you'll have to import it.

    If there's an "Add Potplayer Video Source" checkbox somewhere in Potplayer's Avisynth section, you probably need to enable that, but it should work in a similar manner.



    Last edited by hello_hello; 21st Apr 2021 at 22:57.
    Quote Quote  
  25. I will look for that. In the meantime, the files included in the FrostyBorders 2021-04-07.zip file contains a .avsi file. PotPlayer seems to only see .avs files.

    Where do I place the FrostyBorders 2021-04-07.avsi file?
    Image Attached Thumbnails Click image for larger version

Name:	TjziqM2Stv.png
Views:	4
Size:	51.8 KB
ID:	58535  

    Quote Quote  
  26. I assume you have Avisynth installed?

    Anything (plugins or functions) in the Avisynth auto-loading plugins folder will be loaded by Avisynth when it runs, so the easiest solution is to put FrostyBorders.avsi in the Avisynth plugins folder. Depending on your flavour of Windows and if Avisynth is 32 or 64 bit, there might be more than one plugins folder.
    It's easy for XP "C:\Program Files\AviSynth\plugins", but for you it's likely to be "C:\Program Files (x86)\AviSynth\plugins" or something similar. FastBlur.dll and AddGrainC.dll should be in the plugins folder too.

    Test it without Potplayer's Avisynth option first. Create an avs script with the following:

    Code:
    ColorBars()
    KillAudio()
    TurnLeft()
    ConvertToYv12()
    FrostyBorders(960,540)
    Open it with something that'll open scripts. If you see the output below and there's no errors, then it's working and you can go back to getting PotPlayer to play nice.

    Image
    [Attachment 58536 - Click to enlarge]
    Last edited by hello_hello; 22nd Apr 2021 at 01:25.
    Quote Quote  
  27. I got it working...somewhat. Potplayer will not show anything without the avisynth option checked.
    When I got it working, it crops too much from the right Side, and the video seems to be not centered.
    anyway to automate this? I want the video to be centered and cropped properly automatically.
    Image Attached Thumbnails Click image for larger version

Name:	PotPlayerMini_vQ9Mjb4dU0.png
Views:	4
Size:	587.9 KB
ID:	58537  

    Quote Quote  
  28. The script can't add borders to just one side. Unless there's a bug I've never seen before, but I doubt it.

    The way the script works is you specify the output dimensions, and for Pillarbox borders the video height is resized to the specified output height, the width is resized to match, and then borders are added to each side for the specified output width.

    All I can suggest is you try the simple script I posted earlier, and open it with VirtualDub2 or MPC-HC etc. If the video looks like the screenshot I posted then the script is working as it should, and PotPlayer must be doing something else.

    You can also try CropResize. It can add frosty borders too.

    Code:
    ColorBars()
    KillAudio()
    TurnLeft()
    ConvertToYv12()
    CropResize(960,540, Borders=true, Frosty=true)
    Once again, open the script above to make sure it's okay, then see what happens when you use CropResize with PotPlayer.
    Quote Quote  
  29. 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.
    Quote Quote  
  30. It's not the FrostyBorders function. I have no idea why it's happening, but even adding normal borders doesn't work as expected.

    Image
    [Attachment 58539 - Click to enlarge]


    Image
    [Attachment 58540 - Click to enlarge]
    Quote Quote  



Similar Threads