libvlc_media_add_option help

This forum is about all development around libVLC.
10robinho
Blank Cone
Blank Cone
Posts: 23
Joined: 24 Oct 2011 05:21

libvlc_media_add_option help

Postby 10robinho » 01 Dec 2011 01:59

Hi,

I'm confused with libvlc_media_add_option. This is documentation:

Add an option to the media.
This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis.
The options are detailed in vlc --long-help, for instance "--sout-all"


If I add

Code: Select all

libvlc_media_add_option(media, "--ffmpeg-hw")
it won't work, but if I add

Code: Select all

libvlc_media_add_option(media, "ffmpeg-hw")
it works.

But, when I try to add

Code: Select all

libvlc_media_add_option(media, "aspect-ratio=16:9")
it is not working, and also with "--" in front won't work.

I know that this must be simple, what am I missing? :oops:

rvs75
Blank Cone
Blank Cone
Posts: 38
Joined: 01 Jul 2010 11:48

Re: libvlc_media_add_option help

Postby rvs75 » 01 Dec 2011 10:53

I don't know why it doesn't work, but you can use 'libvlc_video_set_aspect_ratio' :
http://www.videolan.org/developers/vlc/ ... 3927afec8a

10robinho
Blank Cone
Blank Cone
Posts: 23
Joined: 24 Oct 2011 05:21

Re: libvlc_media_add_option help

Postby 10robinho » 03 Dec 2011 18:21

Thankss, thatt worked, but still I'm unable to set some other options like

Code: Select all

libvlc_media_add_option(m, "no-video-title-show")
or

Code: Select all

libvlc_media_add_option(m, "--no-video-title-show")
... nothing is working. Just

Code: Select all

libvlc_media_add_option(m, "ffmpeg-hw")
is working... I'm confused as this must be something stupid I don't see...

btw. this is working

Code: Select all

cvlc --no-video-title-show ...some media...

rvs75
Blank Cone
Blank Cone
Posts: 38
Joined: 01 Jul 2010 11:48

Re: libvlc_media_add_option help

Postby rvs75 » 04 Dec 2011 12:51

1/ Add maximum static arguments when you create the media player with the prefix "--"
2/ Use AddOption with the prefix ":" for dynamic options than they don't have a libvlc method
3/ Use libvlc methods when they exist (Volume, Contrast, Hue, Saturation, Gamma, Subtitle, Aspect ratio, Rate, CropGeometry, Deinterlacemode, Audio track, etc....)
4/ READ THE DOC http://www.videolan.org/developers/vlc/ ... ibvlc.html http://wiki.videolan.org/Developers_Corner

10robinho
Blank Cone
Blank Cone
Posts: 23
Joined: 24 Oct 2011 05:21

Re: libvlc_media_add_option help

Postby 10robinho » 05 Dec 2011 13:27

Thank you, but I haven't made it work.

This is my code, what is wrong here? I'm using git build 1.2

Code: Select all

void play(char* addr) { m = libvlc_media_new_path(inst, addr); libvlc_media_add_option(m, "--no-video-title-show"); libvlc_media_player_set_media(mp, m); libvlc_media_release(m); libvlc_video_set_aspect_ratio(mp, "16:9"); libvlc_video_set_deinterlace(mp, "yadif"); libvlc_media_player_set_xwindow(mp, GDK_WINDOW_XID(gtk_widget_get_window(b_window))); libvlc_media_player_play(mp); }
and this is not working;

Code: Select all

libvlc_media_add_option(m, "--no-video-title-show");

Code: Select all

libvlc_media_add_option(m, "no-video-title-show");

Code: Select all

libvlc_media_add_option(m, ":no-video-title-show");
is there someting else?

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

Re: libvlc_media_add_option help

Postby Rémi Denis-Courmont » 05 Dec 2011 15:12

Are you sure that is an input item option? Does it even work that way in the player?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

rvs75
Blank Cone
Blank Cone
Posts: 38
Joined: 01 Jul 2010 11:48

Re: libvlc_media_add_option help

Postby rvs75 » 05 Dec 2011 17:02

What are the arguments you use for libvlc_new ?
http://www.videolan.org/developers/vlc/ ... ba6e2f7764

"--no-video-title-show" must be use in this arguments (first paragraph from my previous post).

10robinho
Blank Cone
Blank Cone
Posts: 23
Joined: 24 Oct 2011 05:21

Re: libvlc_media_add_option help

Postby 10robinho » 05 Dec 2011 17:19

Are you sure that is an input item option? Does it even work that way in the player?

:oops: :roll: :oops:

i promise one day that I will learn enought to help you guys programming :mrgreen:


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 13 guests