VideoHelp Forum




+ Reply to Thread
Results 1 to 20 of 20
  1. Anonymous4453
    Guest
    I'm Doing som VHS to DVD conversions using avisynth which is brilliant.
    When cropping the video i'll use AddBorders.
    The problem is the borders are solid black which doesn't look so nice. I'm trying to get that pro look where the border almost fades whith the movie. Any suggestions? I've heard of one called handicraft just can't find it.

    thanks
    Quote Quote  
  2. You don't like black borders? I do. Is something like below what you had in mind?

    I'm trying to get that pro look where the border almost fades witth the movie.
    Have you ever seen any retail DVD where the borders fade into the movie? Or am I not understanding the look you want.
    Image Attached Thumbnails Click image for larger version

Name:	BeforeAfter.jpg
Views:	241
Size:	128.7 KB
ID:	18167  

    Quote Quote  
  3. Anonymous4453
    Guest
    No i like Black borders. But the border isnt like the first picture. The addborders looks to solid and not Smooth. The edge of the border is like A straight vertical line.
    Quote Quote  
  4. That top picture is from a DVD I made myself, a conversion from what was originally a PAL DVD. I used AddBorders myself on that one. They're supposed to be 'solid and not Smooth'.

    Apparently you're talking about side borders (pillar bars), but they should look the same. Do you have any examples of the look you're going for? Failing that, a picture of what you don't like?
    Quote Quote  
  5. Anonymous4453
    Guest
    I Think this is my problem :
    Image Attached Thumbnails Click image for larger version

