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
+ Reply to Thread
Results 1 to 20 of 20
-
Anonymous4453Guest
-
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. -
Anonymous4453Guest
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.
-
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? -
Are you talking about borders on the left/right? Doesn't the capture already have soft borders where the active picture ends?
-
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?
-
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 -
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)
Last edited by Brad; 2nd Jun 2013 at 23:36.
-
Anonymous4453Guest
Fading is an overstatement. I just mean soft edges of the black borders. Does anybody know where to get the plugin from the picture?
-
Sorry to sidetrack the thread a bit, and unfortunately I don't know of any soft-border plugin.
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
[Attachment 18214 - Click to enlarge]
Sharp borders (20 pixels left, 12 pixels right)
[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.
-
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) }
Last edited by jagabo; 4th Jun 2013 at 09:36.
-
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 -
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) }
Last edited by jagabo; 8th Jun 2013 at 22:28. Reason: Added border color option
-
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). -
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. -
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... -
-
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.
Similar Threads
-
Black borders all around video
By techboy_66 in forum SVCD2DVD & VOB2MPGReplies: 1Last Post: 30th Oct 2010, 17:01 -
Help removing left and right black borders!
By FatalX in forum Video ConversionReplies: 5Last Post: 15th May 2010, 17:47 -
Cutting black borders
By HamishT in forum Authoring (DVD)Replies: 17Last Post: 4th Mar 2009, 17:53 -
Does anybody know how to convert 16:9 to 4:3 with black borders?
By tuanvn.2007 in forum Video ConversionReplies: 7Last Post: 20th Sep 2008, 02:13 -
Black Borders won't go away!!!
By mirandapanda in forum Newbie / General discussionsReplies: 6Last Post: 10th Sep 2008, 01:49