If a 16:9 Widescreen has a Pixel Display Ratio of 1.2121:1 then what is the Pixel Display Ratio for a None 4:3 Widescreen?
+ Reply to Thread
Results 1 to 30 of 55
-
-
16:9 widescreen only has a pixel aspect ratio of 40:33 (1.2121...) if the frame size is 704x480. What's a "Pixel Display Ratio"? If you're asking what's the pixel aspect ratio for a 704x480 frame of 4:3 display aspect ratio video -- it's 10:11 (0.9090...).
-
-
Any resolution, display aspect ratio and pixel aspect ratio are related in this general formula: PAR x SAR = DAR
Last edited by Ennio; 18th Jun 2021 at 03:27.
-
No not any resolution, A resolution has to be defined to set the PAR, let's say we have 1440x1080 the PAR (Pixel Aspect Ratio) will be 1:1 or square pixel, If I have 720x480 the PAR will be 8:9 non square, For the example that Jagabo gave above 704x480 the PAR is 10:11, Assuming a 4:3 DAR (Display Aspect Ratio) for all cases according to what the OP is asking for, So no not any resolution.
Your link is dead.Last edited by dellsam34; 20th Jun 2021 at 18:35.
-
This is the link:
https://forum.selur.net/Thread-INFO-About-pixel-aspect-ratios--597
It's hard to know exactly what the OP is asking, there's no context to the question at all -
Those followed remarks bring into focus the need to no longer use the "SAR" shortcut crutch.
The true, universal formula, which works in ALL cases - including those requiring transformation to different sizes or ARs - is:
Code:DAR = Horiz rez / Vert rez * PAR
This formula satisfies dellsam34's resolution variability requirements, and holds true for all the formulae discussed in Selur's threads.
The OP is expecting specific answers to a generality question with an unspoken agenda. Jagabo's answer was probably the best attempt to get to the heart of the spirit of the question, but knowing the OP's history, it might never be sufficient.
Scott -
The equation can't be wrong, it is the definition of the system. Just because some commercial systems limit frames to particular dimensions and display aspect ratios (and hence pixel aspect ratios) doesn't invalidate the equation. They all follow the equation. But in theory, any display aspect ratio can be produced from any frame dimensions given the correct pixel aspect ratio -- as defined by the equation.
Last edited by jagabo; 20th Jun 2021 at 21:18.
-
The question is not wrong, it is just not specific. It's like studying the caracteristics of a fluid where we have a general formula defined by pressure P, temperature T and volume V PV=nRT, We know the fluid behaviour based on the general formula but unless we know exactly what fluid is (oil, water ...) there is going to be no specific numbers of P, T or V. I know it's a weird analogy but that's what I was trying to explain in my earlier post.
-
Hi,
This equation above is very informative and explains many complex things. However, I recently read on the Internet:
Imported images always stay at their original size. Therefore, you may need to scale your pictures before importing them.
For resizing your picture to fit the project size you can use Imagemagick
Example:
Code:convert inputfile.jpg -resize 720x576 outputfile.jpg
Code:new horizontal size=(5 / 4) / (4 / 3) x original horizontal size
Could you, please, explain how the 2-nd second formula (equation) is formed ?
I don't understand why we divide (5 / 4) by (4 / 3) and why we multiply it by original horizontal size ...
Of, course, I understand that 5:4 is Horiz rez / Vert rez for 720x576, 4:3 is DAR for 720x576... -
I think this may make it much clearer, and tie it into those other formulas...
Code:DAR = Horiz rez / Vert rez * PAR
Call Original image = #1, Final/resized image = #2
DAR1 = Horiz rez1 / Vert rez1 * PAR1
and
DAR2 = Horiz rez2 / Vert rez2 * PAR2
So if you know something that is common, you can substitute ("plug it in").
Let's say, we are keeping the same DAR of 16:9 (aka 1.77777).
1.77777 = Horiz rez1 / Vert rez1 * PAR1
and
1.77777 = Horiz rez2 / Vert rez2 * PAR2
So,
Horiz rez1 / Vert rez1 * PAR1 = Horiz rez2 / Vert rez2 * PAR2
You can plug in your existing info (since you should already have that), and then solve for the remaining unknown(s).
704 / 480 * 1.2121212121 = 1920 / 1080 * PAR2
or
704 / 480 * 1.2121212121 * 1080 / 1920 = PAR2
PAR2 = 1
So par2 is square pixels. Duh.
Not going to comment too much on your example script except to say that they use the number ratio 5/4 in there. That 5/4 comes from using that shortcut "storage AR", which number is a roundabout way of saying this ratio is the shape it would look like if you showed it using only square pixels. Which if you are doing things correctly you are not supposed to do.
But that shortcut ends up making you have to reincorporate those resolution figures anyway, so it's just a convoluted and frankly non-versatile (ok, stupid) way of calculating. And it only covers certain specific use case combinations. Whereas the way I just showed you will work properly in ANY situation.
Scott -
The formula is wrong. You need to divide the original horizontal size by 0.9375, not to multiply.
original horizontal size / ((5/4) / (4/3)) = (original horizontal size / (5/4)) * (4/3)
original horizontal size / (5/4) makes a square from the original frame using storage aspect ratio: 720 / (5/4) = 576 (At this point your pixels are square.)
Then you make a 4x3 rectangle from the square, assuming square pixels: 576 * (4/3) = 768
Clearly, this can be calculated from the vertical size directly using the required proportions, 4:3 or 16:9. For example, a widescreen 576-line video would be 576 * (16/9) = 1024 pixels wide. -
@Bwaak, please cite us one definitive, authoritative, official engineering document (e.g. ITU/CCIR, SMPTE, NAB, MPEG, NTSC/ATSC, PAL, SECAM, DGA, DCI, etc) that actually specifically mentions "storage aspect ratio" by name (obviously not counting Pixel, Sample, Display & Frame ARs here).
It doesn't exist.
You brought in another example of Wikipedia getting it wrong, unfortunately because it is often crowdsourced by non-experts.
Scott -
"storage aspect ratio" is still in use here and there. It means the ratio of the physical file resolution.
To quote the site:
Storage aspect ratio (SAR): the dimensions of the video frame, expressed as a ratio. For a 576i video, this is 5:4 (720×576). -
I don't think this is exactly what you are looking for, but here is a document on a reputable website that mentions the specific keywords:
Originally Posted by EBU: TECH 3390 - EBU-TT, PART M METADATA DEFINITIONS
Originally Posted by Apple: MPEG-2 preset in Compressor -
Unfortunately, I don't understand how this equation applies to importing images. This looks more like a meaningless coincidence 1.77=1.77 (AFAIU, of course IMBW).
Please make an example as in the article I quoted.
One more question, how your equation can be used if we add 4:3 footage to a 16:9 anamorphic project and vice versa: a standard 4:3 footage to 16:9 anamorphic project ?
As far as I understand, we have to do scaling and we need to find coefficients..
so it's just a convoluted and frankly non-versatile (ok, stupid) way of calculating. And it only covers certain specific use case combinations.
I just want to understand how it all works.
Do you agree with the statement from Bwaak that this formula is wrong and we need to divide the original horizontal size by 0.9375, not to multiply ?
If we add images to 720x576 project, we need W_orig multiply by 0.9375 afaiu -
Assuming 720x576 should be exactly 4:3
576 x 4 / 3 = 768
768 / 720 = 1.06666666667 <- this is the sample/pixel aspect ratio of the 720x576 anamorphic video
or the other way around
720 / 768 = 0.9375
The example you linked to explains how to fit a 4:3 image into a 5:4 hole by calculating the difference between 5:4 and 4:3.
The same as I did above using 768:576 and 720:576 rather than 4:3 and 5:4.
(5 / 4) / (4 / 3) = 0.9375 or
(4 / 3) / (5 / 4) = 1.06666666667
So for a 4:3 image you multiply the width by 0.9375, or divide it by 1.06666666667, to reduce it for 5:4 dimensions. The 5:4 anamorphic image therefore has a sample/pixel aspect ratio of 1.06666666667.
For a 5:4 anamorphic image you'd multiple the width by 1.06666666667 to give you the width in 4:3 non-anamorphic dimensions.
(the definition of anamorphic I'm using would be any video where the sample/pixel aspect ratio isn't 1:1 or 1.0)
(5 / 4) / (4 / 3) x original horizontal size = new horizontal size
I assume this means the program in question will accept any 5:4 image with a 4:3 display aspect ratio and resize it to 720x576 for you, hence the example only requires you to resize the width. To resize the width of a 4:3 image for an anamorphic 5:4 output, the above formula is correct. 0.9375 * 768 = 720.
But from there you can take any 4:3 image and resize to PAL dimensions by factoring in the sample/pixel aspect ratio.
A 640x480 4:3 video example:
New Width * Pixel Aspect Ratio / Original Width * Original Height = New Height
768 / 640 * 480 = 576
720 * 1.06666666667 / 640 * 480 = 576
The PAL 4:3 sample/pixel aspect ratio is usually referred to as 16:15 (16/15=1.06666666667).
720 * (16 / 15) / (640 / 480) = 576
One more question, how your equation can be used if we add 4:3 footage to a 16:9 anamorphic project and vice versa: a standard 4:3 footage to 16:9 anamorphic project ?
576 x 16 / 9 = 1024
1024 / 720 = 1.42222222222 (64:45)
To add a 4:3 image (768x576) to a 16:9 project, you'd normally pad the left and right sides of the image with black (pillarbox borders) to make it 1024x576 (16:9) and then resize it to 720x576, or resize it to 5:4 dimensions by dividing the width by 1.42222222222.
By the way, if you use Avisynth, try following the CropResize link in my signature.
It can resize to/from anamorphic dimensions and add borders along the way if need be, and all you need to do is specify the correct input aspect ratio (for an anamorphic source), and the desired output aspect ratio if you want an anamorphic output, and Info=true will display the input/output dimensions, display aspect ratio and sample/pixel aspect ratio. There's example screenshots in the second post.Last edited by hello_hello; 27th Jan 2024 at 04:39.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
My take on this, do not look for a formulas, use simple logic, a code which follows your thoughts what to do with an image.
Formula is one thing but real World does not make it easy. Beside aspect ratios, while inserting an image into a video, you need to follow video mods and subsampling mods! Which means no odd sizes right from the start. It has to be at least mod 2 for width and height. (Has to be divisible by 2) Or some mods have to be 4 because of subsampling of video. Also if using generic images or video you have to consider if you pillabox or letterbox. Not mentioning your image might be rotated, that could be a common occurrence as well.
PAL images aspect ratio is 4/3, but 720x576 is 5/4. For your imported images to be displayed correctly, you have to descale their horizontal size
Besides DV, boxing your image knowing its SAR into a generic video, you need to follow mods and video subsampling as mentioned!, again that has to be considered, you can follow lines in that python code below (uses vapoursynth, but you can extrapolate it to whatever utility). It will pillarbox or letterbox your image to given video.
clip is your image, ar is its thought SAR and width and height are sizes you are boxing it into.
Code:def to_box(self, clip, width, height, ar=None): ''' pillarboxes or letterboxes clip into given width and height, keeping aspect ratio, if clip is anamorphic, proper 1:1 aspect ratio is boxed ''' cw, ch = clip.width, clip.height if ar is None: #no mediainfo ar, check if there is vapoursynth ar sar_num = vf.get_prop(clip, '_SARNum') sar_den = vf.get_prop(clip, '_SARDen') if sar_num and sar_den: ar = sar_num/sar_den modx = 1 << clip.format.subsampling_w mody = 1 << clip.format.subsampling_h anamorphic = False if ar is not None and abs(clip.width/clip.height-ar)>0.2: anamorphic = True if clip.width > clip.height: cw = modx * round(clip.height*ar/modx) else: ch = mody * round(clip.width*ar/mody) if width==cw and height==ch and not anamorphic: return clip size = 1 << clip.format.bits_per_sample if clip.format.color_family==vs.RGB: color=[size//16]*3 else: color =(size//16, size//2, size//2) if width/height > cw/ch: w = cw*height/ch x = int((width-w)/2) x = x - x%modx x = max(0, x) clip = self.to_size(clip, width-2*x, height) if x: logger.debug(f'boxing with left={x} and right={x} borders to {width}x{height}') return clip.std.AddBorders(left=x, right=x, color=color) else: return clip else: h = ch*width/cw y = int((height-h)/2) y = y - y%mody y = max(0, y) clip = self.to_size(clip, width, height-2*y) if y: logger.debug(f'boxing with top={y} and bottom={y} borders to {width}x{height}') return clip.std.AddBorders(top=y, bottom=y, color=color) else: return clip
So as you can see, you cannot fix things just using one formula. I'm sure hello_hello knows it too for example. If it was easy, his codes/utilities would not exist also.Last edited by _Al_; 27th Jan 2024 at 12:53.
-
-
Will get to full answer later (tonight, tomorrow), but your question just now is in error.
An image/video CANNOT be 5:4 "SAR", AND 1:1 PAR, AND 1.25:1 DAR! At least one of those numbers must be wrong.
Likewise, your standard image/video of 4:3 DAR, AND 4:3 PAR, AND 720x576 resolution also CANNOT be true.
Scott -
I don't understand what you're saying there.
If you want to resize a video and it's not anamorphic the dimensions and the display aspect ratio are the same. So a 16:9 video would have 16:9 dimensions and you can pick a new width (for example) and calculate the correct height.
New Width (960) / (16 / 9) = New height (540).
If the video has a non-standard resolution you can just substitute the dimensions, as the dimensions are the DAR (assuming it's not anamorphic). For example, if the original resolution was 1280x540:
New Width [1920] / (Original Width [1280] / Original Height [540]) = New height [810].
or without the brackets:
1920 / 1280 * 540 = 810
Obviously you can re-arrange the equation if necessary. For example if you know you want to resize the height to 800, you have to calculate the matching output width.
800 / 540 * 1280 = 1896
New Width / Original Width * Original Height = New Height
is the basic equation for calculating resizing, but when either the source or the output is anamorphic, the source and output pixel/sample aspect ratios have to be added to the equation.
New Width * Output Pixel Aspect Ratio / (Original Width * Source Pixel Aspect Ratio / Original Height) = New Height
So to resize a PAL 4:3 DVD to NTSC 720x480 4:3 dimensions (the source PAR/SAR is 16:15 and the output PAR/SAR needs to be 8:9).
720 * (8 / 9) / ((720 * (16 / 15)) / 576) = 480
(no need to over-think it though, as all you really need to do is resize the 720x576 image to 720x480 as they both have a 4:3 DAR).
The CropResize function I mentioned earlier will do the math for you.
ColorBars() # resolution 640x480
[Attachment 76549 - Click to enlarge]
Spline36Resize(720, 576) # put the 4:3 color bars into a 5:4 PAL hole.
[Attachment 76550 - Click to enlarge]
CropResize(720,480, InDAR=4.0/3.0, OutDAR=4.0/3.0, Info=true) # put the PAL 4:3 color bars into a 3:2 NTSC hole.
[Attachment 76551 - Click to enlarge]
That's pretty easy because all you need to do is resize the 4:3 image to PAL dimensions, then resize it to NTSC dimensions. However if the image isn't exactly 4:3 and therefore it needs to be cropped to 4:3, or it needs to have borders added to make it 4:3...
Once it's 4:3 though, all you need to do is resize it to 720x576.Last edited by hello_hello; 28th Jan 2024 at 06:30.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Reading this whole thread again, I do appreciate @Cornucopia saying the confusing "SAR" phrase can better be avoided and instead use
Code:DAR = Horiz rez / Vert rez * PAR
-
Isn't it politically incorrect to refer to samples as pixels these days, or to refer to the aspect ratio of samples as a PAR?
Mind you I'd happily use PAR, even if it's technically incorrect, because if pixels didn't have to be referred to as samples, SAR could be used fairly unambiguously to mean "storage aspect ratio" as god intended.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
The term "storage aspect ratio" already confuses me, no matter where its definition may have been chiseled in granite. Considering how the --sar argument is meant, the x264.exe devs must be hellbent atheists then. Or am I confusing things already now?
-
"Storage Aspect Ratio" can make literal sense in some ways functionally - perhaps as the w:h of the (stored), encoded frame size . But you'd need a new fancy acronym because "SAR" is officially taken (or perhaps has been re-taken)
No doubt many were "hellbent"... but in this case x264 devs were only following the specs. Sample Aspect Ratio is clearly defined as SAR in Rec ITU-T h.264 "AVC" , (and Rec ITU-T h.265 "HEVC", and Rec ITU-T h.266 "VVC") . So SAR is officially the new PAR, and it is (re-)written in stone (and the near-future stone as VVC). But if the past is any indication, "stone" isn't permanent
-
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Aha
This does mean I've always mistaken PAR for SAR and vice versa. I hereby offer my sincere apologies to all encoders devs - hellbent or not. -
It's not just the x264 encoder which eventually adopted the --sar for Sampling Aspect Ratio (aka former PAR for Pixel Aspect Ratio) but it's nailed in the ITU standards for H.264 and H.265.
(SAR for Storage Aspect Ratio was a sort of loose industry definition used in papers and discussions. I have not seen it in any video standard).
Better one always writes down explicitly what one means with the acronyms to avoid confusion.Last edited by Sharc; 28th Jan 2024 at 10:07.
Similar Threads
-
Pixel Aspect Ratio, how am I meant to deal with it?
By PRAGMA in forum Newbie / General discussionsReplies: 6Last Post: 22nd Nov 2020, 23:17 -
Help with pixel aspect ratio
By blue24 in forum Video ConversionReplies: 12Last Post: 28th Dec 2018, 18:36 -
pixel aspect ratio mkv.
By x264 in forum Newbie / General discussionsReplies: 4Last Post: 18th Jul 2018, 10:25 -
Need understanding of modules, anamorphic, pixel aspect ratio
By JeremyBrown in forum Newbie / General discussionsReplies: 2Last Post: 28th Jul 2017, 08:06 -
avisynth and pixel aspect ratio
By silicontrip in forum Newbie / General discussionsReplies: 6Last Post: 29th Sep 2016, 02:10