View Full Version : Adding boarders for CCE
Dirkbox
12th September 2002, 10:51
Hi
I’m Trying to convert a Divx to DVD. It’s 640*352 & 23fps it’s in two parts. The first part I have encoded fine using Tmpgenc (forgot how) it’s the second disc I have problems with.
Using Tmpgenc and using the film template or the 29fps template it come out wrong. Has interference after running pulldown (also has green at the bottom of the clip).
So I decided to use CCE (normally all I ever use for my DVDs). But running it through CCE stretches the picture as it takes out the boarder. So after searching these forums I came across this post explaining about adding boarders http://forum.doom9.org/showthread.php?s=&threadid=31588&highlight=divx+to+dvd
I then tried to work it out for myself this is what I came up with.
DivX 640*352 I want 720*480.
So looking at other calculations (352*720/640 = 396)
And to add boarders at top and bottom ( 480 – 396 = 84 /2 = 42)
I write my AVS like this:-
avisource("D:\myclip.avi"). converttoyuy2
resampleaudio(44100)
BicubicResize(720,396,0,0.75)
addborders(0,42,0,42)
I just want to know if I have worked it out correctly? It still seems a bit stretched to me. Also do I need to add ,converttoyuy2?
Hope you can help
D
brett
15th September 2002, 06:44
You need to remember that DVD's do not use square pixels like DivX. Your 640x352 movie will have an aspect ratio of 640/352 = 1.82. You can't just enlarge it by 12.5% and come up with 720x396.
DVD's are all encoded in either 4:3 or 16:9 (i.e. "Widescreen Enhanced"). When playing a 4:3 encoded movie, your DVD player chops 8 pixels off each side, cropping it to 704x480, then squeezes the picture onto your screen (basically fitting 704x480 into a 640x480 area). When playing a 16:9 encoded movie, your DVD player takes all 720x480 pixels, stretches it to a 16:9 aspect, and fits that on the screen.
You obviously need to consider this when encoding a DVD. The important thing to remember is that standard 4:3 DVD's are horizontally compressed 10%, and anamorphic 16:9 DVD's are horizontally expanded 18.5%. So, to get the appropreate numbers, for 4:3 encoding, you would use:
720/1.1/640*352 = 360 ... so resize to 720x360
For 16:9 encoding, you would use:
720*1.185/640*352 = 469.26 ... so resize to 720x469
Also, using the "sharp bicubic" resize is not really appropriate for DVD's. Just because you have a lot of bitrate doesn't mean you should be making things overly sharp. Do whatever you want, but consider:
(1) MPEG-2 is not as efficient as MPEG-4
(2) At high resolutions, softer resizing looks better
(3) On a TV, you'll never notice a difference in resize filters, but if it's a long movie, you might notice a higher quality encode by going easier on CCE with a softer filter.
(4) Even if you love sharp bicubic when scaling stuff down, sharp filters don't work as well for enlarging.
So, the AviSynth script I would use would be:
BicubicResize(720,469)
AddBorders(0,5,0,6)
Then, in CCE, make sure you select "DAR 16:9" for the aspect in Other settings.
You don't need to ConvertToYUY2, because the DivX source is already YUY2, and you're not using any filters that would force it to convert to RGB.
mb1
15th September 2002, 22:43
First of all bretts resizing for 4:3-DVD (720x360, then adding boarders) is correct.
Not correct is the 16:9 resizing.
Simply resize it to 720x480 and it is all done :)
For easy calculating one should use FitCD 1.05.
I don't want to give long explanations so I simply attached the picture of the correct resizing with FitCD (mod please validate).
brett, you forgot the ITU-R BT.604-1 ;)
And another thing: don't resize to odd values as you will loose MMX-optimized speed.
brett
16th September 2002, 10:23
I would ask you "Where are you coming up with those numbers?" but you seem to have already posted a screenshot answering that :)
I've gotta say that trying to figure out what FitCD is doing has given me a headache... Apparently some of those settings are screwed up, because 720x480 anamorphic DVD's are NOT in a 1.8228 aspect ratio.
16x9 = 1.77777... : 1 aspect ratio
PC's will resize anamorphic DVD's to 852x480 for display with square pixels, which is 1.775:1. I think standalone players just stretch the picture 18.5%, which is 1.7775:1. Regardless, whatever you use to play DVD's, anamorphic DVD's are resized to something very close to the actual ratio of 16:9.
16x9 anamorphic is certainly not 1.8228:1 as seen in the picture. That would be 16.41x9. And ITU-R 601 just refers to D1 resolution with 4:2:2 color. That's defining how you get 720x480 on a 4:3 screen, which would normally be 640x480 with square pixels.
Dirkbox is referring to a 640x352 DivX source. We must, therefore, assume that the DivX was encoded properly and has square pixels. There is no need to check the ITU-R 601 box, because this is not an ITU-R 601 video source. The only way it WOULD be an ITU-R 601 aspect source would be if the DivX was made wrong (i.e. encoded from a 4:3 DVD and resized as though the pixels were square). That button is intended to help fix a source that was not encoded properly.
Whoever makes that FitCD program has made a big mistake by having NO option for a source with square pixels. Well, maybe it's not a big mistake, but it does make the program useless when dealing with DivX sources. The "1:1 Monitor" option divides your aspect ratio by 0.9728457. That's 2.7% away from square. That has to be one of the stupidst things I've ever seen. Even if every monitor in the world does have pixels with that ratio, it doesn't matter, because everybody encodes DivX (and everything else to be displayed on a monitor) with square pixels. So no matter what it looks like (even if it is stretched by that magical 2.7%), you want to know about the actual source aspect, not the source aspect as it would appear on a monitor where pixels are stretched 2.7%.
The source is 640x352. People encode DivX with square pixels. Therefore, the source has an aspect of 640/352 = 1.82:1.
So, you've selected two options which distort your aspect ratio. You need to at least un-check the ITU-R 601 box. When you un-check it, you will see that 720x480 does not match the source aspect. The aspect is given as 1.8228, but this is again assuming you've got a monitor that stretches pixels 2.7%. They get that number by taking the actual 720x480 anamorphic aspect of 16:9 (1.775) and multiplying by 0.9728457. You will see that 720x468 is the closest match. 720x469 is the second-closest. This is because they used the PC standard of 1.775, whereas I used 1.7775 and came up with 720x469 as the closest match.
mb1
18th September 2002, 02:50
Hmmm, FitCD resizes correct.
If I deselect the ITU and set the 'round to' slider to 'no optimization' it shows value 469.
Assuming the DivX was resized correctly (regarding the ITU) then you are right not to select the ITU setting for the anamorphic conversion.
For the 4:3 resizing thing I only get your value with selecting ITU.
There is something wrong (but not with FitCD). I'll have to recheck that some time as I'm not so familiar with ntsc.
720x480 anamorphic DVD's are NOT in a 1.8228 aspect ratio.
16x9 = 1.77777... : 1 aspect ratio
But definitely they are not in 1,777:1 aspect ratio because of their nonsquare pixelform.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.