Cannot decode h264 using vaapi builded only with drm support

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

Cannot decode h264 using vaapi builded only with drm support

sonntex
I am trying to decode h264 stream using vaapi. As you can see gst-plugins-vaapi and libva builded with drm and withou X support:

sonntex@work ~ $ eix -I gst-plugins-vaapi
[I] media-plugins/gst-plugins-vaapi
     Available versions:  (1.0) ~0.6.1 0.7.0
       {+X +drm opengl wayland ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  0.7.0(1.0)(10:36:37 PM 04/21/2016)(drm -X -opengl -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://github.com/01org/gstreamer-vaapi
     Description:         Hardware accelerated video decoding through VA-API plugin

sonntex@work ~ $ eix -I libva
[I] x11-libs/libva
     Available versions:  1.3.1 ~1.4.0 ~1.4.1 ~1.5.0 ~1.5.1 ~1.6.0 ~1.6.1 1.6.2 ~1.7.0 **9999 {X +drm egl opengl vdpau wayland ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32" VIDEO_CARDS="dummy fglrx intel nouveau nvidia"}
     Installed versions:  1.6.2(10:36:18 PM 04/21/2016)(drm -X -egl -opengl -vdpau -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" VIDEO_CARDS="intel -dummy -fglrx -nouveau -nvidia")
     Homepage:            https://www.freedesktop.org/wiki/Software/vaapi
     Description:         Video Acceleration (VA) API for Linux

[I] x11-libs/libva-intel-driver
     Available versions:  1.3.0 ~1.4.1 ~1.5.0 ~1.5.1 ~1.6.0 ~1.6.1 1.6.2 ~1.7.0 **9999 {X +drm wayland ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.6.2(06:43:59 PM 04/20/2016)(drm -X -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://www.freedesktop.org/wiki/Software/vaapi
     Description:         HW video decode support for Intel integrated graphics

In this case gstreamer can not initialize vaapidecode element:

sonntex@work ~ $ GST_DEBUG=vaapi*:6 gst-launch-1.0 rtspsrc location=rtsp://192.168.50.90 ! rtph264depay ! vaapiparse_h264 ! vaapidecode ! fakesink
Setting pipeline to PAUSED ...
0:00:00.008910189 29483      0x251eaf0 INFO                   vaapi gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version 0.7.0
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0: Could not initialize supporting library.
Additional debug info:
/var/tmp/portage/media-libs/gst-plugins-base-1.8.1_pre/work/gst-plugins-base-1.8.1/gst-libs/gst/video/gstvideodecoder.c(2582): gst_video_decoder_change_state (): /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
Failed to open decoder
Setting pipeline to NULL ...
Freeing pipeline ...

Is this an error or should I build gst-plugins-vaapi and libva whit X support?

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

Re: Cannot decode h264 using vaapi builded only with drm support

Victor Jaquez
On 04/21/16 at 07:34pm, sonntex wrote:

> I am trying to decode h264 stream using vaapi. As you can see
> gst-plugins-vaapi and libva builded with drm and withou X support:
>
> sonntex@work ~ $ eix -I gst-plugins-vaapi
> [I] media-plugins/gst-plugins-vaapi
>      Available versions:  (1.0) ~0.6.1 0.7.0
>        {+X +drm opengl wayland ABI_MIPS="n32 n64 o32" ABI_PPC="32 64"
> ABI_S390="32 64" ABI_X86="32 64 x32"}
>      Installed versions:  0.7.0(1.0)(10:36:37 PM 04/21/2016)(drm -X -opengl
> -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64"
> ABI_X86="64 -32 -x32")
>      Homepage:            https://github.com/01org/gstreamer-vaapi
>      Description:         Hardware accelerated video decoding through
> VA-API plugin
>
> sonntex@work ~ $ GST_DEBUG=vaapi*:6 gst-launch-1.0 rtspsrc location=rtsp://
> 192.168.50.90 ! rtph264depay ! vaapiparse_h264 ! vaapidecode ! fakesink
> Setting pipeline to PAUSED ...
> 0:00:00.008910189 29483      0x251eaf0 INFO                   vaapi
> gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version 0.7.0
> ERROR: Pipeline doesn't want to pause.
> ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
> Could not initialize supporting library.
> Additional debug info:
> /var/tmp/portage/media-libs/gst-plugins-base-1.8.1_pre/work/gst-plugins-base-1.8.1/gst-libs/gst/video/gstvideodecoder.c(2582):
> gst_video_decoder_change_state ():
> /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
> Failed to open decoder
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Is this an error or should I build gst-plugins-vaapi and libva whit X
> support?

I guess you are using Gentoo. I wonder why it is not providing a recent
gstreamer-vaapi. Now gstreamer-vaapi follows the same version as GStreamer, the
latest version is 1.8.1, the same that you have installed.

What does the command vainfo reports you back?

Normally, VA-API should write in the console the version and the loaded
driver, but that is not your case. I wonder what video card do you have.

Can you try, to simplify the test, a local file playback with
GST_DEBUG=vaapi*:5 ?

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

Re: Cannot decode h264 using vaapi builded only with drm support

sonntex
In reply to this post by sonntex
I solve the error. Thank you for question about output of vaapi. There are no permissions for /dev/dri/*.

sonntex@work ~ $ vainfo
error: failed to initialize display
Aborted
sonntex@work ~ $ strace vainfo
execve("/usr/bin/vainfo", ["vainfo"], [/* 28 vars */]) = 0
brk(0)                                  = 0x12d9000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa417000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=42981, ...}) = 0
mmap(NULL, 42981, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb2aa40c000
close(3)                                = 0
open("/usr/lib64/libva.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0(\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=113040, ...}) = 0
mmap(NULL, 2210496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a9fdb000
mprotect(0x7fb2a9ff6000, 2093056, PROT_NONE) = 0
mmap(0x7fb2aa1f5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0x7fb2aa1f5000
close(3)                                = 0
open("/usr/lib64/libva-drm.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\n\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=10168, ...}) = 0
mmap(NULL, 2105512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a9dd8000
mprotect(0x7fb2a9dda000, 2093056, PROT_NONE) = 0
mmap(0x7fb2a9fd9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7fb2a9fd9000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa40b000
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\7\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1681152, ...}) = 0
mmap(NULL, 3788376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a9a3b000
mprotect(0x7fb2a9bce000, 2097152, PROT_NONE) = 0
mmap(0x7fb2a9dce000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x193000) = 0x7fb2a9dce000
mmap(0x7fb2a9dd4000, 15960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb2a9dd4000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14344, ...}) = 0
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a9837000
mprotect(0x7fb2a9839000, 2097152, PROT_NONE) = 0
mmap(0x7fb2a9a39000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fb2a9a39000
close(3)                                = 0
open("/usr/lib64/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340=\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=59776, ...}) = 0
mmap(NULL, 2157840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a9628000
mprotect(0x7fb2a9636000, 2093056, PROT_NONE) = 0
mmap(0x7fb2a9835000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7fb2a9835000
close(3)                                = 0
open("/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 U\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1038448, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa40a000
mmap(NULL, 3133784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb2a932a000
mprotect(0x7fb2a9427000, 2093056, PROT_NONE) = 0
mmap(0x7fb2a9626000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xfc000) = 0x7fb2a9626000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa409000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa408000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb2aa407000
arch_prctl(ARCH_SET_FS, 0x7fb2aa408700) = 0
mprotect(0x7fb2a9dce000, 16384, PROT_READ) = 0
mprotect(0x7fb2a9626000, 4096, PROT_READ) = 0
mprotect(0x7fb2a9835000, 4096, PROT_READ) = 0
mprotect(0x7fb2a9a39000, 4096, PROT_READ) = 0
mprotect(0x7fb2a9fd9000, 4096, PROT_READ) = 0
mprotect(0x7fb2aa1f5000, 4096, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ)     = 0
mprotect(0x7fb2aa418000, 4096, PROT_READ) = 0
munmap(0x7fb2aa40c000, 42981)           = 0
open("/dev/dri/renderD128", O_RDWR)     = -1 EACCES (Permission denied)
open("/dev/dri/card0", O_RDWR)          = -1 EACCES (Permission denied)
write(2, "error: failed to initialize disp"..., 35error: failed to initialize display) = 35
write(2, "\n", 1
)                       = 1
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 5142
tgkill(5152, 5152, SIGABRT)             = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=5152, si_uid=1000} ---
+++ killed by SIGABRT +++
Aborted
sonntex@work ~ $ ls -l /dev/dri
total 0
crw-rw---- 1 root video 226,   0 Apr 19 20:20 card0
crw-rw---- 1 root video 226,  64 Apr 19 20:20 controlD64
crw-rw---- 1 root video 226, 128 Apr 19 20:20 renderD128

So, if I run gstreamer under sudo or root, all work fine.

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

Re: Cannot decode h264 using vaapi builded only with drm support

Victor Jaquez
On 04/22/16 at 11:45am, sonntex wrote:

> sonntex@work ~ $ ls -l /dev/dri
> total 0
> crw-rw---- 1 root video 226,   0 Apr 19 20:20 card0
> crw-rw---- 1 root video 226,  64 Apr 19 20:20 controlD64
> crw-rw---- 1 root video 226, 128 Apr 19 20:20 renderD128
>
> So, if I run gstreamer under sudo or root, all work fine.

Don't do that!

Instead add your user to the 'video' group.

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

Re: Cannot decode h264 using vaapi builded only with drm support

sonntex
In reply to this post by sonntex
I run gstreamer under sudo or root only for test. So, I already added user to video group as you say. Thank you!

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel