Quantcast Avisynth: Want to Add Black Borders - digitalFAQ.com Forums [Archives]
  #1  
10-19-2004, 05:23 PM
the viking the viking is offline
Free Member
 
Join Date: Sep 2004
Location: Norway
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
I wan't to add black borders on some of my captures,
not only top/bottom,but all the way around the picture.

The borders must be visible on my tv.

My Disney DVD "Brother Bear" got this presentation the 21 first minutes of the movie.

I've tried with AddBorders/Gripborders,but the movie is cropped in
a bad way.I do something wrong here!!Sure.

Anyone of you have a "sript line" for this operation?Or any ideas?

Read AviS. manual but couldn't find any answers to it.

The point is to see my movie inside the black border uncropped
and with correct A/R.Only resized to fit into the black frame.

Does AviS. support this operation?

Thanks

--------------------
viking
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
10-20-2004, 07:39 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by the viking
Does AviS. support this operation?
Not automatically if this is what you mean. You have to give him correct parameters for resize and addborder.

What I suggest to you :
- load the source (let say it is 720x576)
- add a border with for instance Addborder (32,32,32,32)
- use FitCD or Moviestacker and put manually in the source resolution area 784 (720 + 32 + 32) and 640 (576 + 32 + 32) and use FitCD as you always do (if you already do).
You will obtain the correct resize parameter you need to obtain a picture of the size you want, with borders all arround it.

You can't use GripBorder as it cuts existant borders before to resize.

Note: your script will have TWO addborder lines.
Reply With Quote
  #3  
10-20-2004, 08:20 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
What I suggest to you :
- load the source (let say it is 720x576)
- add a border with for instance Addborder (32,32,32,32)
- use FitCD or Moviestacker and put manually in the source resolution area 784 (720 + 32 + 32) and 640 (576 + 32 + 32) and use FitCD as you always do (if you already do).
You will obtain the correct resize parameter you need to obtain a picture of the size you want, with borders all arround it.
But this change DAR and when FitCD do the resize, "film pixel" aspect ratio will change. If his source DAR is 1:1, wouldn't be better add at sides 32+32 and and top 24+24. But with this 2 more observations:
1 - From 784 horizontal res, only will showed in a TV 768 pixels. So FitCD will crop, resize until that value (I think, all is theoretical).
2 - If this resize will be allowed, only will show in TV a 16+16, 8+8 borders, due to a overscan of 2 points.

Maybe it would be better to resize first and later add borders?
Reply With Quote
  #4  
10-20-2004, 08:27 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Prodater64
But this change DAR and when FitCD do the resize, "film pixel" aspect ratio will change. If his source DAR is 1:1, wouldn't be better add at sides 32+32 and and top 24+24.
Hum... you're right for that

