Log in

View Full Version : Widescreen resolution adjusting


canuckerfan
17th May 2007, 05:16
I have a dvd movie that has a huge black trim on the right side. if I crop it 16 from the right and make it 704 x 480 [within the DVD specs] (original is 720 x 480) will the AR mess up... I ask this because it's 16:9 and this will resize it to 854 x 480 during playback. but since the horizontal length has been chopped by 16 pixels, will the resizing to 854 make things appear ever-so-slightly "chubby"? I checked some other threads, but wasn't able to piece together an answer. thanks.

techreactor
17th May 2007, 07:03
Use paranoia (http://sourceforge.net/projects/paranoia-) as a tool to help you out in precise resizing and scripts without getting into the mathematics yourself. It also gives you the PAR/DAR information.

Brother John
17th May 2007, 12:12
will the resizing to 854 make things appear ever-so-slightly "chubby"?
No, it won't. PAR for NTSC 16:9 is 40/33, which means 704*40/33=853,333. If you work with PAR you never need to worry about cropping, because cropping doesn't change the PAR.

canuckerfan
17th May 2007, 15:31
I see... that makes sense. however, what about a width of 720? wouldn't that become 872.73?

Brother John
17th May 2007, 15:42
Exactly.

FYI: The world of PARs:
PAR according to ITU-R BT.601
PAL NTSC
4:3 128/117 4320/4739
16:9 512/351 5760/4739

PAR according to MPEG-4 (almost the same as ITU)
PAL NTSC
4:3 12/11 10/11
16:9 16/11 40/33

Generic PAR
PAL NTSC
4:3 16/15 9/10
16:9 64/45 6/5
Don't ask which of those is the correct one, because there's no clear answer. Use search to find all those long, convoluted and often flamy discussions about the topic. Most encoding apps (like Gordian Knot, AutoGK, StaxRip etc.) use MPEG-4 PAR by default.

canuckerfan
18th May 2007, 02:30
i see. so as long as the par is the same (I wouldn't know a way to change it), the aspect ratio is maintained for both a picture of width 720 and a picture that has been cropped to 704 from 720. and here I was thinking that widescreen ALWAYS has a width of 854 because that's what it seems like, at least on a computer monitor.

Brother John
18th May 2007, 12:10
so as long as the par is the same (I wouldn't know a way to change it)
Resize. :)
When you go from 704x480 to 854x480 you change the PAR from 40/33 to 1/1. In other words you convert rectangular pixels into square pixels.

canuckerfan
22nd May 2007, 22:51
^hmm... I see. so just to confirm... with a 16:9 flag... the following resizing occurs (assuming a PAR of 40/33 before the resize)

720x480 to 872x480
704x480 to 854x480

also assuming that this resizing happens both on a computer and a SAP.

oh and since I just make my avisynth scripts and feed it directly into CCE, would that be using the MPEG-4 PAR?

edit: I did some tests and I guess a better setup would be like the following... I have a video clip with the following specs:

SAR 1.500 (3:2)
PAR 1.185 (32:27)
DAR 1.778 (16:9)

(unusual PAR with respect to a couple posts above)

so I decided to crop and resize to 704x480, by just using simply... Crop(0,0,-16,-0).LanczosResize(704,480) and I got these specifications for the encoded clip:

SAR 1.467 (22:15)
PAR 1.212 (~17:14)
DAR 1.778 (16:9)

so according to these figures clips of both 720 and 704 will be resized to ~853. thus, changing the AR for the 704 clip by a very small fraction. I hope i've made sense, and I'm curious to know if there is any way of nullifying this small error in AR while still being able to crop + resize to 704?

ronnylov
23rd May 2007, 09:48
You are ncoding a 16:9 DVD with 704x480 NTSC resolution, right?

Then you can not change the PAR because DVD specification has a fixed PAR of 5760/4739 for that format (if it follows ITU-R BT.601). What you can do is following:

Crop some pixels on the right side and add the same amount of black border on the left side (if you want to move the picture from right to left to put it in the center) and keep it at 720x480 resolution. DVD specification use the same PAR for both 704x480 and 720x480 resolution so you won't see any difference if you just crop it to 704x480. When you convert from 720x480 DVD to 704X480 DVD then just crop pixels on the sides, do not do any resizing.

So you can crop 16 pixels on the right side and add 8 pixels black border on the left side to make it 704x480 if you want it to be 704x480 NTSC DVD.

This is only if we assume that the PAR of the original DVD was correct. If you think it need to be expanded horisontally then you can do as you suggested crop and resize up to a larger width than the original.

Brother John
23rd May 2007, 12:47
the following resizing occurs (assuming a PAR of 40/33 before the resize)

720x480 to 872x480
704x480 to 854x480

also assuming that this resizing happens both on a computer and a SAP.
If we forget the ITU/generic issue for a moment, then yes, this is what happens when you playback the DVD. (Software DVD players usually don’t use ITU PAR.)

since I just make my avisynth scripts and feed it directly into CCE, would that be using the MPEG-4 PAR?
AviSynth doesn't handle AR info at all. Typically you input a DVD frame (720×576, 704×480 etc.) via MPEG2Source. AR info gets lost at this point. AviSynth only looks at the physical frame size and handles all video as if it was PAR 1:1. You’ll have to keep track of PAR/DAR changes yourself and then set the appropriate value in whatever application receives the AviSynth output stream. I’m not familiar with CCE or DVD creation, so I can’t tell you where and how exactly to put you AR info.

It is possible – though a little tricky – to convert any resolution/PAR combination to a valid DVD resolution/PAR combination. A good knowledge of how PARs work (and ITU if you want to use it) is necessary though. I’ve written about this in some length. Maybe the Yahoo translation (http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http%3A%2F%2Fencodingwissen.brother-john.net%2Fspezial%2Fitur-bt601.html&lp=de_en&btnTrUrl=Translate) isn’t too cryptic. I hardly know any really good English resources apart from Jukka Aho’s great (but at first extremely frustrating) Quick Guide (http://www.iki.fi/znark/video/conversion/).

Concerning you unusual PAR example: Did you calculate the PAR somehow? If yes, how? If no, where did you get it from? What’s the source resolution of this video? Then I could put together an example of how to convert this thing to DVD.

canuckerfan
23rd May 2007, 20:54
^the source resolution of the DVD is 720x480. but it contains a black trim on the right side (probably because of overscanning). i originally wanted to get rid of the trim and resize to 704x480. however, once I discovered about widescreen resizing, I was curious if this method of cropping and resizing still maintained the AR once the 16:9 flag kicked in, since a 704 width resized to 854 will be different with respect to AR than a 720 width clip resized to 854 (which is what is happening when I encode the clip). I got the information by dropping the clips into Gspot. my project is basically a dvd to dvd backup. and with respect to crop + resizing, I used Crop(0,0,-16,-0).LanczosResize(704,480) with the source clip.

wonkey_monkey
23rd May 2007, 23:57
my project is basically a dvd to dvd backup

I may be wrong, but I think you would be better off leaving the video uncropped - I'm assuming you have to re-encode, otherwise you'd just make a direct copy of the disc.

If you leave the video uncropped, the encoder's macroblocks will line up with the original macroblocks, and encoding might be a little bit more efficient. If you crop it, the old and new macroblocks won't overlap.

[quote]I used Crop(0,0,-16,-0).LanczosResize(704,480) with the source clip.[quote]

Isn't the video already 704x480 immediately after cropping? The LanczosResize seems superfluous...

David

Brother John
24th May 2007, 00:29
^the source resolution of the DVD is 720x480.
PAR 32:27 on a DVD doesn't exist. Your source is NTSC 16:9 using the standard PAR from one of the tables above. All you have to do is crop 16 pixel from the right, re-encode and produce a new standard NTSC 16:9 DVD. No PAR calculations necessary at all.

since a 704 width resized to 854 will be different with respect to AR than a 720 width clip resized to 854 (which is what is happening when I encode the clip)
But 704 and 720 won't both be resized to 854. If that happens, something goes wrong in the non-AviSynth part of your workflow.

The LanczosResize seems superfluous
It is. But if input and output resolutions match AviSynth's internal resizers simply leave the video alone. I tried it once and the output indeed is bit identical. So no harm done if you "resize" a 704x480 (after cropping) clip to 704x480.

canuckerfan
24th May 2007, 07:54
well, both 704 and 720 clips seem to be resized to 854 upon playback in MPC. not sure what I could be doing wrong. perhaps it is my encoder setup.

as for the weird DVD PAR, I'm baffled as to why it shows 1.185. I just drop the VOB files into Gspot and that's what it shows... at least for 720 width.

scorpdt
24th May 2007, 17:42
This should be a good reading you clear you up.
http://www.doom9.org/index.html?/aspectratios.htm

Leak
24th May 2007, 17:46
This should be a good reading you clear you up.
http://www.doom9.org/index.html?/aspectratios.htm
That link leads straight to the front page - I guess the site considers this link hotlinking...

np: Kettel - Bodpa (Re: Through Friendly Waters)

scorpdt
24th May 2007, 18:02
Nope .... it should load the aspectratios.htm page .... else try this http://www.doom9.org/aspectratios.htm .... works on my end.

wonkey_monkey
24th May 2007, 22:18
I think you need Javascript enabled, and you have to wait for the page to finish loading - I've always thought it was an odd (and slow) way to get you to your page, but I assume there's a reason...

David

canuckerfan
25th May 2007, 01:11
yea, i've read through that page a couple times. i'll go through it again. however, i'm still a little puzzled by the questions in my above post...

scorpdt
25th May 2007, 05:09
try this out .... I am with David on not having to crop if you are just converting your DVD-9 to DVD-5 .... if you must crop for whatever reason, then AddBorders to bring it back to 720x480.

Try this simple script
bob() #optional ... I prefer progressive clip
a = last
b = last.crop(0,0,-16,0)
a = a.BilinearResize(852,480) # playback actual size for 16:9
b = b.BilinearResize(852,480)
Overlay(a, b, mode="Difference")

If you see anything else other than grey .... then the clip b picture aspect ratio has change .... a circle is no longer round in this case.

IanB
25th May 2007, 06:01
The 704 - 720 thing is to do with the 8 pixel border on each side from the DVD spec. 720 is the total width. 704 is the notional active picture area within a TV scan line. Together with the NTSC 486 active scan line thingy, your 4:3 image is notionally 704x486.

If you delve into the spec the 704 pixels occupy the active 52us of 64us of picture line. The extra 16 pixels makes it cheaper to build DVD players, likewise the missing 6 lines.

:search: it's all been discussed before.

canuckerfan
29th May 2007, 02:04
I think I understand it now. basically, no point in resizing from 720 to 704. instead, I should even the black trim on both sides. and due to overscanning, they won't be seen anyones. but, one question, is overscanning present in modern HD TV sets?

canuckerfan
30th May 2007, 22:48
i did some searching and learnt that even the newer HD sets have some sort of overscanning. thanks everyone for their input:)

canuckerfan
4th June 2007, 23:02
But 704 and 720 won't both be resized to 854. If that happens, something goes wrong in the non-AviSynth part of your workflow.

Really? Curious to know what 704 should be resized to then? 853 minus 16?

foxyshadis
5th June 2007, 07:08
Don't confuse yourself, just refer back to posts 2 & 3. =p That's still correct for 704, just not 720. (You can always add as much black padding on each side as you want, if you're worried about overscan, that part is outside of the AR calculation. The player should take care of all of that though.)