[FFmpeg-user] Getting actual video size + ratio

Nathan Malachowski nathanmal at gmail.com
Thu Nov 22 22:33:36 CET 2012

> Wild guess: 720×480 16/9 NTSC DVD frame, cropped to 720×470 to remove dirty
> edges, then for some reason upscaled to 480.

yeah that makes sense, maybe thats why it boggled me for some reason.
plus i just started really getting into ffmpeg so i suppose it's good
to learn to deal with bad encodings sooner than later. You never know
what users might throw at you.

> You seemed to be confusing Pixel Aspect Ratio (PAR) and Storage Aspect Ratio
> (SAR) which are not the same.

thanks for the tip. I did read through the wikipedia article, and it
makes sense. plus, in my case, DAR/SAR (20:11)/(40:33) = 1.5, or 3:2,
which is a strange pixel ratio i think, and the same ratio the video
uses. I was also confused because previously when i was using ffmpeg
0.6 it actually labeled it as PAR, ie PAR 40:33, when i upgraded to
the latest git it changed to SAR

also the article does call it storage aspect ratio. I've seen both
terms used. if they did create a new measurment of sample aspect ratio
well then that's crazy, why would they make two definitions of SAR?

in any case, i'm moving forward with just using the declared size of
the videos (720x480) and while they look slightly squished, i'll have
to chock it up to a bad encoding and keep on looking for a solution.

thx for all the help and guidance so far!



On Thu, Nov 22, 2012 at 8:54 AM, Nicolas George
<nicolas.george at normalesup.org> wrote:
> Le tridi 3 frimaire, an CCXXI, Rodney Baker a écrit :
>> Sorry for the confusion. According to my sources, DAR = SAR x PAR. It seems
> The correct formula, eliminating all notation problems, is:
>         display aspect ratio = image ratio × sample aspect ratio
> where
> display aspect ratio is the ratio between the physical size of the image
> when it is correctly displayed;
> image aspect ratio is the ratio of the resolution of the image in pixels;
> sample aspect ratio is the aspect ratio of the physical size of a pixel of
> the image when it is correctly displayed.
>> that Sample Aspect Ratio is a pseudonym for Storage Aspect Ratio (or v/v) but
> I do not know where you got that storage aspect ratio, I had never
> encountered it before. It seems to refer to what I call image ratio.
> Sample aspect ratio is a synonym for pixel aspect ratio, since the pixels
> are the samples for images.
> Anyway, you should never refer to this kind of formula without stating your
> notations with accuracy.
>> 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.
> ffmpeg prints the display aspect ratio and the sample aspect ratio. It also
> prints the image resolution, and you can use a calculator to deduce the
> corresponding ratio (which, IMHO, should not be called an _aspect_ ratio).
>> Here is another reference that uses Sample Aspect Ratio, but the formula is
>> the same.
>> http://www.animemusicvideos.org/guides/avtech3/theory-videoaspectratios.html
>> Quoting from that page:
>> "Sample Aspect Ratios
>> The SAR basically just says "stretch the video by this ratio".
> Unless I am seriously mistaken, this thing is completely equivalent to what
> the very same page calls pixel aspect ratio a few paragraphs earlier (and
> that ffmpeg calls sample aspect ratio). (There may be a catch if the file is
> designed to be played on a device that has non-square pixels but not at its
> native resolution, but that is beginning to be far-fetched.)
> Regards,
> --
>   Nicolas George
> Version: GnuPG v1.4.12 (GNU/Linux)
> 8MkAnR7p5s4aFrVprRC+ulag5ihS9xgq
> =XHQn
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


{ n }

More information about the ffmpeg-user mailing list