Page 1 of 1
brightness, contrast, hue and saturation in libVLC
Posted: 14 Jan 2009 15:32
by GunnarK
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?
Re: brightness, contrast, hue and saturation in libVLC
Posted: 15 Feb 2009 21:02
by duppenkamp
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.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 15 Feb 2009 21:05
by RĂ©mi Denis-Courmont
Well, you can change the values from the libvlc_new text parameters. But I doubt anyone implemented an API to change them afterward.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 16 Feb 2009 21:42
by GunnarK
But what about the extended settings dialog in the VLC media player? is there a API for this?
Re: brightness, contrast, hue and saturation in libVLC
Posted: 12 Aug 2009 08:11
by kryptonite
Did you get the any of the Video Effects (e.g video scaling) to work?
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 11:03
by zamensis
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.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 12:04
by zamensis
Please...anybody?
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 13:10
by Jean-Baptiste Kempf
libvlc_adjust_Enable( ?
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 13:49
by zamensis
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
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 17:02
by sherington
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.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 17:15
by zamensis
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.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 17:29
by sherington
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.
Re: brightness, contrast, hue and saturation in libVLC
Posted: 02 Aug 2010 18:01
by zamensis
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.