Page 1 of 1

How can I get the actual Display Aspect Ratio ?

Posted: 16 Jan 2016 10:08
by dongxf
Hi,
I'm using libvlc 2.1.3 to show logo on the screen, I need to know the actual Display Aspect Ratio(DAR) in the media file, so I call the libvlc_video_get_aspect_ratio function, but it returns null.
I use mediainfo utility, found the DAR in the media file is 4:3, how can I get this 4:3 with libvlc ? I don't want to use an additional mediainfo.dll.

The reason I need DAR is I want to show logo in the middle of the screen with different media file which has different resolution, I need to calculate the resolution of the render screen size and put the logo to the correct position.

Or, Who can tell me how I can get the actual render size by libvlc, for example, the video size is 720x480, when I get a snapshot with default aspect ratio, I get a png file which is 853 x 480, How can I get this 853 x 480 ?

Thanks !

dongxf

Re: How can I get the actual Display Aspect Ratio ?

Posted: 16 Jan 2016 11:26
by Rémi Denis-Courmont
libvlc_video_track_t conveys the SAR and the resolution, from which you can infer the DAR.

Re: How can I get the actual Display Aspect Ratio ?

Posted: 17 Jan 2016 05:58
by dongxf
Do you mean DAR can be calculated by SAR and width, height ?

Re: How can I get the actual Display Aspect Ratio ?

Posted: 17 Jan 2016 09:27
by Rémi Denis-Courmont
Isn't that obvious?

Re: How can I get the actual Display Aspect Ratio ?

Posted: 17 Jan 2016 17:14
by dongxf
I checked a file, it is just like what you said, I will check other files later, Thank you very much !

Re: How can I get the actual Display Aspect Ratio ?

Posted: 17 Jan 2016 17:23
by dongxf
Isn't that obvious?
Yes, Thanks :)