Page 1 of 1

how to get sar (sample aspect ratio) of current stream?

Posted: 02 Sep 2009 10:42
by ikarus76
hi community!

does anyone know, how i can get the sample aspect ratio parameter (sar) of the current stream? (using libvlc with version 1.0.1)

my problem is the following:
i use vlc for watching iptv. if the stream changes the aspect ratio, the picture gets streched, because the aspect ratio does not change "on the fly". I need to restart the stream or change the channel. in the debug messages of vlc i can see the used sar for the stream. i need to get this information from the stream, to dynamically change the ratio...

any hints? :)

best regards,
michael

Re: how to get sar (stream aspect ratio) of current stream?

Posted: 02 Sep 2009 12:09
by XilasZ
I do it in my program. In the positionchanged event, i check the video size reported by libvlc, and if the ratio doesn't match the ratio of the window, my program resize itself.

Re: how to get sar (stream aspect ratio) of current stream?

Posted: 03 Sep 2009 14:40
by ikarus76
I have tried this.

The problem is, that I have a continous stream. The stream occasionally changes video size and aspect ratio, but vlc doesn't recognize it. if i reconnect to the stream, the video size is reported correctly. if i periodically check the video size, it's always the same. what i mean is, that vlc doesn't update the video size during receiving a stream...

Re: how to get sar (stream aspect ratio) of current stream?

Posted: 03 Sep 2009 16:59
by XilasZ
The last time i had such a stream (a tv stream from my provider), it was working. Now the stream has changed and has always a 16/9 ratio, so i can't check again.
Maybe it's broken in 1.0.1 ....

Re: how to get sar (stream aspect ratio) of current stream?

Posted: 07 Sep 2009 14:47
by ikarus76
The last time i had such a stream (a tv stream from my provider), it was working. Now the stream has changed and has always a 16/9 ratio, so i can't check again.
Maybe it's broken in 1.0.1 ....
i have tried now with different versions (0.9.8a, 1.0.0, 1.0.1) and no one gave me a aspect ratio...

I get the video size, but this always keeps the same size. Also the original VideoLan Client doesn't check, if the sample aspect ratio has changed...

Re: how to get sar (sample aspect ratio) of current stream?

Posted: 07 Sep 2009 22:25
by XilasZ
Maybe in my case, the video size was really changing over time, and not the aspect ratio.

Re: how to get sar (sample aspect ratio) of current stream?

Posted: 13 Dec 2010 23:19
by wazer
You found the solution ? im from denmark and i have the same problem with my provider using iptv with vlc.