Name:	image.jpg
Views:	322
Size:	69.6 KB
ID:	18169  

    Quote Quote  
  6. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Are you talking about borders on the left/right? Doesn't the capture already have soft borders where the active picture ends?
    Quote Quote  
  7. I've seen lots of DVDs where the edges of the borders aren't "sharp", although I think "fading into the video" is bit of an overstatement. If I was to encode video while keeping the borders though, I'd generally crop the existing ones and use AVISynth to add them back with nice sharp edgs where they meet the picture. Fuzzy edges look amateurish to me. They also make the whole picture harder to compress. Why spend bits encoding fuzzy borders which could be used elsewhere to improve the actual picture quality?
    Quote Quote  
  8. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    You have it backwards, unfortunately. Sharp borders of 8 pixels are harder to compress because luma macroblocks are 16x16. I'd say the ideal is if your borders look like the second image in this grid.
    Quote Quote  
  9. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    No, vaporeon, sharp borders are preferred - as long as the pixels fall within macroblock boundaries! And most standard letterboxing/pillarboxing can fulfill that requirement, particularly in more advanced codecs like h264 where macroblock sizes can vary.

    Scott
    Quote Quote  
  10. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Did you read the OP before coming in to tell me I'm wrong? He is converting to DVD, not H.264. How can a 8-pixel border from the left edge fall at a 16-pixel macroblock boundary?

    EDIT: If x264's developers are to be believed, the best padding is to duplicate the edge line as many times as necessary.

    Code:
    Active = Crop(8,0,-8,-0)
    L      = Active.ConvertToRGB(interlaced=true).Crop(0,0,-703,-0)
    L8     = StackHorizontal(L,L,L,L,L,L,L,L).ConvertToYUY2()
    R      = Active.ConvertToRGB(interlaced=true).Crop(703,0,-0,-0)
    R8     = StackHorizontal(R,R,R,R,R,R,R,R).ConvertToYUY2()
    StackHorizontal(L8,Active,R8)
    Doesn't look half bad.
    Last edited by Brad; 2nd Jun 2013 at 23:36.
    Quote Quote  
  11. Anonymous4453
    Guest
    Fading is an overstatement. I just mean soft edges of the black borders. Does anybody know where to get the plugin from the picture?
    Quote Quote  
  12. Sorry to sidetrack the thread a bit, and unfortunately I don't know of any soft-border plugin.

    Originally Posted by vaporeon800 View Post
    You have it backwards, unfortunately. Sharp borders of 8 pixels are harder to compress because luma macroblocks are 16x16. I'd say the ideal is if your borders look like the second image in this grid.
    Well for fun I thought I'd give it a test. Not necessarily using mod8 though, as if I was going to remove borders with fuzzy edges and replace them with sharper ones I'd only be replacing what I needed to. For my test encodes I removed and replaced 20 pixels from the left and 12 from the right.

    I picked an AVI with slightly fuzzy borders down the sides and encoded it "as-is". The AVI was one I'd created as a lossless intermediate file re-encoded from a DVD, so the video was already de-interlaced and filtered etc. I used two scripts, one without cropping and one replacing the borders with sharper edges. I encoded both scripts with Xvid (CQ2.0) and x264 (CRF18) using single pass encoding and the same settings each time (just 10 minutes of the video using Trim in the script). The results:

    Xvid
    Fuzzy borders: 343.0MB, 4700Kb/s
    Sharp Borders: 339.1MB, 4647Kb/s

    x264
    Fuzzy Borders: 306.7MB, 4203Kb/s
    Sharp Borders: 302.6MB, 4147Kb/s

    Concerned I may have been outputting a smaller file size after using AddBorders simply because more of the video was black (not because the borders were sharper as such) I tried one final encode using x264 while only cropping 18 pixels from the left and adding them back (still 12 right). The output file size was still slightly smaller than the encode of the original video.

    x264
    Not quite as sharp borders: 304.0MB, 4166Kb/s.

    Unless mpeg2 encoders would produce different results, it seems sharper borders might make the video easier to compress. Unless I'm missing something......

    Screenshots using the scripts:

    Original
    Image
    [Attachment 18214 - Click to enlarge]


    Sharp borders (20 pixels left, 12 pixels right)
    Image
    [Attachment 18215 - Click to enlarge]


    Why is it when I attach pictures they show as thumbnails using the preview before posting, but as attachments after submitting the post? Is it me or the forum?
    Last edited by hello_hello; 4th Jun 2013 at 07:43.
    Quote Quote  
  13. Originally Posted by hello_hello View Post
    Why is it when I attach pictures they show as thumbnails using the preview before posting, but as attachments after submitting the post? Is it me or the forum?
    It's the forum software. One place I found it always happens is when you start a reply with the Quick Reply box at the bottom of the page. If you add pictures there and press Post Quick Reply the images will appear in your reply. But if you press Go Advanced and post from the advanced editor, the pictures added in the Quick Reply editor won't appear as thumbnails, only links.


    For the OP: to get soft edges you could use Blur and Overlay with a mask after AddBorders. You could create your own SoftBorders() function call it as necessary. Here's an example I quickly banged out:

    Code:
    function SoftBorders(clip source, int left, int top, int right, int bottom)
    {
        mask=BlankClip(source, color=color_white).Crop(2,2,-2,-2).AddBorders(left+2, top+2, right+2, bottom+2).Blur(1.0).Blur(1.0).Blur(1.0)
        black=BlankClip(mask)
        AddBorders(source, left, top, right, bottom)
        Overlay(black, last, 0, 0, mask)
    }
    The problem with this script is that you get darkening at edges when not adding borders to those edges.
    Last edited by jagabo; 4th Jun 2013 at 09:36.
    Quote Quote  
  14. Your screenshot is from didee's script (post 5&6) . You can copy&paste , just adjust the addborders values

    http://forum.doom9.org/showthread.php?t=141979
    Quote Quote  
  15. Here's an update without the "dark edges" problem:
    Code:
    function SoftBorders(clip source, int left, int top, int right, int bottom, int "border_color")
    {
        border_color  = default(border_color, color_black)
    
        mask = BlankClip(source, color=color_white)
        mask = left!=0 ? Crop(mask, 2, 0, -0, -0).AddBorders(2, 0, 0, 0) : mask
        mask = top!=0 ? Crop(mask, 0, 2, -0, -0).AddBorders(0, 2, 0, 0) : mask
        mask = right!=0 ? Crop(mask, 0, 0, -2, -0).AddBorders(0, 0, 2, 0) : mask
        mask = bottom!=0 ? Crop(mask, 0, 0, -0, -2).AddBorders(0, 0, 0, 2) : mask
        mask = AddBorders(mask, left, top, right, bottom)
        mask = mask.Levels(16, 1, 235, 0, 255, coring=false)
        mask = mask.Blur(1.0).Blur(1.0)
    
        border=BlankClip(mask, color=border_color)
        AddBorders(source, left, top, right, bottom)
        Overlay(border, last, 0, 0, mask)
    }
    You can control how sharp the transition is by using more or less blur in the mask.
    Last edited by jagabo; 8th Jun 2013 at 22:28. Reason: Added border color option
    Quote Quote  
  16. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Originally Posted by hello_hello View Post
    Not necessarily using mod8 though, as if I was going to remove borders with fuzzy edges and replace them with sharper ones I'd only be replacing what I needed to. For my test encodes I removed and replaced 20 pixels from the left and 12 from the right.

    ...

    Concerned I may have been outputting a smaller file size after using AddBorders simply because more of the video was black (not because the borders were sharper as such) I tried one final encode using x264 while only cropping 18 pixels from the left and adding them back (still 12 right). The output file size was still slightly smaller than the encode of the original video.
    I'm not sure how your second test works to prove your initial one. From the screenshots you are cropping actual picture information, so of course the black pixels you replace them with are easier to compress.

    Since you have 32 black columns to play with, try using the same sharp borders in each but trying initial placement vs. centered (which will be mod16 in this case).
    Quote Quote  
  17. Originally Posted by vaporeon800 View Post
    I'm not sure how your second test works to prove your initial one. From the screenshots you are cropping actual picture information, so of course the black pixels you replace them with are easier to compress.
    On the right side I only removed the soft edge of the black border. 12 pixels was the minimum required to make the edge sharp. If there's a way to replace the couple of rows of grey pixels which make the edge soft with pure picture rather than black I don't know how to do it.
    On the left side I removed/replaced 20 pixels (the second screenshot) then encoded it again while only removing/replacing 18 pixels to ensure I hadn't cropped anything which could be considered "picture". Either way, the bitrate reduced when the edges were sharper.

    Arguing I'm cropping actual picture area seems a bit like having it both ways to me. You've claimed soft edges on the black borders are easier to compress, but now you seem to be counting the soft edges as actual picture area and saying the black pixels I replaced them with are easier to compress.
    Quote Quote  
  18. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Huh. Your response didn't show up in New Posts.

    jagabo: I don't know about the original, but your updated script dims the contrast of the whole image.

    I'm doing some visual comparisons with HCEnc at the same bitrate, and having a 16-pixel column at the right of the image actually causes the picture to be far lower quality than having two 8-pixel columns. Confusing...
    Quote Quote  
  19. Originally Posted by vaporeon800 View Post
    jagabo: I don't know about the original, but your updated script dims the contrast of the whole image.
    Thanks for catching that. I updated the post, adding the Levels() line to the script.
    Quote Quote  
  20. Originally Posted by vaporeon800 View Post
    I'm doing some visual comparisons with HCEnc at the same bitrate, and having a 16-pixel column at the right of the image actually causes the picture to be far lower quality than having two 8-pixel columns. Confusing...
    I don't know much about mpeg2 encoding, but could a 16 pixel column of black effect the way the entire picture is encoded more than two 8 pixels columns in respect to over-all motion estimation or something similar?

    I tried some test encodes a while back using the x264 encoder and at the same CRF value, adding black borders actually decreased the bitrate slightly even though it also increased the number of pixels which needed to be encoded. In the case of x264 the difference was very small and not enough to produce a noticeable difference in picture quality, but the black borders did decrease the bitrate marginally rather than increase it as you might expect. Whether the borders were 16 pixels wide or less didn't make too much difference though.

    I'm just wondering if in the case of mpeg2 encoding the encoder sees a 16 pixel column as a static image whereas two 8 pixels columns also contain 8 pixels of picture so they're seen as far less static, and therefor effect the motion estimation for the entire picture less. Or something like that...... I'm just theorising..... but I was under the impression that once upon a time the main reason for cropping black borders was due to the way they effected the encoding of the active picture area.
    Quote Quote  



Similar Threads

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