Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd October 2005, 22:02   #1  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
Letterboxing 16:9 clips for DVD compilation

I am trying to create a compilation of several different clips into one DVD. Most of the clips are 4:3 AR but a few are 16:9 (NTSC). My understanding is that there is no way to mix different ARs in a single DVD, so what I would like to do is to add letterboxing to the 16:9 clips so they display as 4:3 clips only with black borders at the top & bottom.

I've never done anything like this before, and all the posts I reviewed didn't seem to hit the nail-on-the-head. Any ideas, and thanks in advance.
MuttLover is offline   Reply With Quote
Old 3rd October 2005, 22:37   #2  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
There is no problem to use different AR on one DVD.
You have to use different VTS for different AR.
bigotti5 is offline   Reply With Quote
Old 3rd October 2005, 23:18   #3  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
TMPGENC DVD author kicks it out. All I've read is that the AR is set from the main .IFO file. Which leads me back to the original question, how to convert a 16:9 clip to 4:3 by adding borders?
MuttLover is offline   Reply With Quote
Old 4th October 2005, 01:14   #4  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Via avisynth? The Letterbox() function, just resize to whatever horizontal resolution you need and then apply letterbox to fill in the vertical. I'd try to figure out how to use both, but, it is simpler to letterbox than fighting tmpgenc. =p
foxyshadis is offline   Reply With Quote
Old 4th October 2005, 01:29   #5  |  Link
movax
Member
 
Join Date: Nov 2004
Location: Michigan
Posts: 217
Quote:
Originally Posted by bigotti5
There is no problem to use different AR on one DVD.
You have to use different VTS for different AR.
Yep, using somethign like DVDLab will make multiple VTS and VMG simple to work with.
movax is offline   Reply With Quote
Old 4th October 2005, 03:04   #6  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
OK, we are dealing with 16:9 input, wanting a 4:3 letterboxed output. This seems to me to need a resize and addition of top/bottom "nothingness" in order to become a letterboxed 16:9 encoded as 4:3.

Letterbox in the avisynth manual states
"
Letterbox(clip clip, int top, int bottom [, int x1] [, int x2] [, int color])

Letterbox simply blocks out the upper top and lower bottom scanlines of each frame, and / or optionally blocking out the left (x1) and right (x2) portions for HDTV letterboxing, and using black by default or specifying an optional color. This has a couple of uses: one, it can eliminate stray video noise from the existing black bands in an image that's already letterboxed; two, it can eliminate the garbage lines that often appear at the bottom of the frame in captures from VHS tape.

The functionality of Letterbox can be duplicated with a combination of Crop and AddBorders, but Letterbox is faster and easier.

Generally, it's better to crop this stuff off using Crop or CropBottom than to hide it with Letterbox. However, in some cases, particularly if you're compressing to MPEG, it's better to use Letterbox because it lets you keep a standard frame size like 352x288 or 320x240. Some MPEG players get confused when the source video has a strange frame size.

The color parameter is optional, default=0 <black>, and is specified as an RGB value regardless of whether the clip format is RGB or YUV based.

Another use could also be to clear out overscan areas in VCD or SVCD encodings. "


So what would be the parameters? I am a newbie to this stuff but I figure a definitive answer would help a lot of folks wanting to do the same thing. I know you brilliant minds are out there and I wouldn't be able to post such a question if you weren't, I'm looking for an avisynth resize(?, ?) and addborders(?, ?, ?, ?) I think
MuttLover is offline   Reply With Quote
Old 4th October 2005, 03:15   #7  |  Link
mgh
Registered User
 
Join Date: Oct 2004
Location: India
Posts: 321
Use FitCD from
http://www.sysh.de/
or any other aspect ratio calculator
__________________
A shut mouth gathers no foot
mgh is offline   Reply With Quote
Old 4th October 2005, 09:46   #8  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Using non-ITU values:
(1) 720x576 at 16x9 plays back at 16/9*576 x 576 = 1024x576.
(2) 720x576 at 4x3 plays back at 4/3*576 x 576 = 768x576.

To fit (1) into (2) you should scale 1024x576 to 768x432 and add black borders to get 768x576.

So, what you should do is resize 720x576 to 720x432 and add black borders to get 720x576.
Wilbert is offline   Reply With Quote
Old 4th October 2005, 12:05   #9  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
Thanks Wilbert for the reply. Question: What is an ITU value? I don't know what the term is.

