View Full Version : Playing With Aspect Ratios?
JPSiemer
9th June 2008, 08:38
Is there any way to encode a movie at, let's say, 720x480, but *force* the video to display at 720x400? I know this has to do with aspect ratio in some way, but I'm not sure how exactly to go about it...
Also, I'm not talking about chaning a setting within the player or device that is displaying the video, I'm talking about the video itself containing the necessary information and adjusting the picture accordingly. In theory, this would give me a better quality vid, while preserving the natural aspect ratio of the movie... If I'm completely wrong and this is a crazy idea please let me know!
smok3
9th June 2008, 09:32
this type of thing is called anamorphic encoding (or signaling) and it is usual (on video DVD for example), do some searching.
J_Darnley
9th June 2008, 10:15
x264 --help
--sar width:height Specify Sample Aspect Ratio
stax76
9th June 2008, 10:27
Search for:
DAR: Display Aspect Ratio
SAR: Storage Aspect Ratio
PAR: Pixel Aspect Ratio
StaxRip beta has one of the most sophisticated support for all this btw. ;)
JPSiemer
9th June 2008, 22:20
Still a little confused about the different types of Aspect Ratios... I did a little research but I couldn't get much out of it. I tried StaxRip -- it's a powerful little program, but I find it a little hard to get used to... Where do I start?! Anybody have a good guide explaining the differences and showing how to properly set these up?
stax76
9th June 2008, 23:03
In StaxRip beta if you don't add a resize filter you don't have to care as par gets signalled correctly, if you use a resize filter you don't have to care much either, it defaults a aspect ratio error threshold of 2%, if it exceeds the threshold par gets signalled, if not no signalling is required. It auto detects and adjust everything automatically. It has a assistant that don't allow doing much stupid things. Below are some guides, the topic is a little bit difficult like many encoding topics. It's discussed to death in this forum.
http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29
http://seemoredigital.net/03_Video_Only_Info/What_is_an_anamorphic_encode.html
http://www.doom9.org/index.html?/capture/par.html
http://www.doom9.org/aspectratios.htm
german: http://encodingwissen.de/spezial/itur-bt601.html
JPSiemer
10th June 2008, 02:36
Great! This is starting to make a little sense now after reading a couple articles.
But let me get this straight... StaxRip automatically adjusts the aspect, no matter what resolution I use? So in a sense, it's number one goal is preserving the aspect ratio in any way possible? Is it possible that StaxRip will screw this up or is it fool proof?
JPSiemer
10th June 2008, 02:53
Just downloaded StaxRip beta and I am so confused! I try resizing the file and it tells me I need to add a resize filter. So I add a resize filter and then I try to resize, and it keeps telling me the same thing. Plus, it defaults at 640x480 being the highest resolution? I wish I knew how to use StaxRip -- it looks like a powerful little app!!! If it were as easy to use as RipBot264 I'd be on it! Thanks for all of the information anyways... Sorry for being such a newb!
Sharc
10th June 2008, 06:49
Did you load a source?
Is the tickmark set in the filters area, for the Resize Filter?
(I can confirm that StaxRip does an excellent job regarding resizing and handling aspect ratios properly).
JPSiemer
10th June 2008, 18:28
Ya I loaded a source, but for some strange reason it looks like it isn't loading the info about my source, so I go to load a DVD source and, again, it doesn't look like it is detecting the source correctly. And yes, the tick next to the resize filter is checked. I must be doing something completely wrong, but I can't figure it out. I have followed guides suggested from the StaxRip thread, but this program just doesn't make any sense to me! Bear in mind I have no problems with MeGUI, RipBot264, Handbrake, etc.
Sharc
10th June 2008, 20:13
Strange ......
In the Filters area: Is Source MPEG-2 selected?
Can you try to load just one single vob of a title set (something like VTS_01_1.VOB).
Did you verify using the menu Tools/External Applications ..... that the required applications are installed?
stax76
10th June 2008, 22:21
Maybe there is a bug, after loading a source you can go to Help/Make Bug Report, it generates a diagnostic file which you can post using 2shared.com or mediafire.com.
Sergey A. Sablin
10th June 2008, 23:41
Search for:
DAR: Display Aspect Ratio
SAR: Storage Aspect Ratio
PAR: Pixel Aspect Ratio
StaxRip beta has one of the most sophisticated support for all this btw. ;)
in commonly used terminolgy
SAR - Sample Aspect Ratio
PAR - Picture Aspect Ratio
and DAR simply shall be a synonym for PAR, if I'm not mistaken of course.
stax76
11th June 2008, 01:44
PAR = DAR / SAR
Pixel Aspect Ratio is the same as Sample Aspect Ratio but Pixel Aspect Ratio is more common because XviD and DivX use it. The MPEG-4 standard calls it Sample Aspect Ratio but it's unpractical x264 calling it SAR as it causes confusion. Since PAR is more common it would be a waste not to use SAR for Storage Aspect Ratio in particular since there is no alternative name for Storage Aspect Ratio. Using PAR DAR SAR appears to be the most practical solution. I'm not 100% sure about all this either.
JPSiemer
11th June 2008, 03:13
PAR = DAR / SAR
Pixel Aspect Ratio is the same as Sample Aspect Ratio but Pixel Aspect Ratio is more common because XviD and DivX use it. The MPEG-4 standard calls it Sample Aspect Ratio but it's unpractical x264 calling it SAR as it causes confusion. Since PAR is more common it would be a waste not to use SAR for Storage Aspect Ratio in particular since there is no alternative name for Storage Aspect Ratio. Using PAR DAR SAR appears to be the most practical solution. I'm not 100% sure about all this either.
Wow that is the craziest thing I read all week!
Sharc
11th June 2008, 07:49
The unfortunate mess comes from the different definitions and meanings of SAR in different standards which makes a common understanding difficult.
As stax wrote, SAR = "Sample Aspect Ratio" in the mpeg-4 standard. x264 adheres to this definition. It has the same meaning as PAR "Pixel Aspect Ratio" in Xvid and Divx terminology and represents the width/hight of a pixel.
So SAR for x264 = PAR for Xvid and Divx.
Now there are other usages/definitions of the SAR:
SAR for "Storage aspect ratio" as used in Stax's formula = width/hight (pixels) of the picture, eg. 720/576 or however one crops the picture. It is sometimes also defined as FAR (Frame Aspect Ratio) to give it a separate acronym and to distinguish it from the ambiguous definitions of SAR.
There will still be other definitions and opinions I am afraid ....
smok3
11th June 2008, 09:17
a. and DAR simply shall be a synonym for PAR, if I'm not mistaken of course.
mistaken.
b. is there a practical example (application, url?) where SAR = storage aspect ratio? nm, found something:
edit:
http://www.afterdawn.com/glossary/terms/aspect_ratio.cfm
ok, so SAR could mean;
- Storage Aspect Ratio
- Signal Aspect Ratio
- Sample Aspect Ratio
- Smok3 Aspect Ratio
- Salad Aspect Ratio
very nice indeed, anything else?
c. edit2: any special reason why x264 is using SAR instead of PAR?
GodofaGap
11th June 2008, 09:53
very nice indeed, anything else?
How about Silly AR, Dumb AR and Poopy AR? :p
The only way to avoid confusion is not using abbreviations. So instead of using SAR/PAR use Sample AR or Storage AR and Picture AR or Pixel AR. However, since Storage AR is not really anything that actually exists (it is not explicitly signaled like PAR or DAR, but is just compressed frame width:frame height) perhaps the term should be avoided. It's just a short-cut at best.
Irakli
11th June 2008, 11:37
The only way to avoid confusion is not using abbreviations
Indeed. So to adress OP question, Pixel AR = Sample AR = Display AR * (height in pixels/width in pixels).
Sharc
11th June 2008, 14:44
smok3:
Why does x264 use SAR instead of PAR? Because x264 follows the definition in the mpeg-4 standard.
Most important above all is that the various tools and GUIs handle all this correctly - which for example StaxRip does well IMO for cropping, resizing, zooming, anamorphic and non-anamorphic sources, for x264 as well as for Xvid and Divx.
stax76
11th June 2008, 16:13
It was reported however 704x576 and 720x576 have the same PAR, StaxRip as well as MeGUI assume the same DAR for any width calculating the PAR with it, this is a bug. I'll fix this calculating the PAR from this table (http://lipas.uwasa.fi/~f76998/video/conversion/).
Brother John
11th June 2008, 16:16
For all practical purposes there’s three well known acronyms:
PAR - Pixel Aspect Ratio - Defines the shape (width:height relation) of a single pixel.
DAR - Display Aspect Ratio - Defines the shape of the picture. Or something... It’s not clearly defined what is meant by »picture«.
SAR - Sample Aspect Ratio - synonym for PAR.
Everything else is bound to create confusion and misunderstanding.
Actually SAR is only used in the MPEG-4 AVC document. MPEG-4 Visual calls it PAR. The reason for the difference is that technically you can make a distinction between a pixel and a sample. Maybe »sample« is more correct under the circumstances and that’s why they chose not to use the well known PAR acronym. For all practical purposes the difference is irrelevant though, so PAR and SAR are identical.
As for calculations: *Never* calculate a PAR from a DAR. PARs are not calculated, they are fixed, pre-defined values associated with the source material. That’s why you shoud not use formulas like
Pixel AR = Sample AR = Display AR * (height in pixels/width in pixels)
It should always be
DAR = PAR * width / height
You may do the unspeakable ;) if you really, really know what you’re doing. If you haven’t read and completely understood the consequences of ITU-R BT.601 you probably don’t.
stax76
11th June 2008, 16:38
Unfortunately StaxRip needs a three letter abreviation for Storage Aspect Ratio because the full name does not fit.
http://img389.imageshack.us/img389/4880/greenshot20080611173554ld9.th.png (http://img389.imageshack.us/my.php?image=greenshot20080611173554ld9.png)
Brother John
11th June 2008, 17:41
Oh, haven’t realized that. Don’t do it! This guarantees massive confusion! x264 fixed the meaning of SAR to Sample AR. It’s a really bad idea to use it for anything else.
Imo the only (mildly) relevant DAR value is "final playback-time width:height ratio of the complete video frame". People who do not crop should be aware of the consequences.
stax76
11th June 2008, 17:49
I have no other idea to use 'AR' then instead.
Sharc
11th June 2008, 18:17
I don't want to add to the confusion - but why not to use FAR (Frame Aspect Ratio) for the width:hight of the cropped picture? (in currrent beta it's called SAR which is misleading).
stax76
11th June 2008, 18:31
You don't have the latest beta then ;), I've named it AR for now, FAR sounds good too, suggestions are welcome.
Sharc
11th June 2008, 18:59
Oh sorry, I missed that. It's fine for me as is now :)
smok3
11th June 2008, 20:31
stax: i would just use DAR which changes when cropping is applied (nuke SAR).
Brother John
12th June 2008, 00:53
OK, you really seem to have made up your mind that showing two DAR values is indeed necessary.
Let’s look at the possibilities, what a DAR can actually be. (Example: 720×576 16:9 PAL with a ~2.35 movie inside.)
(1) AR of the whole frame as stored in the file (720/576).
(2) AR of the frame as stored in the file, but excluding black bars (~720/432).
(3) AR of the whole frame at playback = after PAR correction (~1047/576).
(4) AR of the frame at playback and excluding black bars (~1047/432).
For traditional encodings all this is academic because you always crop and resize to square pixels => all DAR definitions become the same. That leaves non-square encodings. And let’s assume cropping is still the usual way to do things. That leaves us with (1) and (3).
Hm ... no. Justifying two DAR’s doesn’t work this way. Why should I be interested in the DAR as stored in the file (1)? AR correction will happen on playback anyway so the only remaining interesting value is (3).
Well, assume we don’t crop and black bars are indeed present. For (1) and (2) the question still stands: Why would I be interested in them? Showing (3) and (4) ist ok though. SeeMoreDigital coined the nice and clear term MAR = Movie Aspect Ratio for (4).
The downside: You’d be forced to run an autocrop pass even if the user has disabled all cropping because you need it to get the numbers. Also, is keeping bars really such a relevant scenario?
All in all I don’t see the point in showing two DARs. But if you do, I suggest using (3) as »DAR« and (4) as »MAR«. Nice would be a tooltip with a short explanation of what the acronyms express.
SeeMoreDigital
12th June 2008, 09:18
You don't have the latest beta then ;), I've named it AR for now, FAR sounds good too, suggestions are welcome.Frame Aspect Ratio (FAR) suggests that a "ratio" value be involved. Ratio values should be expressed as a "fraction" or as a "decimal", ie: using one term of reference.
If I read your GUI correctly, you are encouraging people to enter the "pixel width" and "pixel height" of their proposed encodes separately, ie: using two terms of reference.
Hope that makes sense...
stax76
12th June 2008, 10:23
Might indeed be least confusing showing just PAR and DAR, I've changed the beta accordingly and fixed all known aspect ratio related bugs.
Sharc
12th June 2008, 17:45
A minor issue:
When doing an anamorphic resize (Ctrl+Slider) the toggle key A in the preview does not stretch the picture correctly. It's best seen when allowing the slider to go up to 1280 max. width.
stax76
13th June 2008, 10:40
When doing an anamorphic resize (Ctrl+Slider) the toggle key A in the preview does not stretch the picture correctly. It's best seen when allowing the slider to go up to 1280 max.
The tooltip (I just corrected) says:
Toggles between target display aspect ratio and target storage aspect ratio.
This appears to work regardless if you encode anamorphic or not.
Other changes I made:
Hide error if no resize filter is active
If resize filter is active target DAR display shows target storage aspect ratio
If no resize filter is active target DAR display shows movie aspect ratio
Main dialog shows PAR only if it gets actually signalled to the encoder, otherwise it shows n/a
Sharc
13th June 2008, 19:22
Toggles between target display aspect ratio and target storage aspect ratio.
This appears to work regardless if you encode anamorphic or not.
Yes, unless you enlarge the original picture anamorphically. Set the slider width max. value to 1280 for example (using Event Commands....). Then both views remain anamorphic when toggling.
May be I miss something?
stax76
13th June 2008, 21:33
@Sharc
I could reproduce it if the window is not in fullscreen mode and if the window size exceeds the screen bounds. Windows don't allow this and reduces the window size. What I've done now is the same as in the crop window, if it's too big it'll get reduced by half. Hope it's OK now.
Sharc
13th June 2008, 22:37
Oh I see. That was tricky. I didn't even think about trying in full screen mode, but now it's perfect. :)
JPSiemer
16th June 2008, 04:04
I believe MeGUI does do what I was asking (or something similar). For instance, If I encode a 720P movie down to both 720x480 and 720x400, I get two files that are proportioned the same! This is exactly what I was asking for and I had no idea MeGUI does it... I'm guessing MeGUI doesn't let you screw up on aspects either...
Sharc
16th June 2008, 06:15
If you want to resize anamorphic you need to press the Ctrl key when moving the resize slider in StaxRip. See tooltip.
I works fine.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.