VAAPI + clutter

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

VAAPI + clutter

horai
Dear all,

I am developing an application to visualize multiple streams. I have 4
GtkWidgets  (grid of 4 GtkWidgets) displaying 4 video streams, upon click I
want to maximize selected window and upon another click minimize back to 4
Widget view.

I am developing it using Clutter-gtk and clutter-gst. It works the way I
want in Clutter-gst-2.0, but I want to port it to clutter-gst-3.0 and
utilize VAAPI hardware acceleration.
The application works and it renders video to 4 Widgets upon start,
unfortunately, upon click to get back to 4 grid view, the application
crashes.
But when supplying this pipeline with avdec_h264 encoder instead of
vaapih264dec, it runs perfectly:
    gst_bin_add_many(GST_BIN(pipeline), videodepay, videoparse, videodec,
videoconv, sink, NULL);


Initially using vaapih264dec, the application quit with error:
libGL error: failed to create drawable
After supplying "intel" driver to xorg.conf, I no more experience this
error, but the application still scrashes.
I am running latest Debian with Gstreamer version 1.10.4-1 which should
support VAAPI.

There is also another way of rendering the video together with use of GTK
and it is the OVERLAY approach which I was writing initially, it works but I
wanted to take advantage of OpenGL clutter rendering because of my other
applications written the same way.

Thank you very much
Best regards,
Ivo




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
On the other hand, assuming avdec_h264 is a gstreamer library, wrapper,
whatever to libav library
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-libav-plugins/html/gst-libav-plugins-plugin-libav.html
or codecs. And according to this:
https://wiki.libav.org/Hardware/vaapi
Could it be possible that when using avdec_h264, could avdec_h264 be in
theory also accelerated via VAAPI?
I have very low CPU usage when using avdec_h264 on latest Debian.
Does anyone know how to get to know how avdec_h264 is linked to libav and
with what compile flags it was compiled with?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

Nicolas Dufresne-5


Le 10 janv. 2018 7:31 AM, "horai" <[hidden email]> a écrit :
On the other hand, assuming avdec_h264 is a gstreamer library, wrapper,
whatever to libav library
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-libav-plugins/html/gst-libav-plugins-plugin-libav.html
or codecs. And according to this:
https://wiki.libav.org/Hardware/vaapi
Could it be possible that when using avdec_h264, could avdec_h264 be in
theory also accelerated via VAAPI?
I have very low CPU usage when using avdec_h264 on latest Debian.
Does anyone know how to get to know how avdec_h264 is linked to libav and
with what compile flags it was compiled with?

avdec_h264 is always software. Small video won't use a lot of course indeed. About the crash, best is to file a bug, provide code to reproduce and a backtrace.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

Victor Jaquez
In reply to this post by horai
On Wed, 10 Jan 2018 at 02:22, horai wrote:

> Dear all,
>
> I am developing an application to visualize multiple streams. I have 4
> GtkWidgets  (grid of 4 GtkWidgets) displaying 4 video streams, upon click I
> want to maximize selected window and upon another click minimize back to 4
> Widget view.
>
> I am developing it using Clutter-gtk and clutter-gst. It works the way I
> want in Clutter-gst-2.0, but I want to port it to clutter-gst-3.0 and
> utilize VAAPI hardware acceleration.
> The application works and it renders video to 4 Widgets upon start,
> unfortunately, upon click to get back to 4 grid view, the application
> crashes.

What's the backtrace?

> But when supplying this pipeline with avdec_h264 encoder instead of
> vaapih264dec, it runs perfectly:
>     gst_bin_add_many(GST_BIN(pipeline), videodepay, videoparse, videodec,
> videoconv, sink, NULL);
>
>
> Initially using vaapih264dec, the application quit with error:
> libGL error: failed to create drawable
> After supplying "intel" driver to xorg.conf, I no more experience this
> error, but the application still scrashes.
> I am running latest Debian with Gstreamer version 1.10.4-1 which should
> support VAAPI.

