VLC aspect ratio

This forum is about all development around libVLC.
lakshmi.p
New Cone
New Cone
Posts: 8
Joined: 30 Apr 2008 10:45

VLC aspect ratio

Postby lakshmi.p » 09 Apr 2010 13:02

Hi,


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

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC aspect ratio

Postby Rémi Denis-Courmont » 10 Apr 2010 10:08

Isn't that what the 'A' hotkey does? libvlc_video_set_aspect_ratio() should do the same programmatically.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

lakshmi.p
New Cone
New Cone
Posts: 8
Joined: 30 Apr 2008 10:45

Re: VLC aspect ratio

Postby lakshmi.p » 12 Apr 2010 09:09

I tried with this method. but no effect.
I tried with libvlc_video_resize() method also. still no effect.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: VLC aspect ratio

Postby XilasZ » 15 Apr 2010 10:49

I use libvlc_video_set_aspect_ratio, and it works perfectly, the ratio change dynamically.

lakshmi.p
New Cone
New Cone
Posts: 8
Joined: 30 Apr 2008 10:45

Re: VLC aspect ratio

Postby lakshmi.p » 15 Apr 2010 10:58

Could you please send your code for testing.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: VLC aspect ratio

Postby XilasZ » 16 Apr 2010 17:20

libvlc_video_set_aspect_ratio(p_media_player, value, ref p_exception)
The value must be something like "4:3", "16:9", "16:10", ...

MichaelMc
Blank Cone
Blank Cone
Posts: 63
Joined: 10 Jun 2009 17:55

Re: VLC aspect ratio

Postby MichaelMc » 17 Apr 2010 16:28

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.

lakshmi.p
New Cone
New Cone
Posts: 8
Joined: 30 Apr 2008 10:45

Re: VLC aspect ratio

Postby lakshmi.p » 19 Apr 2010 06:39

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.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: VLC aspect ratio

Postby XilasZ » 19 Apr 2010 15:52

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.

lakshmi.p
New Cone
New Cone
Posts: 8
Joined: 30 Apr 2008 10:45

Re: VLC aspect ratio

Postby lakshmi.p » 23 Apr 2010 06:25

Is it possible to call libvlc_media_add_option() method dynamically i.e, while playing the video.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: VLC aspect ratio

Postby XilasZ » 23 Apr 2010 14:12

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).

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC aspect ratio

Postby Rémi Denis-Courmont » 24 Apr 2010 13:44

XilasZ, that's correct.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests