[vlc-devel] Relationship between video coordinates and aspect ratio

Peter Tap ptrtap at yahoo.com
Wed May 2 10:23:10 CEST 2012


Folks,

From my VLC filter plugin, I need to display some text at the top-left corner and the bottom-right corner of the video that is running. I would appreciate your help in calculating the coordinates correctly.


I can query VLC engine to obtain the width and height of the video.Structure vout_thread_t contains this information.

When I display text at (0,0) location, it displays it correctly on the top-left corner of the video. 

The problem comes in when the user changes the aspect ratio from the default value. Now,  (0, 0) no longer indicates the top right location.

The problem is similar for the bottom-right corner. (videoWd, videoHt) no longer represents the bottom-right location once the aspect ratio gets changed.

Questions:
1. How do I programmatically obtain the aspect ratio and check if it is not the default aspect ratio?
2. What formula should I use to compute my top-left corner and bottom-right corner?

Thank you in advance for your help.

Regards,
Peter



More information about the vlc-devel mailing list