Secondly, I'm in NTSC land so changing the values I come up with:
(1) 720 x 480 at 16x9 = 16/9*480 x 480 = 853 x 480
(2) 720 x 480 at 4x3 = 4/3*480 x 480 = 640 x 480

To fit 1 into 2, scale 853x480 to 640x??? (where does 432 come from? would this be the same for NTSC?) ... and add black borders to get to 640 x 480....

Am I on the right track? Any help with the ??? value will be appreciated.

MuttLover is offline   Reply With Quote
Old 4th October 2005, 12:25   #10  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
@ MuttLover

By saying non-ITU Wilbert means shurely a 720 width source at a genric par which equals in its width-image-information to 702.

Here is a nice PDF which explains beside other things ITU respected PAR and
generic PAR: http://www.arachnotron.nl/videocap/d..._cap_v1_en.pdf

Generally if ITU was respected when generating the 720, then you cant just obtain the final de-anamorphing of the 720x576 by just taking 576*(16/9).

Final DARs only can be obtained if the sources PAR is taken into account when doing conversations.
So a PAL 720x576 Stream gots a PAR of (128/117) ... this PAR is PAL in this example. Reference: http://www.uwasa.fi/~f76998/video/co...nversion_table
(nice complex stuff isn't it )
Lets desqueeze now that 720 to PAR 1/1 = 720*(128/117) = 787,692
The result would be 787,692x576 which results in a real dar of 787,692/576 = 1,368
So as you see 720x576 is NOT 4:3
But that one was non-anamorphic (1,368)

Now lets do desqueeze that result to its final non-anamorph state:
787,692 / 0,75 =1050,256

So if you want to end up in PAR 1:1 of an anamoprh 720x576 stream the result would be: 1050x576 ... but this is not MOD16 so 1040x576 would be a nice compromise without resizing the height. But as we did reduce the final width to 1040 we have to compensate that using a cropping of the sources width before:
The diff. factor = 1040/1050,256 = 0,99
720 * 0,99 = 712 (mod2)

So we can crop the 720x576 source to 712x576 and resize it to PAR 1:1 1040x576 ... voilá

IF you will end up in a NERO (is it cinema profile?) compatible 1024x576 then
The diff. factor = 1024/1050,256 = 0,975
720 * 0,974 = 702!

So for NERO cinema profile we should crop the 720x576 DVD source to 702x576 and resize it to PAR 1:1 1024x576 via Avisynth.

Last edited by Inc; 4th October 2005 at 12:41.
Inc is offline   Reply With Quote
Old 4th October 2005, 12:27   #11  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
432 = 768/1024*576

It was played back at 1024x576, or resizing horizontally and vertically by a same amount 768x432.

Likewise ??? = 640/853*480 = 360

Quote:
Thanks Wilbert for the reply. Question: What is an ITU value? I don't know what the term is.
That's a difficult story, and not important at the moment. It will only confuse you more

edit: thanks incredible
Wilbert is offline   Reply With Quote
Old 4th October 2005, 12:53   #12  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
And for avoiding a headache in MuttLover's head he can try this one:
http://home.arcor.de/packshot/SizeMe_0.07b.exe

Here's an examplescreen of how an anamorph 720x576 DVD (d2v) Source with 720x432 active pixels would end up in a suggested calculated result when mpeg4 non-anamorph is the target.



So you can just switch the ITU checkbox on and off to see the difference when generic PAR would have been used on the 720 source.

This is still beta-state, so I do appreciate beta-testings.
Final Name maybe will be "PARanoia" or "TMade" as SizeMe is already used by a brazilian Bitratecalculator at www.vmesquita.com
In mpeg4 target mode you can change to the desired final imagesize using the "Resize"-height-spin-gadget up'n down button.

@ Cracks: The "Target" Infoframe-part in this mpeg4-target example shows wrong target Mhz and µs values.
Correct would be 77,037us @ 14,673Mhz, but these have in mpeg4 target mode no influence on the internal calcs.

Last edited by Inc; 4th October 2005 at 13:13.
Inc is offline   Reply With Quote
Old 4th October 2005, 13:11   #13  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
Thanks for the responses. That's enough information to get to a script that includes:

LanczosResize(640,360)
addborders(0,60, 0, 60)

@incredible: I see how you got your nickname
I'll need lots of coffee and more free time to get through that but thank-you for the info. Thanks also for the link to the program, I'll check it out when I get home from work.

@wilbert: Thanks for all your help. I appreciate it.
MuttLover is offline   Reply With Quote
Old 4th October 2005, 13:22   #14  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
Thanks, but the name "Incredible" was a fast quick'n dirty decision 3 Years ago at videohelp.com. So "Inc" would be nicer

LanczosResize(640,360)
addborders(0,60, 0, 60)

This is when obtaining the final non-anamoprh Image size by squeezing the height and not expanding the width. In the Appl. above the primary suggestion uses -in mpeg4 mode- a width-expanding as it would be also be done one a 16:9 TV set for instance. And as a common PC Screen resolution is at least 1024x576 then this makes sense imho.
But as said, you easely can reduce the whole framesize by decreasing the final height (via spin buttons).
Inc is offline   Reply With Quote
Old 5th October 2005, 20:04   #15  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
A little fix in the wording of "Settings" -> "Non-ITU" :
"Fix generic par by factor 720->702"
"Fix generic par by factor 720->704"
is more logical imho.

http://home.arcor.de/packshot/PARanoia_0.08b.exe
Inc is offline   Reply With Quote
Old 6th October 2005, 20:12   #16  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
A Fix where in NTSC Target Mode the final resulted height didnt match the 480 when borders needed to be added like when overscanning etc.

http://home.arcor.de/packshot/PARanoia_0.09b.exe
Inc is offline   Reply With Quote
Old 6th October 2005, 22:20   #17  |  Link
LogicDeLuxe
Registered User
 
LogicDeLuxe's Avatar
 
Join Date: Nov 2004
Posts: 106
Quote:
Originally Posted by MuttLover
LanczosResize(640,360)
addborders(0,60, 0, 60)
You should not resize to 640 for DVD. When converting anamorph to letterbox, just keep the width at 720 (which is the only valid value for anamorphic streams on DVD).
For your NTSC video, you would use
LanczosResize(720,360)
addborders(0,60, 0, 60)
__________________
AMD Ryzen 5, 16 GM RAM, Nvidia GTX 1060, Linux Mint
LogicDeLuxe is offline   Reply With Quote
Old 7th October 2005, 00:55   #18  |  Link
Kika
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 819
Quote:
(which is the only valid value for anamorphic streams on DVD).
That's wrong. 704x576 and 704x480 are also valid resolutions for anamorphic DVDs. And these two resolutions are the only correct resolutions, if you have a "clean" Source with a correct AR. You can expand them to 720x576/480 by adding black borders, but resizing to 720 is always - in any case(!) - a bad idea. That's because 720 is an Overscan-Format.
Kika is offline   Reply With Quote
Old 7th October 2005, 14:09   #19  |  Link
colinb
Registered User
 
Join Date: Jun 2003
Posts: 72
But why do you need to do all this? You really *can* have different aspect ratio's (4:3 and 16:9) and different widths (720 and 704) and different audio formats (AC3 and PCM) on the SAME DVD disk.

I have not used DVD author but have read that you can add each clip as a separate VTS (title track). A VTS can only contain titles of the same format, adding each clip into its own VTS (as DVD Author appears to do) would get around the problem.

In DVD Lab Pro (trialware) you can create extra VTS's at will. So if you have a collection of clips some of which are 4:3 and others 16:9 then you can add all of the 4:3 clips into the default VTS, then create a new VTS and add all of the 16:9 clips into that. (Just beware that all of the clips in a VTS have the same audio format)

It sounds like DVD Author might be easier to use if you can find out how to add the clips as separate title tracks - I thought this was its default operation.

You'd be much better doing that than faffing about downsizing perfectly good 16:9 to 4:3 letterboxed.
colinb is offline   Reply With Quote
Old 7th October 2005, 21:34   #20  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
Absolutely true, but...as this is a learning process I have learned about resizing in avisynth, and learned that my concept regarding mixed aspect ratios in a DVD were incorrect. The script worked fine, btw but I do indeed plan to re-author with a more sophisticated tool. Thanks for your comments! This video stuff is pretty fascinating to me.
MuttLover is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.