How to get sample aspect ratio

This forum is about all development around libVLC.
hanky
Blank Cone
Blank Cone
Posts: 21
Joined: 30 May 2012 07:49

How to get sample aspect ratio

Postby hanky » 06 Jun 2012 12:59

Hello again.

I'm using libvlc in my program for playing video files. And I need to know actual size of the video window.
I can use libvlc_video_get_size to do this, but some files have sar (sample aspect ratio) not equal to 1. I mean I can use that get_size function but I won't get the correct actual video size.
When VLC Player starts the playback of such files, I can see the following:

Code: Select all

... [03925b04] main video output debug: pic render sz 544x576, of (0,0), vsz 544x576, 4cc I420, sar 24:17, msk r0x0 g0x0 b0x0 [03925b04] main video output debug: pic in sz 544x576, of (0,0), vsz 544x576, 4cc I420, sar 24:17, msk r0x0 g0x0 b0x0 [03925b04] main video output debug: pic out sz 544x576, of (0,0), vsz 544x576, 4cc I420, sar 24:17, msk r0x0 g0x0 b0x0 ... [0387a544] main generic debug: VoutDisplayEvent 'resize' 768x576 window
I need to do the same: get video resolution (544x576) and multiply it by the sar (24:17) to get the actual size of the video window.

How can I do it?

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests