Page 1 of 1

VLC aspect ratio

Posted: 09 Apr 2010 13:02
by lakshmi.p
Hi,


Is it possible to change the aspect ratio of vlc rendering video dynamically?

Re: VLC aspect ratio

Posted: 10 Apr 2010 10:08
by Rémi Denis-Courmont
Isn't that what the 'A' hotkey does? libvlc_video_set_aspect_ratio() should do the same programmatically.

Re: VLC aspect ratio

Posted: 12 Apr 2010 09:09
by lakshmi.p
I tried with this method. but no effect.
I tried with libvlc_video_resize() method also. still no effect.

Re: VLC aspect ratio

Posted: 15 Apr 2010 10:49
by XilasZ
I use libvlc_video_set_aspect_ratio, and it works perfectly, the ratio change dynamically.

Re: VLC aspect ratio

Posted: 15 Apr 2010 10:58
by lakshmi.p
Could you please send your code for testing.

Re: VLC aspect ratio

Posted: 16 Apr 2010 17:20
by XilasZ
libvlc_video_set_aspect_ratio(p_media_player, value, ref p_exception)
The value must be something like "4:3", "16:9", "16:10", ...

Re: VLC aspect ratio

Posted: 17 Apr 2010 16:28
by MichaelMc
I tried with this method. but no effect.
I tried with libvlc_video_resize() method also. still no effect.
You didn't mention which vout you're using but in the case of vmem, libvlc_video_set_aspect_ratio() isn't handled within the module (via the Control() callback). From what I can gather it's assumed you'll perform ratio adjustment within your application. At least that's what I do.

Re: VLC aspect ratio

Posted: 19 Apr 2010 06:39
by lakshmi.p
Hi Michael,

Thanks for your reply. Actually my requirement is, fit the video to the viewing window size.
Initially, i set the aspect ratio as " --aspect-ratio=width:height " .
This option is passed to libvlc_new(). so, for the first time the video is fitted into the viewing window size.
Once if i change the window size by doing maximize and minimize, the viewing window height and width will be changed.
Now i need to set the aspect ratio to the new window size. For that, i called the method libvlc_video_set_aspect_ratio() with the option of "--aspect-ratio=new width:new height" . After calling this method also, the video is not fitted into the viewing window size.The initial aspect ratio was maintained. This is my problem.

Re: VLC aspect ratio

Posted: 19 Apr 2010 15:52
by XilasZ
hmm, you meant custom aspect ratios.
I know it's possible to add custom ratios with "--custom-aspect-ratios", but i don't know if it works dynamically.

Re: VLC aspect ratio

Posted: 23 Apr 2010 06:25
by lakshmi.p
Is it possible to call libvlc_media_add_option() method dynamically i.e, while playing the video.

Re: VLC aspect ratio

Posted: 23 Apr 2010 14:12
by XilasZ
I think it will only affect the media object, and not what is currently being played.
I guess the media needs to be reassigned to the player and restarted. (someone, correct me if i am wrong).

Re: VLC aspect ratio

Posted: 24 Apr 2010 13:44
by Rémi Denis-Courmont
XilasZ, that's correct.