VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Page 3 of 4
FirstFirst 1 2 3 4 LastLast
Results 61 to 90 of 109
Thread
  1. Both of that screens are simulated so you can see what I see, this is why you didn't see that over my previous samples because I do not convert the levels, I use as is. Over here (desktop) there is no settings to control limited or full range available anywhere:




    On my display however there is a setting for color dynamic range that is set to 'full', on my Blu-Ray player there is a setting for limited or Full range settings that I use as Full, seting up this way it display very beautiful colors and a decente black levels.









    The only way I can see those screenshots the way I assume you must be seeing them, is to change my monitor's setting to expect a limited range input. That way the "limited" screenshot looks way too dark and the "full" screenshot looks about right (because the levels should have been expanded for the screenshots as jpgs are full range), but that's not how they should display. I'm confused.....
    This is exactly what I do, but instead of messing up with the source levels I just use this limited input from source and encode it as full range, this is enough to make the footage look about right just as you saw it.

    Again, this is how things looks over here, maybe with a different setup, a different display, things might work the way you know it works.
    Quote Quote  
  2. Well, I can't see how taking a limited range video and encoding it while specifying full range for the VUI info can possibly make it display better, if everything else is setup correctly, because all it should achieve is to give the playback chain incorrect levels information.

    We're not going to get anywhere with this though because we're not seeing the same thing for video, and full range playback seems to be broken on my PC anyway (which I think is the reason I'm not seeing grey borders for your "full range" encodes) but what you're saying still doesn't make sense to me. If you take limited range video and encode it while specifying full range so the levels aren't expanded on playback, if anything it should look washed out rather than cinematic, yet your last screenshots, if anything, look overly-dark to me. All the darker detail is gone.

    Over here (desktop) there is no settings to control limited or full range available anywhere:
    I don't understand. It's there in your screenshot in the drop down list. "RGB 444 PC Standard (Full RGB)" and "RGB 444 PC Studio (Limited RGB)". Given there's no separate option for setting video levels I don't know if it applies to both Windows and to video or if the player is supposed to take care of the video levels, but there's definitely full and limited range choices for RGB. YCbCr is probably fixed at one or the other.

    On my display however there is a setting for color dynamic range that is set to 'full', on my Blu-Ray player there is a setting for limited or Full range settings that I use as Full, seting up this way it display very beautiful colors and a decente black levels.
    Color dynamic range would just be some color enhancing crap, but if you can set the Bluray player's output to full range, then logically the TV's input should be set to full range too. That way though, the limited range video levels would probably never be expanded to full range because the Bluray player thinks they're already full range and the display thinks the input levels are full range. Logically, if the display's input was set to limited range, there'd be an output/input levels mismatch which would probably cause the levels to be expanded to full range by the display, making up for the fact the limited range video is labelled as full range incorrectly, and as a result, the mismatch might cause the limited range video to display correctly. Just a theory....
    Last edited by hello_hello; 1st Oct 2019 at 15:52.
    Quote Quote  
  3. Originally Posted by hello_hello View Post
    Well, I can't see how taking a limited range video and encoding it while specifying full range for the VUI info can possibly make it display better, if everything else is setup correctly, because all it should achieve is to give the playback chain incorrect levels information.
    I never said it display "better", it display too dark images.

    Originally Posted by hello_hello View Post
    We're not going to get anywhere with this though because we're not seeing the same thing for video, and full range playback seems to be broken on my PC anyway (which I think is the reason I'm not seeing grey borders for your "full range" encodes) but what you're saying still doesn't make sense to me. If you take limited range video and encode it while specifying full range so the levels aren't expanded on playback, if anything it should look washed out rather than cinematic, yet your last screenshots, if anything, look overly-dark to me. All the darker detail is gone.
    This is the only way to show you what happens if I display a limited source with my full range settings, the blacks are to black and the whites are too white. Encoding a limited range as full range without messing with the source levels, make everything looks correct on my setup as you saw in my previous post with that two pictures.

    On your setup, with your display, it might look washed out and the black bars might look a bit grey, over here it looks correct, the colors, the levels, everything. Why it happen? I don't know.
    The only thing I know for sure is what I have to do to make it look correct, another thing that I set and many people set different it's the display color temperature, people like to set as "hot 1" or "hot 2" over here i use default (neutral).

    Originally Posted by hello_hello View Post
    I don't understand. It's there in your screenshot in the drop down list. "RGB 444 PC Standard (Full RGB)" and "RGB 444 PC Studio (Limited RGB)". Given there's no separate option for setting video levels I don't know if it applies to both Windows and to video or if the player is supposed to take care of the video levels, but there's definitely full and limited range choices for RGB. YCbCr is probably fixed at one or the other.
    Sorry I meant the video player, the AMD settings are set as "RGB 444 PC Standard (Full RGB)" the same as the HDMI port connected to my PC.
    Quote Quote  
  4. Well there's no point going around in circles, but my question remains.... if a video has limited range levels and it's labelled as limited range, shouldn't it display correctly, and if it takes labelling it as full range to make it display correctly even though it's limited range, what must be wrong?

    Or to put it another way, why does labelling limited range video as full range even make sense? Isn't it something like taking a rec.709 video and labelling it as rec.601 in order to get it to display as rec.709? It seems that way to me.
    Quote Quote  
  5. Originally Posted by hello_hello View Post
    Well there's no point going around in circles
    That it's the beauty of this forum, we can discuss and learn together.

    Originally Posted by hello_hello View Post
    but my question remains.... if a video has limited range levels and it's labelled as limited range, shouldn't it display correctly
    Possible yes on a limited 8-bit color display, I don't have any to test it out. Maybe if the display can't handle full range it fall to default.

    Originally Posted by hello_hello View Post
    and if it takes labelling it as full range to make it display correctly even though it's limited range, what must be wrong?
    You have answered that:
    "The only way I can see those screenshots the way I assume you must be seeing them, is to change my monitor's setting to expect a limited range input. That way the "limited" screenshot looks way too dark and the "full" screenshot looks about right"

    Limited source > limited input [x264] full output > image looks correct.
    Limited source > limited input [x264] limited output > image looks dark.

    Originally Posted by hello_hello View Post
    Or to put it another way, why does labelling limited range video as full range even make sense? Isn't it something like taking a rec.709 video and labelling it as rec.601 in order to get it to display as rec.709? It seems that way to me.
    Strange, if I mess up with that the final result get all screwed up.

    Tell me something, how does this sample look to you, does it look too dark or too light?
    Over here it's dark, not too dark but dark in many areas. This is encoded as 4:2:0 Limited.
    Image Attached Files
    Quote Quote  
  6. Originally Posted by amaipaipai View Post
    Originally Posted by hello_hello View Post
    Isn't it something like taking a rec.709 video and labelling it as rec.601 in order to get it to display as rec.709? It seems that way to me.
    Strange, if I mess up with that the final result get all screwed up.
    That was my point.

    Originally Posted by amaipaipai View Post
    Tell me something, how does this sample look to you, does it look too dark or too light?
    Over here it's dark, not too dark but dark in many areas. This is encoded as 4:2:0 Limited.
    Yeah it looks a bit dark, but I think the levels have been messed up in the first place. All I can do is show you how it displays when it's saved as a jpeg, which is independent of any monitor settings. There's places where the blacks looked crushed, but that's probably nothing to do with whether it's displaying "correctly" and everything to do with the video itself having messed up levels in the first place.

    How it displays normally:
    According to IranView most of the girl's hair is pure black, which is how it looks to me.



    Converted from PC to TV levels with a pixel shader:
    Lightening the picture by changing the levels doesn't fix the problem. The crushed black just becomes crushed grey. The detail in her hair is gone. Is that how you see it when you encode it as full range without converting the levels? I'd possibly try to make that one look better by adjusting the gamma or brightness etc, but still encode it as limited range.



    Converted from TV to PC levels with a pixel shader:
    Obviously just makes a bad picture worse.



    You can do the same thing to a video that has more correct levels. This is also limited range, although it's not labelled as such because not too many people bother, given unless otherwise specified, the assumption is limited range.

    How it displays normally:
    Edit: It's probably a camera setting (I don't know enough about it), but even in my sample the white wall on the left, around frame #490, looks like the white has been severely clipped. There's no detail.



    Logically, this is how it should display when encoded as full range without converting the levels.
    PC to TV (it's a bit washed out):



    And if you go the other way it looks too dark, so I'm pretty sure it's displaying correctly.
    The only way to know for certain though is to use the black borders test I mentioned a while ago to determine if black is displaying as black and if the borders and picture get lighter or darker when you change the levels. Once you know it's technically displaying "correctly" you can go about trying to fix a picture if it has bad levels.
    TV to PC:

    Image Attached Files
    Last edited by hello_hello; 4th Oct 2019 at 12:20.
    Quote Quote  
  7. Originally Posted by hello_hello View Post
    Logically, this is how it should display when encoded as full range without converting the levels.
    PC to TV (it's a bit washed out):
    This one looks pretty fine here, it doesn't look washed out or anything.

    The sample looks dark:


    Maybe this is happening because I'm using a TV as a monitor???
    Maybe it's because of Sony "X-Reality Pro" engine??

    The engine it's "turned off" in the settings but who knows for real if it is really turned off or not.
    Last edited by amaipaipai; 4th Oct 2019 at 12:53.
    Quote Quote  
  8. I've found what was causing all this trouble, it's a setting hidden inside the picture settings called "Adv. Contrast Enhancer", it was set as 'low'. The TV uses profiles sou you can have one different setting for GAME mode, TV so on and so forth, for PC I use "GRAPHIC" mode so it suppose to turn everything off but it is sharing the same settings for "MOVIE" mode.

    All looks how it suppose to be now, including your sample.

    Thank you.

    Quote Quote  
  9. I hate to be a party-pooper but I'm still not sure....

    The pic in your post #67 does look too dark. It looks exactly like the third screenshot I posted where I applied a TV to PC conversion with a pixel shader.
    My "normal" screenshot was how it looked without any levels adjustment. To take the screenshot with the levels expanded to PC range I did this (I have some shaders saved as presets to make it easier):



    So it makes sense that your screenshot you said looked too dank looks like my "TV to PC" screenshot (the third one), but now I'm confused why your screenshot from post #68 looks like my "PC to TV" screenshot rather than the first, "normal" one.
    At least I assume it does, unless the brightness changed, because it's not the same frame.

    By the way, I don't know if your TV has the same feature as mine, but mine has a "PC" mode. It's a special mode where all the image enhancing crap that's supposed to be disabled when you disable it, but probably isn't, should be disabled. When it's active, most of the picture enhancing stuff is greyed out. I'd have to connect it again to check I've got it right (the PC monitor is currently connected to the PC's DVI out), but from memory if I connect the PC to the HDMI input marked HDMI (DVI), or it might be HDMI (PC), and the PC is connected at 1920x1080 and the refresh rate is 60Hz, the TV automatically puts itself into PC mode. It may even be fixed at full range input in PC mode, I can't remember for sure, but that's how PC mode for my TV works. It's also old enough to have a VGA input, so naturally when that's being used the TV also runs in PC mode.

    Mind you my TV can be a bit frustrating too. It remembers the various picture settings for each HDMI input individually, which is great, because you can configure different devices to display differently, but it's also really annoying, because if you unplug something and then plug it into a different HDMI input, it'll probably display differently.

    You don't have any erroneous pixel shaders enabled with MPC-BE, by any chance?
    Last edited by hello_hello; 4th Oct 2019 at 15:50.
    Quote Quote  
  10. Originally Posted by hello_hello View Post
    I hate to be a party-pooper but I'm still not sure....

    The pic in your post #67 does look too dark. It looks exactly like the third screenshot I posted where I applied a TV to PC conversion with a pixel shader.
    My "normal" screenshot was how it looked without any levels adjustment. To take the screenshot with the levels expanded to PC range I did this (I have some shaders saved as presets to make it easier):



    So it makes sense that your screenshot you said looked too dank looks like my "TV to PC" screenshot (the third one), but now I'm confused why your screenshot from post #68 looks like my "PC to TV" screenshot rather than the first, "normal" one.
    At least I assume it does, unless the brightness changed, because it's not the same frame.
    Let's try that again from the same frame.

    Virtualdub2


    MPC-BE


    Originally Posted by hello_hello View Post
    By the way, I don't know if your TV has the same feature as mine, but mine has a "PC" mode. It's a special mode where all the image enhancing crap that's supposed to be disabled when you disable it, but probably isn't, should be disabled. When it's active, most of the picture enhancing stuff is greyed out. I'd have to connect it again to check I've got it right (the PC monitor is currently connected to the PC's DVI out), but from memory if I connect the PC to the HDMI input marked HDMI (DVI), or it might be HDMI (PC), and the PC is connected at 1920x1080 and the refresh rate is 60Hz, the TV automatically puts itself into PC mode. It may even be fixed at full range input in PC mode, I can't remember for sure, but that's how PC mode for my TV works. It's also old enough to have a VGA input, so naturally when that's being used the TV also runs in PC mode.

    Mind you my TV can be a bit frustrating too. It remembers the various picture settings for each HDMI input individually, which is great, because you can configure different devices to display differently, but it's also really annoying, because if you unplug something and then plug it into a different HDMI input, it'll probably display differently.
    Yes, it has, it's called "graphic mode" everything it's supposed to be off and grayed out, maybe this was caused by a firmware update I did last year. They recommend that you do a full hardware reset after the update and I never did. I did now and everything it's off as it suppose to be.

    Originally Posted by hello_hello View Post
    You don't have any erroneous pixel shaders enabled with MPC-BE, by any chance?
    My pixel shaders are empty, there is nothing there. On my 'media player classic' there is a bunch of them but I rarely use MPC, it's here as a second option. On my MPC however the renderer settings > Output Range it's set as 'PC 0-255' (default).
    Quote Quote  
  11. Wow! I think we're seeing the same thing now! If not, at least our screenshots finally seem to match.

    Although.... I still don't quite understand why they didn't in the first place, given they should be independent of any display settings.... ie even if you turned the display's contrast down to nothing it shouldn't effect the screenshot.... but I think I'll decide not to think about that....
    Last edited by hello_hello; 4th Oct 2019 at 16:46.
    Quote Quote  
  12. Originally Posted by hello_hello View Post
    Wow! I think we're seeing the same thing now! If not, at least our screenshots finally seem to match.

    Although.... I still don't quite understand why they didn't in the first place, given they should be independent of any display settings.... ie even if you turned the display's contrast down to nothing it shouldn't effect the screenshot.... but I think I'll decide not to think about that....
    I agree, now we are seeing the exact same thing!
    All fine by me!

    Thank you!
    Quote Quote  
  13. I've uploaded a new version of CropResize dated 2020-01-07. There's a link in the opening post along with a summary of changes since the previous version.

    I've also updated the pictures illustrating CropResize usage in the second post.
    Last edited by hello_hello; 7th Jan 2020 at 11:20.
    Quote Quote  
  14. Hi hello_hello!

    If the source image is anamorphic why it display as "non anamorphic"?

    Thank you for the new update.
    Quote Quote  
  15. amaipaipai,
    The only time it should display "not anamorphic" for a source, is when the source storage aspect ratio and the InDAR are the same, which would also mean the storage aspect ratio and display aspect ratio in the top left corner are the same. In other words, when it's not really anamorphic.

    The first screenshot is an anamorphic source with an input display aspect ratio of 20:11, and a storage aspect ratio of 5:4 (720x576).

    CropResize(832,0, 14,56,-16,-56, InDAR=20.0/11.0, Info=true)

    The second screenshot is the same source with an input display aspect ratio of 5:4. Obviously the result won't be correct, but it displays "not anamorphic" as the storage aspect ratio and input display aspect ratio match.

    CropResize(640,0, 14,56,-16,-56, InDAR=5.0/4.0, Info=true)

    It'd be like specifying a 16:9 input display aspect ratio for a 1280x720 source. That would display as "not anamorphic" too, but the result would be correct. If you specify an output display aspect ratio that's the same as the output storage aspect ratio, it should display "not anamorphic" for the output too.

    Is that the sort of thing you're referring to? If not, let me know and I'll see if I can work out what the problem is, but I don't think I've come across a situation where it displays "not anamorphic" when it shouldn't.
    Image Attached Thumbnails Click image for larger version

Name:	1.jpg
Views:	21
Size:	77.2 KB
ID:	51381  

    Click image for larger version

Name:	2.jpg
Views:	18
Size:	79.8 KB
ID:	51382  

    Last edited by hello_hello; 8th Jan 2020 at 11:39.
    Quote Quote  
  16. Hi hello_hello, sorry I'm late.
    Your answer it's good enough, thank you.
    Quote Quote  
  17. Another update for CropResize, simply to add a "Position" argument for displaying the current frame number and position in time over the video. Sometimes it's handy and it saves having to use a separate function.
    Enabling it requires GRunT. http://avisynth.nl/index.php/GRunT

    The new version is dated 2020-01-25, and as usual, there's a link in the opening post.
    Image Attached Thumbnails Click image for larger version

Name:	Position.jpg
Views:	17
Size:	46.1 KB
ID:	51669  

    Quote Quote  
  18. Sorry folks, but another update. I discovered I'd added a line to the script for testing the color conversion and forgot to remove it, causing the script to throw an error for sources with a bitdepth greater than 8 when color converting with HDRTools. The new version is dated 200-01-30 and the link is in the opening post.
    Quote Quote  
  19. Hi hello_hello!

    Is there an easy way to make Frosty work?
    It doesn't matter what I do it doesn't show up at all.

    Code:
    ImageSource("E:\frame-480.png")
    CropResize(0,720, 0,0,0,0, InDAR=4.0/3.0, CPreview=0, Borders=true, Frosty=true, Resizer="BilinearResize", Info=false)
    FrostyBorders however, up to 960p it works, it doesn't with a 1080p size.
    Code:
    FrostyBorders(1440,960, InDAR=4.0/3.0, Resizer="BilinearResize")
    I'm doing something wrong?

    I'm trying to add frosty in files up to 4k so upscaled 4:3 aspect ratio videos can have a nice frosty border.
    Image Attached Thumbnails Click image for larger version

Name:	frame-480.png
Views:	27
Size:	66.3 KB
ID:	52237  

    Click image for larger version

Name:	frame-1080.png
Views:	12
Size:	206.2 KB
ID:	52238  

    Click image for larger version

Name:	frame-info.png
Views:	11
Size:	333.2 KB
ID:	52239  

    Click image for larger version

Name:	frame-frosty.png
Views:	15
Size:	687.2 KB
ID:	52240  

    Quote Quote  
  20. Hi amaipaipai.

    CropResize won't add borders of any kind unless you specify both a width and a height in full resizing mode (zero = unspecified). You'd specify the output dimensions and if borders are enabled, the picture is resized to the specified height and the appropriate width, and borders are added to the sides to make up the difference between the resized picture width and the output width.

    Or if the picture aspect ratio is wider than the output dimensions, it's resized to the specified width and the appropriate height, and borders are added to the top and bottom for the output height.

    So if you want to add borders to the sides of a 4:3 source (or a source with dimensions less than 16:9) and output a standard 1080p resolution:

    CropResize(1920,1080, 0,0,0,0, Borders=true, Frosty=true)

    It doesn't matter what size the 4:3 picture is. For the example above, the height will be resized to 1080, and if the picture happens to be exactly 4:3, the width will be resized to 1440, and borders will be added each side for a total width of 1920.

    Specifying an InDAR works as it does without borders. If no OutDAR is specified and you specify an InDAR, the picture will be resized to square pixel dimensions before adding borders. If the output storage aspect ratio is the same as the picture storage aspect ratio, no borders can be added. For example if you have a non-anamorphic 640x480 picture, and you specify CropResize(960,720, Borders=true), no borders will be added as the output is also 4:3.
    Something like CropResize(1280,720, Borders=true) would add borders to the sides, or CropResize(720,720, Borders=true) would give you a square picture with borders top and bottom.

    It's been so long since I've used it I'd have to check to be sure, but I think the stand-alone FrostyBorders function uses the source height as the default height, and if the source is anamorphic the default width is the source with after resizing to square pixel dimensions. It works the same way as CropResize though. It resizes and adds borders according to the specified output width and height. The output dimensions (storage aspect ratio) must be different to the source display aspect ratio, regardless of any resizing, otherwise it can't add borders.

    If the idea is to output a standard 1080p resolution:

    FrostyBorders(1920,1080)

    Don't forget, the borders must be at least 16 pixels wide before they can be frosty. Less than that, and both scripts fall back to plain black borders.
    Quote Quote  
  21. By the way, there'll probably be a new CropResize version next week. A few days ago I found the first example of a "released version" of the script getting something not quite right.

    I came across an RGB source with a mod1 height and a nowhere near standard resolution, and after resizing, I noticed the cropped picture display aspect ratio and the output display aspect ratio displayed by Info=true weren't exactly the same. The aspect error was only 2 percent of a pixel, and the only reason there's any error is because I had to add some insanity checks to the script's resizing/cropping/aspect calculations as floating point math can only be relied on to be accurate to around four decimal places for these sorts of numbers.

    So sometime soon I'll probably try to work out where the checking is too enthusiastic for this one god-damn source, and change it or dial it back a bit.
    Quote Quote  
  22. Hi hello_hello!

    Oh, now I see!
    Works like a charm!

    Code:
    CropResize(1920,1080, 80,0,0,0, InDAR=4.0/3.0, OutDAR=16.0/9.0, CPreview=0, Borders=true, Frosty=true, Resizer="BilinearResize", Info=true)
    I'll look forward for the new update, thank you hello_hello!
    Image Attached Thumbnails Click image for larger version

Name:	frame-1080-working.png
Views:	18
Size:	1.60 MB
ID:	52245  

    Quote Quote  
  23. No worries.

    By the way, it's no longer necessary to include "resize" when specifying an Avisynth resizer via the Resizer argument. Resizer="Bilinear" will also work.
    OutDAR=16.0/9.0 is unnecessary in this case, as the output dimensions are 16:9, so the result will be the same without it.

    If the output dimensions were 1440x1080 (for example), specifying OutDAR=16.0/9.0 would have an effect, as the calculations for resizing and adding borders would be based on the correct sample (pixel) aspect ratio for 1440x1080 to display as 16:9. If the source was 4:3 it'd be resized to 1080x1080, then borders would be added to the sides for a total width of 1440, and on playback the video would be resized to 16:9 dimensions.

    Is the source you're using anamorphic? I ask, as a left cropping of 80 will naturally result in the script cropping 80 pixels, which changes the input display aspect ratio. It depends on the original resolution as to how much it'll change, but if you crop 80 pixels from one side of any 4:3 source, the display aspect ratio of the remaining picture will be less than 4:3.

    If the source is supposed to display as 4:3 before it's cropped, the aspect ratio will be correct after cropping and resizing, it just won't be 4:3 any more. As per your earlier screenshot where the 80 pixel cropping resulted in the picture being cropped to a display aspect ratio of 1.288 and resized to 928x720. I just thought I'd check that's correct and what you were expecting.
    Quote Quote  
  24. Originally Posted by hello_hello View Post
    Is the source you're using anamorphic? I ask, as a left cropping of 80 will naturally result in the script cropping 80 pixels, which changes the input display aspect ratio. It depends on the original resolution as to how much it'll change, but if you crop 80 pixels from one side of any 4:3 source, the display aspect ratio of the remaining picture will be less than 4:3.

    If the source is supposed to display as 4:3 before it's cropped, the aspect ratio will be correct after cropping and resizing, it just won't be 4:3 any more. As per your earlier screenshot where the 80 pixel cropping resulted in the picture being cropped to a display aspect ratio of 1.288 and resized to 928x720. I just thought I'd check that's correct and what you were expecting.
    Hi Hello_hello!

    The original comes from a game console and it had this strange resolutions, the original is 256x196 (64:49). As you can see in the image without cropping it has this black bar only in the left side of the screen, the 80 pixel crop deals with that. These are just test runs to see frosty in action.

    Can I ask you something?
    Are you taking features requests?

    It is possible to use images/pictures instead of a blur in frosty?

    Thank you for the extra info!
    Image Attached Thumbnails Click image for larger version

Name:	frame-480LBBAR.png
Views:	12
Size:	89.7 KB
ID:	52252  

    Quote Quote  
  25. Originally Posted by amaipaipai View Post
    Can I ask you something?
    Are you taking features requests?

    It is possible to use images/pictures instead of a blur in frosty?
    That's probably something best kept as a separate function, as it requires multiple clips.
    It's attached below. It's fairly basic but does the job, assuming I correctly understand what you're after.
    Edit: Attachment deleted. For an updated version, see post #89

    The rules:

    SideImages() doesn't resize the main picture. It will resize the border images if necessary.
    There's only an OutWidth option for specifying the output width. The output height is always the source height.
    All clips and images must be of the same color type (RGB or YV12 etc)

    SideImages(Video, OutWidth, LeftImage, RightImage, Flip, Stretch)

    The options:

    OutWidth - must be greater than the main video width otherwise the function does nothing and you get the source video.

    LeftImage - can be a clip or an image. If a clip is specified, the first frame is always used for the border image.
    If LeftImage is unspecified, the first frame from the main clip is used.

    RightImage - can be a clip or an image. If a clip is specified, the first frame is always used for the border image.
    If RightImage is unspecified, the LeftImage is used.

    Flip - the default is true unless RightImage is specified, in which case the default is false.
    This means when only LeftImage is specified, or no border images are specified, the default is for RightImage to be a mirror of LeftImage.

    Stretch - the default is true, in which case if the border images need resizing, they're simply stretched or squished to the correct dimensions with BilinearResize.
    When Stretch=false, CropResize is used to crop and resize the border images as required, so their aspect ratios aren't altered. If the image aspect ratio is greater than the aspect ratio of the border being added, the sides will be cropped to match the border aspect ratio before it's resized. In other words, the centre part of the image will be used as the border.

    Examples:

    Taking a 4:3 image and resizing with CropResize() so the height is 540.
    SideImages() then adds the borders for a total width of 960.

    CropResize(0,540, InDAR=4.0/3.0)
    A = ImageSource("BorderA.bmp").ConvertToYV12()
    B = ImageSource("BorderB.bmp").ConvertToYV12()


    No border images are specified in this example, so the first frame of the main clip is used. Mostly that'll be black, so I used Trim to make sure it wasn't.

    SideImages(960)



    SideImages(960, Stretch=false)




    Specifying only a single border image.

    SideImages(960, A)



    SideImages(960, A, Stretch=false)




    Specifying both border images.

    SideImages(960, A, B)



    SideImages(960, A, B, Stretch=false)

    Last edited by hello_hello; 10th Mar 2020 at 21:26.
    Quote Quote  
  26. OH MY GOD!
    This is a dream come true for me.

    THANK YOU hello_hello!!!!
    Quote Quote  
  27. You're welcome. There shouldn't be any problems with it, but if you happen to find any, let me know. I haven't tested to see what happens when it's asked to add tiny borders (just a few pixels). You might end up with a cropping or resizing error, but you're unlikely to want it to do that anyway.
    Quote Quote  
  28. I'll!
    Thank you!!
    Quote Quote  
  29. amaipaipai,
    A few things occurred to me, so attached is a new version of SideImages.

    If you specify zero for OutWidth, the main video is passed through untouched (OutWidth=0 is the default).

    If OutWidth > 0 but less than the main video width, the script now outputs an error message, telling you what that width is, so if you need to know you can use the error message to find out by specifying a tiny OutWidth. See the attached screenshot.

    The script no longer attempts to use images for borders unless both borders are at least 4 pixels wide. If either are less than 4 pixels, it'll add black borders instead (4 pixels seems to be the minimum without resizing errors).

    The frame rate was previously taken from the LeftImage clip. Both LeftImage and RightImage are now adjusted to the same frame rate as the main video (AssumeFPS).

    If the main video has sound, the output will contain the sound from the main video. Previously there was no sound.

    There's a newer version of SideImages() attached to post #94.
    Image Attached Thumbnails Click image for larger version

Name:	OutWidth.gif
Views:	10
Size:	10.1 KB
ID:	52259  

    Image Attached Files
    Last edited by hello_hello; 10th Mar 2020 at 07:55.
    Quote Quote  
  30. Hi hello_hello!

    This is what I did with the previous script, I'll work with the new one soon.

    Thank you for the fix!

    Code:
    CropResize(0,1080, 0,0,0,0, InDAR=4.0/3.0, Resizer="Bilinear", Info=false)
    
    A = ImageSource("A.png").ConvertToYV12()
    B = ImageSource("B.png").ConvertToYV12()
    SideImages(1920, A, B)
    Code:
    CropResize(0,1080, 0,0,0,0, InDAR=4.0/3.0, Resizer="Bilinear", Info=false)
    
    A = ImageSource("PA.png").ConvertToYV12()
    B = ImageSource("PB.png").ConvertToYV12()
    SideImages(1920, A, B)
    Image Attached Thumbnails Click image for larger version

Name:	SideImage.png
Views:	13
Size:	1.14 MB
ID:	52262  

    Click image for larger version

Name:	A.png
Views:	12
Size:	203.8 KB
ID:	52263  

    Click image for larger version

Name:	B.png
Views:	13
Size:	238.6 KB
ID:	52264  

    Click image for larger version

Name:	punisher.png
Views:	15
Size:	1.06 MB
ID:	52265  

    Click image for larger version

Name:	punisher2.png
Views:	15
Size:	1.17 MB
ID:	52266  

    Click image for larger version

Name:	PA.png
Views:	11
Size:	441.2 KB
ID:	52267  

    Click image for larger version

Name:	PB.png
Views:	11
Size:	378.4 KB
ID:	52268  

    Quote Quote  



Similar Threads