Quote:
1 - From 784 horizontal res, only will showed in a TV 768 pixels. So FitCD will crop, resize until that value (I think, all is theoretical).
Not at all, FitCD will do as when you have a 720*576 source and want to obtain a 480*576 on for instance : it will crop a few pixels to be mod2 (or mod8, or whatever you asked it to be for cropping), then it will reduce the size. The fact that the source is bigger than the DVD resolution is not different than the normal usage of Fitcd (we always use it to reduce the size, don't we ?).

Quote:
2 - If this resize will be allowed, only will show in TV a 16+16, 8+8 borders, due to a overscan of 2 points.
Except if you ask to FitCD to predict also an overscan of 2. I never told to use it with overscan=0

Quote:
Maybe it would be better to resize first and later addborders?
Yes it is. But the problem is : how to compute the parameters ? There is no tool that let you give the target size you want.
Reply With Quote
  #5  
10-20-2004, 09:59 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
Quote:
1 - From 784 horizontal res, only will showed in a TV 768 pixels. So FitCD will crop, resize until that value (I think, all is theoretical).
Not at all, FitCD will do as when you have a 720*576 source and want to obtain a 480*576 on for instance : it will crop a few pixels to be mod2 (or mod8, or whatever you asked it to be for cropping), then it will reduce the size. The fact that the source is bigger than the DVD resolution is not different than the normal usage of Fitcd (we always use it to reduce the size, don't we ?).
Yes, we do, but with 720*576 sources whose actual active picture size is 702*576 (PAR 128/117). This meant 768*576 (PAR 1/1). This meant that if you have a resolution bigger that 702*576 (for mod 4 purposes 704*576), all that extra info won't be showed in TV, or if you want to show extra info at sides, should cut vertical res. (crop options in Moviestacker -> "Max Width in place of "Accurate") or to deform AR. But if you use Gripcrop, I think that it will crop as "accurate" mod.
Fortunately with DVD sources 720*576/480, there is not active picture pixels from 702 to 720. This segment it is called also overscan, but it is no related with overscan that we use every day.
Reply With Quote
  #6  
10-20-2004, 10:07 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Prodater64
This meant that if you have a resolution bigger that 702*576 (for mod 4 purposes 704*576), all that extra info won't be showed in TV
But the TV will NEVER receive a picture bigger than 704*576 ! FitCD will REDUCE the original (that is bigger than 704*576), to 704*576. That will be done by resizing, not cropping !
As I said, there is no diff between :
- to have a 720*576 source and ask for a 480*576 target
and
- to have a 1024*768 source and ask for a 704*576 target

For FitCD both situation are the same : it compute how to reduce the picture to crop the minimum and to not distort the A/R ("accurate" mode).

Quote:
Fortunately with DVD sources 720*576/480, there is not active picture pixels from 702 to 720.
Where dis you see that ?

The majority of my DVD have a real width of 720 pixels. Very few have a border of right/left side with an active area of less than 720. And very, very few have exactly an active area of 702

Open whatever vob you want in DVD2AVI and use the "clip & resize" feature : you will see that you won't have very ofen a border to crop on the vertical sides of the source !

Quote:
.This segment it is called also overscan, but it is no related with overscan that we use every day.
This is surely pure theory but it's not like this in real situation.
Reply With Quote
  #7  
10-20-2004, 10:21 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Maybe I'm wrong. I just beginning with resizing but I think that I say here, it is not very different that sayed in http://www.kvcd.net/forum/viewtopic.php?p=79805#79805
this post and others from that thread.
Reply With Quote
  #8  
10-20-2004, 10:30 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Nowhere in what Inc explained there it is written than a DVD don't have anything in the pixels from 702 to 720.

Or can you quote the line please ? (the post is really long )
Reply With Quote
  #9  
10-20-2004, 11:39 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
Nowhere in what Inc explained there it is written than a DVD don't have anything in the pixels from 702 to 720.

Or can you quote the line please ? (the post is really long )
Quote:
Originally Posted by Incredible
So lets get that baby to final 1:1 Square Tv pixels:

720 x (128/117) = 787,69 means 788 x 576
And as our PAL Tv only can display 768x576 .... you can assume why it DOESNT make sense to re-encode at 720x576 for TV purposes!

And thats also the reason WHY a direct simple rescaling to 480x576 out od the 720x576 does NOT output a wrong AR. But still these 6+6 px in your SVCD Stream wont be seen defenitely even if your TV wouldnt have an overscan area!
Those 6+6 are in 720*576 9+9.
Reply With Quote
  #10  
10-20-2004, 11:45 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Prodater64
Those 6+6 are in 720*576 9+9.
As I said, Inc does not say that in the original 720 source there is nothing between 702 and 720, he is just telling than if your target is 720, then you will display only the "middle" 702 pixels, the rest will be eaten by the overscan of the TV.

If you want to be correct, you can say : on original DVD, what is in the pixel 702 to 720 isn't displayed on the TV, so if you want to encode the exact same picture you see on the original source, then you can crop them.

But all the work we do with fitcd and moviestaker IS to avoid to loose this pixels and to encode a target where ALL the pixels of the original source are present.
Reply With Quote
  #11  
10-20-2004, 12:05 PM
the viking the viking is offline
Free Member
 
Join Date: Sep 2004
Location: Norway
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
I'm back!

I've done two tests now and it works perfectly.Thanks a lot.

Heres the script I used:

Mpeg2Source("G:\PIRATES_OF_THE_C\VIDEO_TS\pirat.d2 v")
AddBorders(96,64,96,64)
LanczosResize(688,416,2,0,912,704)
AddBorders(16,80,16,80)
#bicubicresize(768,576) #To preview in Virtual Dub.

and one for my captures:

DirectShowSource("G:\Captured Video\Video 1.avi",fps=25)
AddBorders(96,64,96,64)
LanczosResize(672,544,0,4,912,66
AddBorders(24,16,24,16)
#bicubicresize(768,576) #To preview in Virtual Dub.

Quite heavy borders,but that was only for testing purposes.
Looks perfect on my TV.

I used 2 Blocks overscan.

Is the best place for AviSynth filters between the first AddBorders
line and LanczosResize,or am I wrong again?Talking about
denoise filters.
------------------------
Reply With Quote
  #12  
10-20-2004, 12:09 PM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
I would like Incredible say us something about.

Meanwhile, when you don't be so tired, maybe can read
http://www.arachnotron.nl/videocap/d..._cap_v1_en.pdf
Quote:
Originally Posted by Page 4
The digital result after ITU contains a 702*576 pixel motion-area (the range, where
something happens) and both on the left and on the right 9 (in total 18) pixels each
overscan, thus black edges. These 18 pixels of course not completely exact. The source is
analogue after all, and also the broadcasting stations do not works all that precise.
By now it should be clear what this 704*576 resolution is good for. It corresponds precisely
to 702*576 plus 2 times 1 pixel overscan, and therefore contains the same motion area as
the 720*576 (when digitized correctly according to ITU).
If a capture-card and/or it’s driver at 720*576 resolution fills the whole horizontal range with
active video information or leaves only a few pixels in the border, then it behaves incorrect
and is not ITU compliant.
Reply With Quote
  #13  
10-20-2004, 12:45 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Page 4
The digital result after ITU contains a 702*576 pixel motion-area (the range, where
something happens) and both on the left and on the right 9 (in total 1 pixels each
overscan, thus black edges.
Again, all that is said here is that on 720 pixels, only 702 are active (in other words, you lose the 18 extra pixel). But again there is in no way written : on DVDs there is nothing in the pixels 702 to 720 ! This is a bad interpretation.

Quote:
If a capture-card and/or it’s driver at 720*576 resolution fills the whole horizontal range with
active video information or leaves only a few pixels in the border, then it behaves incorrect
and is not ITU compliant.
So finally I can tell you that a majority of DVD aren't ITU compliant

Process like I said : take a DVD, open a vob into DVD2AVI and use the clip & resize feature. You will see that almost no DVD need to be crop by 9 pixels on each side !

You can see that also on a d2v project with a simple "MPEG2source("...").Autocrop()" script.
(even if Autocrop sometimes crop too much pixels, it will give you the left border and the active width of your source).
Reply With Quote
  #14  
10-20-2004, 12:54 PM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
The digital result after ITU contains a 702*576 pixel motion-area (the range, where
something happens) and both on the left and on the right 9 (in total 1 pixels each
overscan, thus black edges.
Well, excuseme if it is a bad interpretation, my english is not really good, but bold quoted test, what does it mean?
Reply With Quote
  #15  
10-20-2004, 02:04 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
I just overflew this thread an Phil is right by saying that a valid 720 DVD resultion (FULL PAL D1) can easely contain a totally filled picture information in its width. And its also right what Pro and Phil do understand that the middle 702(PAL) or 711(NTSC) of these 720 only will be shown on a standard TV Set.


@ Phil

Quote:
So finally I can tell you that a majority of DVD aren't ITU compliant
Hmmmm
Well, all movie DVDs arent only purposed to be shown on a TVset and its a matter of how they have been digitized! So IF a DVD results out of a DIRECT capture, then ONLY 702 in case of PAL and 711 in case of NTSC "would" make sense as thats the actual active picture area of an PAL and NTSC TVset.

Next point: ITU compilant DVDs ....
Yep, thats an importand isue that its NOT guaranteed that all DVDs out there do base on a correct ITU AspectRatio based "glass-master" production.
THATS why FitCD got that "ITU compilant" checkbox.
But how can u find out WHATs the right one you deal with ... hmmm.
Maybe if you find right at the beginning a circle in the intro, that one you could inspect for the 1:1 proportion ..... and now do search on EVERY DVD such a "reference" object before resizing. .... And thats the *joke*


EDIT:

In case of 720 to 480 resizings, there doesnt have to be any cropping as both will be played back by the sap at 53.333µs! BUT with diff. mhz, thats the point and the final image width at TV-pixels is defined by its µs-value.
You also can set in FitCD that the FULL width also should be kept in case of a reencoding to 704 but that would mean a reducing of the orig height to keep the AR.
Reply With Quote
  #16  
10-21-2004, 01:15 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
I know viking already solved his problem, but just to get back to the original question...

Quote:
Originally Posted by the viking
Hi,
I wan't to add black borders on some of my captures,
not only top/bottom,but all the way around the picture.

The borders must be visible on my tv.
(...)
The point is to see my movie inside the black border uncropped
and with correct A/R.Only resized to fit into the black frame.
Quote:
Originally Posted by Dialhot
Quote:
Originally Posted by Prodater64
Maybe it would be better to resize first and later addborders?
Yes it is. But the problem is : how to compute the parameters ? There is no tool that let you give the target size you want.
Yes, there is... if you look in MovieStacker (or FitCD) next to the "resize" settings, you will see a set of arrows (up and down) in the right side of the "height edit box". Those arrows will change the size of the active film pixels keeping the correct aspect ratio. That's exactly what viking wanted to do. So he just has to select the desired destination and than decrease the active film pixel (with the mentioned arrow) until he get the black borders the way he wants. With the new MovieStacker he can quickly preview the results of the changes (just pressing the "preview" button).

You can also use those arrows to increase the height of the active film pixels and make a custom "pan-scan" with a widescreen source. MovieStacker will cut the width preserving the aspect ratio, overscan and destination you choose.
Reply With Quote
  #17  
10-21-2004, 02:04 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Reply With Quote
  #18  
10-21-2004, 02:53 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Yes, there is... if you look in MovieStacker (or FitCD) next to the "resize" settings, you will see a set of arrows (up and down) in the right side of the "height edit box". Those arrows will change the size of the active film pixels keeping the correct aspect ratio. That's exactly what viking wanted to do.
You're right
And I just saw that FitCD also as this setting
Reply With Quote
  #19  
10-21-2004, 03:14 AM
the viking the viking is offline
Free Member
 
Join Date: Sep 2004
Location: Norway
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks muaddib
It works great!

Source DV-AVI(720x576)-Target DVD 720x576 with black borders:

# -= AviSynth v2.5.5.0 script by FitCD v1.2.4 =-
AVISource("G:\Captured Video\Video 6 DV.avi")
SeparateFields()
LanczosResize(608,240,0,2,720,284).Weave()
AddBorders(56,48,56,48 )
Trim(323,4000)#.FadeOut(150)

----------------------------

viking
Reply With Quote
  #20  
10-21-2004, 06:47 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
Quote:
Originally Posted by muaddib
Yes, there is... if you look in MovieStacker (or FitCD) next to the "resize" settings, you will see a set of arrows (up and down) in the right side of the "height edit box". Those arrows will change the size of the active film pixels keeping the correct aspect ratio. That's exactly what viking wanted to do.
You're right
And I just saw that FitCD also as this setting
Me too

-kwag
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KDVD has BLACK BORDERS? Joâo Nova Video Encoding and Conversion 1 06-23-2004 10:08 AM
Encoding black borders? Eric Video Encoding and Conversion 2 12-09-2003 07:20 PM
KVCD: How to Remove black borders? raven2707 Video Encoding and Conversion 11 11-02-2003 07:14 PM
Avisynth: How to set the subs in the black borders? perrera Avisynth Scripting 13 10-19-2003 12:58 AM
KVCD: How do i get rid of black borders? Adder Video Encoding and Conversion 3 03-21-2003 10:23 AM

Thread Tools



 
All times are GMT -5. The time now is 05:41 AM  —  vBulletin © Jelsoft Enterprises Ltd