[FFmpeg-user] Getting actual video size + ratio

Rodney Baker rodney.baker at iinet.net.au
Thu Nov 22 15:10:30 CET 2012

On Fri, 23 Nov 2012 00:19:56 Nicolas George wrote:
> Le tridi 3 frimaire, an CCXXI, Rodney Baker a écrit :
> > You seemed to be confusing Pixel Aspect Ratio (PAR) and Storage Aspect
> > Ratio (SAR) which are not the same.
> And you are not helping by using acronyms that are not the same as used by
> ffmpeg. I had never heard of "storage aspect ratio" before.
> The SAR acronym, for ffmpeg, means sample aspect ratio, and is probably
> what you call pixel aspect ratio.
> The other aspect ratio that ffmpeg prints is the display aspect ratio.
> Regards,

Sorry for the confusion. According to my sources, DAR = SAR x PAR. It seems 
that Sample Aspect Ratio is a pseudonym for Storage Aspect Ratio (or v/v) but 
it is NOT the same. I thought ffmpeg used to print all 3 parameters, but maybe 
it has only ever printed 2 of the 3, but codec dependent. SAR only has meaning 
for MPEG4 streams, apparently.

Here is another reference that uses Sample Aspect Ratio, but the formula is 
the same. 


Quoting from that page:

"Sample Aspect Ratios 
Now, as if Pixel Aspect Ratios and Display Aspect Ratios weren't enough, now 
we have another one to throw into the mix. Sample Aspect Ratios were 
introduced with the MPEG4 container. As such, they have absolutely nothing to 
do with DVDs! Since you might want to distribute your AMV as an MPEG4 though, 
it is worth learning what they are. Sample Aspect Ratios are actually very 
simple to understand - they are just a little hard to calculate. Fortunately, 
you probably wont ever need to calculate an SAR by hand! 
The SAR basically just says "stretch the video by this ratio". So lets say for 
example, we have a 704x480 video (we took a dvd, and simply cropped off those 
annoying bits on the sides). If we want this video to be displayed at an 
aspect ratio of 4:3, then it would need an SAR of 10:11.
Why 10:11? Just look:
(704*10)/(480*11) = 4/3
See, it *is* easy to understand, right? If we wanted that same 704x480 video 
to be displayed at an aspect ratio of 16:9, then we would use an SAR of 40:33, 
as (704*40)/(480*33) = 16/9.
But like I said, you wont need to be calculating these manually, so all you 
really need to worry about is just understanding how the SAR differs from the 
PAR and DAR." 

Rodney Baker VK5ZTV
rodney.baker at iinet.net.au

More information about the ffmpeg-user mailing list