Page 1 of 1

Determine the aspect ratio of the movie

Posted: 19 Apr 2009 13:58
by menny
Hi all,
This is an off-VLC question, but I thought that VLC developers will be able to help me.
I'm writing a video player software which relay of avcodec (ffmpeg). I understand that VLC does the same.

I stumble upon a problem with determining the aspect ratio of the video file, let me explain:
When I decode a video file with avcodec, I also get a struct which tells me what is the resolution of the video (e.g., 640x480 (vga), 704x576(4cif), 704x288 (2cif), etc).
I also get the pixel aspect ratio (e.g., 1:1, 12:11).

The problem is that sometimes the decoded resolution and the video size to display, are not the same - 2cif is an excellent example for this:
The decoded resolution is 704x288, the pixel aspect ratio is 12:11 but the actual video size to be displayed should be 704x576!

I was wondering how VLC solves this problem in a generic way?

Thanks ahead,
Menny

Re: Determine the aspect ratio of the movie

Posted: 26 Apr 2009 02:26
by Arite
Moved to Coffee Corner (the place for non-VLC discussion).

Arite.