After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792651 - gstreamer pipeline unable to change video brightness using vaapipostproc
gstreamer pipeline unable to change video brightness using vaapipostproc
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
1.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-18 16:55 UTC by Tapas Kumar Kundu
Modified: 2018-01-25 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tapas Kumar Kundu 2018-01-18 16:55:52 UTC
Hello everyone, I am trying below code to change brightness of a video pipeline. I can see the video but brightness never changes although I am trying to change it every 60 seconds. It seems like a bug in vaapipostproc ? 

    static gboolean broadcasting_timeout_cb (gpointer user_data)
    {
	GstElement *vaapipostproc = NULL;
	vaapipostproc = gst_bin_get_by_name(GST_BIN(broadcasting_pipeline),  
    "postproc");
	
	if (vaapipostproc == NULL) {
		fprintf(stderr, "unable to get vaapipostproc from broadcasting 
    pipeline\n");
		return TRUE;
	}

	g_object_set (G_OBJECT (vaapipostproc), "brightness", -1.0, NULL);
	fprintf(stderr, "brightness changed by -1.0\n");
    return TRUE;
    }


    main() {
    //pipeline code goes here and  then below code comes //

    broadcasting_pipeline = gst_parse_launch (compl_streaming_pipe, &error);
    if (!broadcasting_pipeline) {
        fprintf (stderr, "Parse error: %s\n", error->message);
        exit (1);
    }
    loop_broadcasting = g_main_loop_new (NULL, FALSE);
    g_timeout_add_seconds (60, broadcasting_timeout_cb, loop_broadcasting); 
    
    gst_element_set_state (broadcasting_pipeline, GST_STATE_PLAYING);
    g_main_loop_run(loop_broadcasting);
    // rest of the code for main function comes here
    }
Comment 1 Víctor Manuel Jáquez Leal 2018-01-23 12:23:37 UTC
Thanks for reporting this. Nonetheless I just wrote this test app [1] and it works, so the bug might be in your code.

1. https://pastebin.com/eZVR22q9
Comment 2 Tapas Kumar Kundu 2018-01-25 11:25:45 UTC
I can still reproduce this issue with your code. I compiled your code against gstreamer-1.12.4 on Intel Ivybridge platform as below: 

libtool --mode=link gcc -g vaapipostproc_test.c -o vaapipostproc_test `pkg-config gstreamer-1.0 --libs --cflags` `pkg-config gtk+-2.0 --libs --cflags` `pkg-config gstreamer-video-1.0 --libs --cflags`
libtool: link: gcc -g vaapipostproc_test.c -o .libs/vaapipostproc_test -pthread -I/home/janardana/src/gstreamer/head/gstreamer -I/home/janardana/src/gstreamer/head/gstreamer/libs -I/home/janardana/src/gstreamer/head/gstreamer -I/home/janardana/src/gstreamer/head/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -pthread -I/home/janardana/src/gstreamer/head/gstreamer/libs -I/home/janardana/src/gstreamer/head/gstreamer -I/home/janardana/src/gstreamer/head/gstreamer/libs -I/home/janardana/src/gstreamer/head/gstreamer -I/home/janardana/src/gstreamer/head/gstreamer/libs -I/home/janardana/src/gstreamer/head/gst-plugins-base/gst-libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -L/home/janardana/src/gstreamer/head/gstreamer/gst/.libs -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -L/home/janardana/src/gstreamer/head/gstreamer/libs/gst/base/.libs -L/home/janardana/src/gstreamer/head/gst-plugins-base/gst-libs/gst/video/.libs /home/janardana/src/gstreamer/head/gst-plugins-base/gst-libs/gst/video/.libs/libgstvideo-1.0.so /home/janardana/src/gstreamer/head/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so /home/janardana/src/gstreamer/head/gstreamer/gst/.libs/libgstreamer-1.0.so -lgobject-2.0 -lglib-2.0 -pthread
janardana@janardana-Lenovo-V480c:~/src/gstreamer_program$ 



Then I run it as below : 

./vaapipostproc_test 

(lt-gst-plugin-scanner:3439): GStreamer-WARNING **: Failed to load plugin '/home/janardana/src/gstreamer/head/gst-plugins-bad/ext/vulkan/.libs/libgstvulkan.so': /home/janardana/src/gstreamer/head/gst-plugins-bad/ext/vulkan/.libs/libgstvulkan.so: undefined symbol: gst_vulkan_display_wayland_new
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
saturation = 1.118000 / brightness = 0.703193 / contrast = 1.939569
saturation = 0.007639 / brightness = 0.701023 / contrast = 1.865630
saturation = 0.692543 / brightness = 0.972346 / contrast = 0.773652
saturation = 0.855991 / brightness = 0.792819 / contrast = 1.100712
saturation = 0.774666 / brightness = 0.182814 / contrast = 0.350862
saturation = 0.336113 / brightness = 0.785597 / contrast = 0.106252
saturation = 0.441843 / brightness = -0.693075 / contrast = 1.478191
saturation = 0.228305 / brightness = 0.186030 / contrast = 0.862436
saturation = 0.240296 / brightness = 0.993570 / contrast = 0.797715
saturation = 0.366023 / brightness = -0.277194 / contrast = 0.983066
saturation = 0.645769 / brightness = 0.073399 / contrast = 0.045241
saturation = 0.109451 / brightness = 0.009052 / contrast = 0.753974
saturation = 1.216653 / brightness = 0.547144 / contrast = 0.336692

But I don't see any change in brightness. So vaapipostproc still broken ? Could you please tell me what log will be helpful for you to debug ? I can provide you any logs from my system .
Comment 3 Tapas Kumar Kundu 2018-01-25 11:29:19 UTC
Adding more logs from my system: 

root@janardana-Lenovo-V480c:/home/janardana/src/gstreamer_program# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 1.7.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
root@janardana-Lenovo-V480c:/home/janardana/src/gstreamer_program# gst-inspect-1.0 vaapi
Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /home/janardana/src/gstreamer/head/gstreamer-vaapi/gst/vaapi/.libs/libgstvaapi.so
  Version                  1.12.4
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      2017-12-07
  Binary package           gstreamer-vaapi
  Origin URL               http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

  vaapih264enc: VA-API H264 encoder
  vaapimpeg2enc: VA-API MPEG-2 encoder
  vaapisink: VA-API sink
  vaapidecodebin: VA-API Decode Bin
  vaapipostproc: VA-API video postprocessing
  vaapivc1dec: VA-API VC1 decoder
  vaapih264dec: VA-API H264 decoder
  vaapimpeg2dec: VA-API MPEG2 decoder
  vaapijpegdec: VA-API JPEG decoder

  9 features:
  +-- 9 elements

root@janardana-Lenovo-V480c:/home/janardana/src/gstreamer_program#
Comment 4 Tim-Philipp Müller 2018-01-25 11:43:41 UTC
Tapas, please don't modify the bug importance or severity fields. These fields are for maintainers. They won't change anything with regard to how quickly your bug is handled. Thanks.
Comment 5 Víctor Manuel Jáquez Leal 2018-01-25 12:25:22 UTC
Ivybridge doesn't support color balance (CB) in vaapipostproc:

See the postprocessor capabilities per chipset in

https://blogs.igalia.com/vjaquez/2015/07/16/gstreamer-va-api-a-new-release/