Can you upgrade to the current stable: 1.12?

>
> There is also another way of rendering the video together with use of GTK
> and it is the OVERLAY approach which I was writing initially, it works but I
> wanted to take advantage of OpenGL clutter rendering because of my other
> applications written the same way.
>
> Thank you very much
> Best regards,
> Ivo
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
In reply to this post by Nicolas Dufresne-5
Ok, I got a Netbeans backtrace

��?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
?? ()
g_main_context_dispatch ()
?? ()
g_main_loop_run ()
gtk_main ()
main (argc=1, argv=0x7fffffffdff8)

I don't think this helps much, I am not skilled in GDB should I use that for
a meaningful output?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
Ok, I ran my application in GDB and this is a result from command bt:

Thread 1 "gstreamergtkclu" received signal SIGSEGV, Segmentation fault.
0x00007fffe920f57f in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
Ok, I have Intel HD4000 accesible via kernel driver i915, actually, according
to this, there is no info about VAAPI for HD 4000
https://wiki.archlinux.org/index.php/Hardware_video_acceleration#Installing_VA-API

The error I have is related to i965, could it be the VAAPI is calling i965
which is not even loaded?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
In reply to this post by horai
But, could anyone explain me why my application is loading  this at start
(only with vaapih264dec not with avdec_h264)?
libva info: VA-API version 0.39.4
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.4
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

Well, is VAAPI working or is VAAPI not working?






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: VAAPI + clutter

BGraaf
Try 'vainfo' and you see the vaapi-support

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von horai
Gesendet: Donnerstag, 11. Januar 2018 20:42
An: [hidden email]
Betreff: Re: VAAPI + clutter

But, could anyone explain me why my application is loading  this at start
(only with vaapih264dec not with avdec_h264)?
libva info: VA-API version 0.39.4
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.4
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

Well, is VAAPI working or is VAAPI not working?






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: VAAPI + clutter

horai
vainfo yields:
libva info: VA-API version 0.39.4
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.3)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile -
1.7.3
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

According to dmesg I have this:
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor
Graphics Controller (rev 09) (prog-if 00 [VGA controller])
According to this;
https://wiki.gentoo.org/wiki/Intel
3.gen cores have no VAAPI suport.

Do you agree with me? So why it even tries 965 libraries?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

Victor Jaquez
In reply to this post by horai
As you may notice, that backtrace is useless. You would need to install the
debug packages in order to get a proper backtrace that would get us some idea.

In the meantime, I'd suggest you to open a bug in bugzilla, in the
gstreamer-vaapi component, detailing you crash, with the backtrace. (If you're
using arch linux or gentoo, then you should recompile gstreamer with debug flag)

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

On Thu, 11 Jan 2018 at 11:07, horai wrote:

> Ok, I got a Netbeans backtrace
>
> ��?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> ?? ()
> g_main_context_dispatch ()
> ?? ()
> g_main_loop_run ()
> gtk_main ()
> main (argc=1, argv=0x7fffffffdff8)
>
> I don't think this helps much, I am not skilled in GDB should I use that for
> a meaningful output?
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

Victor Jaquez
In reply to this post by horai
On Thu, 11 Jan 2018 at 12:41, horai wrote:

> But, could anyone explain me why my application is loading  this at start
> (only with vaapih264dec not with avdec_h264)?
> libva info: VA-API version 0.39.4
> 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.4
> 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
>
> Well, is VAAPI working or is VAAPI not working?

It is working.

Gstreamer-vaapi open 2 times the connection at the beginning for registering
purposes and the third is for the video processing itself.

In recent versions of libva and gstreamer-vaapi those messages are not printed
anymore in console.

>
>
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: VAAPI + clutter

horai
Thank you very much, could it be that there is a bug in the library causing
Gstreamer to crash?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel