brightness, contrast, hue and saturation in libVLC

This forum is about all development around libVLC.
GunnarK
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Oct 2008 12:27

brightness, contrast, hue and saturation in libVLC

Postby GunnarK » 14 Jan 2009 15:32

I have been looking at the following Tutorial:

http://wiki.videolan.org/LibVLC_Tutorial

Is it possible to adjust brightness, contrast, hue and saturation using libVLC?

duppenkamp
New Cone
New Cone
Posts: 1
Joined: 15 Feb 2009 21:00

Re: brightness, contrast, hue and saturation in libVLC

Postby duppenkamp » 15 Feb 2009 21:02

Has anyone found a solution for this question. I am using JVLC and would like to access the video effects that are available under the extended settings dialog in the VLC media player.

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

Re: brightness, contrast, hue and saturation in libVLC

Postby Rémi Denis-Courmont » 15 Feb 2009 21:05

Well, you can change the values from the libvlc_new text parameters. But I doubt anyone implemented an API to change them afterward.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

GunnarK
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Oct 2008 12:27

Re: brightness, contrast, hue and saturation in libVLC

Postby GunnarK » 16 Feb 2009 21:42

But what about the extended settings dialog in the VLC media player? is there a API for this?

kryptonite
Blank Cone
Blank Cone
Posts: 52
Joined: 22 May 2009 12:01

Re: brightness, contrast, hue and saturation in libVLC

Postby kryptonite » 12 Aug 2009 08:11

Did you get the any of the Video Effects (e.g video scaling) to work?

zamensis
New Cone
New Cone
Posts: 5
Joined: 02 Aug 2010 10:54

Re: brightness, contrast, hue and saturation in libVLC

Postby zamensis » 02 Aug 2010 11:03

Hello everybody!

I am currently trying to get brightness, contrast, hue and gamma filters working using libvlc-dev 1.1.1 in a c++ program under linux.

Here's what I do :

libvlc_video_set_adjust_int(mp,libvlc_adjust_Enable,1); // mp is libvlc_media_player_t

libvlc_video_set_adjust_float(mp,libvlc_adjust_Gamma,1.0f);

I found those 2 functions in libvlc_media_player.h

Unfortunately, the video remains exactly the same.

Could someone please tell me what I am doing wrong?

Thank you in advance.

zamensis
New Cone
New Cone
Posts: 5
Joined: 02 Aug 2010 10:54

Re: brightness, contrast, hue and saturation in libVLC

Postby zamensis » 02 Aug 2010 12:04

Please...anybody?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: brightness, contrast, hue and saturation in libVLC

Postby Jean-Baptiste Kempf » 02 Aug 2010 13:10

libvlc_adjust_Enable( ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

zamensis
New Cone
New Cone
Posts: 5
Joined: 02 Aug 2010 10:54

Re: brightness, contrast, hue and saturation in libVLC

Postby zamensis » 02 Aug 2010 13:49

Thanks a lot for answering.

However, from what I can see in libvlc_media_player.h, libvlc_adjust_Enable is declared as :

/** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
enum libvlc_video_adjust_option_t {
libvlc_adjust_Enable = 0,
libvlc_adjust_Contrast,
libvlc_adjust_Brightness,
libvlc_adjust_Hue,
libvlc_adjust_Saturation,
libvlc_adjust_Gamma,
};

And libvlc_video_set_adjust_int :

VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
unsigned option, int value );


So, correct me if I am wrong but libvlc_adjust_Enable is an argument, not a function.

Pardon me if my problem is confusing : I just want to filter the video and I thought libvlc_video_set_adjust was the right function for me but unfortunately, the video keeps playing unfiltered.

Is my problem clear enough?

Thanks again in advance

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: brightness, contrast, hue and saturation in libVLC

Postby sherington » 02 Aug 2010 17:02

Is the video already playing when you call the video adjust functions?

I have those functions working in the Java bindings just fine, I just can't remember if the video has to be already playing or not.

zamensis
New Cone
New Cone
Posts: 5
Joined: 02 Aug 2010 10:54

Re: brightness, contrast, hue and saturation in libVLC

Postby zamensis » 02 Aug 2010 17:15

Thanks for answering so fast.

I tried to call those 2 functions before and after : libvlc_media_player_play (mp) (mp is my libvlc_media_player_t ), but it doesn't seem to show any difference.

Should I try my code with a different computer or with a different libvlc-dev ? (currently 1.1.1-1~ppa1 under linux lucid)

Thanks a lot anyway.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: brightness, contrast, hue and saturation in libVLC

Postby sherington » 02 Aug 2010 17:29

libvlc_video_set_adjust_float(mp,libvlc_adjust_Gamma,1.0f);
Is that just an example? I thought 1.0f was the 'default' gamma value so setting it to that wouldn't change anything anyway.

What I do in my code is this:

1. libvlc_media_player_play
2. libvlc_video_set_adjust_int(mp, libvlc_adjust_Enable, 1);
3. libvlc_video_set_adjust_float(mp, libvlc_adjust_Gamma, gamma);

where gamma comes from a slider control that ranges from 0.01 to 10.0.

This has worked just fine for me with libvlc 1.1.1 onwards.

zamensis
New Cone
New Cone
Posts: 5
Joined: 02 Aug 2010 10:54

Re: brightness, contrast, hue and saturation in libVLC

Postby zamensis » 02 Aug 2010 18:01

Indeed, 1.0f was just an example. I tried more often values between 0.0f and 1.0f because I was ignorant of the actual range of this parameter.

However, I am using these lines in the exact same order with different values of gamma and brightness and saturation...; I guess it's just bad luck then!

Are you aware of any example of vlc integration in c++ with that filter thingy?

Thank you one more time for your consideration and support.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 40 guests