VASurface to OpengGL Texture and other questions
Arnaud Loonstra
arnaud at z25.org
Wed Mar 18 01:28:39 PDT 2015
The pipeline looks good. I recall running a similar pipeline on nvidia
hardware using 14.10. I think even using the provided gstreamer (1.4.3)
Have you tried a different nvidia driver? Usually multiple versions are
supplied or nvidia provides a newer one.
There are also examples of openGL context sharing available, including
a new one since last Gst hack fest.
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=7dd3a2ec9e27473bde9f636581fd7e71d59d1df3
This questions pops every now and then. I think we're in the need of a
good reference where the answer to this question is explained.
Rg,
Arnaud
On 2015-03-18 08:31, Jorge Fernandez Monteagudo wrote:
> Hi,
>
> I'm back to my troubles with VAAPI and OpenGL :)
>
> I've installed the last gstreamer/gst-plugins 1.4.5 and
> gstreamer-vaapi-0.5.9 in my
> Ubuntu 14.04 workstation with vdpau 0.7 and NVIDIA VDPAU Driver
> Shared Library 331.113
>
> I'm trying to test the zero copy to implement a video player embedded
> in a OpenGL
> application. First of all I've tested a VAAPI only pipeline and is
> working ok.
>
> gst-launch-1.0 filesrc location=big_buck_bunny_720p_surround.avi !
> avidemux ! vaapidecode ! vaapisink
>
> Then I've tried to use the OpenGL sink
>
> gst-launch-1.0 filesrc location=big_buck_bunny_720p_surround.avi !
> avidemux ! vaapidecode ! glimagesink
>
> but a SIGSEGV is generated. Is it expected to work this pipeline??
>
> I was thinking using this pipeline in my videoplayer because
> glimagesink is able to use an external context,
> 'other-context' property, an glx context created by my application,
> and has a signal, 'client-draw', where you
> can do the painting process with a given texture from the videoframe.
> Is it correct??
>
> The second option could be change glimagesink with the appsink then
> the message question. Is it possible
> to convert the VASurface I get from vaapidecode to a OpenGL texture?
> Any example?
>
> Anybody has implemented something similar? What's the way to go?
>
> In order to allow debugging the SIGSEGV here is the gdb backtrace:
>
>
> $ gdb /usr/local/bin/gst-launch-1.0 GNU gdb (Ubuntu
> 7.7.1-0ubuntu5~14.04.2) 7.7.1
> Copyright (C) 2014 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /usr/local/bin/gst-launch-1.0...done.
> (gdb) set args filesrc
>
> location=/home/jorge/develop/harware/videos/big_buck_bunny_720p_surround.avi
> ! avidemux ! vaapidecode ! glimagesink
> (gdb) r
> Starting program: /usr/local/bin/gst-launch-1.0 filesrc
>
> location=/home/jorge/develop/harware/videos/big_buck_bunny_720p_surround.avi
> ! avidemux ! vaapidecode ! glimagesink
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> libva info: VA-API version 0.35.0
> libva info: va_getDriverName() returns 0
> libva info: Trying to open
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> libva info: Found init function __vaDriverInit_0_32
> libva info: va_openDriver() returns 0
> Setting pipeline to PAUSED ...
> [New Thread 0x7fffeb2fb700 (LWP 32254)]
> Pipeline is PREROLLING ...
> [New Thread 0x7fffeaafa700 (LWP 32255)]
> Got context from element 'vaapidecode0': gst.vaapi.Display=context,
> display=(GstVaapiDisplay)NULL;
> Got context from element 'glimagesink0': gst.gl.GLDisplay=context,
> gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
> [New Thread 0x7fffea2f9700 (LWP 32256)]
> [New Thread 0x7fffe96f4700 (LWP 32257)]
> Pipeline is PREROLLED ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7fffea2f9700 (LWP 32256)]
> 0x00007fffebbcb589 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> (gdb) bt
> #0 0x00007fffebbcb589 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> #1 0x00007fffebbc8ff5 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> #2 0x00007ffff40e042f in _gst_vaapi_texture_put_surface (flags=0,
> surface=0x7fffe400f700, texture=<optimized out>) at
> gstvaapitexture.c:510
> #3 gst_vaapi_texture_put_surface (texture=0x60d760,
> surface=0x7fffe400f700, flags=0) at gstvaapitexture.c:606
> #4 0x00007fffedc1a4ec in _do_upload_with_meta (context=<optimized
> out>, upload=0x7fffe40112c0) at gstglupload.c:357
> #5 0x00007fffedc1bd88 in _run_message_sync (message=0x7fffe96f3730)
> at gstglwindow.c:353
> #6 0x00007fffedc205b2 in _run_message (message=0x7fffd4002820) at
> gstglwindow_x11.c:598
> #7 0x00007ffff75bece5 in g_main_context_dispatch () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #8 0x00007ffff75bf048 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #9 0x00007ffff75bf30a in g_main_loop_run () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #10 0x00007fffedc0aac9 in gst_gl_context_create_thread
> (context=0x7fffe400c330) at gstglcontext.c:959
> #11 0x00007ffff75e3f05 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #12 0x00007ffff7360182 in start_thread (arg=0x7fffea2f9700) at
> pthread_create.c:312
> #13 0x00007ffff708d00d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> (gdb) info thr
> Id Target Id Frame
> 5 Thread 0x7fffe96f4700 (LWP 32257) "vaapidecode0:sr"
> pthread_cond_wait@@GLIBC_2.3.2 () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> * 4 Thread 0x7fffea2f9700 (LWP 32256) "gstglcontext"
> 0x00007fffebbcb589 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> 3 Thread 0x7fffeaafa700 (LWP 32255) "gmain" 0x00007ffff707fcbd
> in poll () at ../sysdeps/unix/syscall-template.S:81
> 2 Thread 0x7fffeb2fb700 (LWP 32254) "avidemux0:sink"
> __lll_lock_wait () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
> 1 Thread 0x7ffff7fd4740 (LWP 32250) "gst-launch-1.0"
> 0x00007ffff707fcbd in poll () at
> ../sysdeps/unix/syscall-template.S:81
> (gdb) thr 1
> [Switching to thread 1 (Thread 0x7ffff7fd4740 (LWP 32250))]
> #0 0x00007ffff707fcbd in poll () at
> ../sysdeps/unix/syscall-template.S:81
> 81 ../sysdeps/unix/syscall-template.S: No such file or
> directory.
> (gdb) bt
> #0 0x00007ffff707fcbd in poll () at
> ../sysdeps/unix/syscall-template.S:81
> #1 0x00007ffff75befe4 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #2 0x00007ffff75bf30a in g_main_loop_run () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #3 0x00007ffff7b0c974 in gst_bus_poll (bus=bus at entry=0x6fe6f0,
> events=events at entry=GST_MESSAGE_ANY, timeout=<optimized out>) at
> gstbus.c:1091
> #4 0x0000000000404608 in event_loop (pipeline=0x77c150,
> blocking=blocking at entry=1, do_progress=do_progress at entry=0,
> target_state=target_state at entry=GST_STATE_PLAYING)
> at gst-launch.c:512
> #5 0x00000000004037c6 in main (argc=9, argv=0x7fffffffda88) at
> gst-launch.c:1090
> (gdb) thr 2
> [Switching to thread 2 (Thread 0x7fffeb2fb700 (LWP 32254))]
> #0 __lll_lock_wait () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
> 135 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No
> such file or directory.
> (gdb) bt
> #0 __lll_lock_wait () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
> #1 0x00007ffff7362672 in _L_lock_953 () from
> /lib/x86_64-linux-gnu/libpthread.so.0
> #2 0x00007ffff73624da in __GI___pthread_mutex_lock (mutex=0x768710)
> at ../nptl/pthread_mutex_lock.c:114
> #3 0x00007ffff4dd406f in gst_video_decoder_chain (pad=<optimized
> out>, parent=0x769790, buf=0x7fffe4003c10) at gstvideodecoder.c:2149
> #4 0x00007ffff7b35958 in gst_pad_chain_data_unchecked
> (data=0x7fffe4003c10, type=4112, pad=0x70a480) at gstpad.c:3830
> #5 gst_pad_push_data (pad=0x70b1a0, type=type at entry=4112,
> data=<optimized out>) at gstpad.c:4063
> #6 0x00007ffff7b3c806 in gst_pad_push (pad=<optimized out>,
> buffer=<optimized out>) at gstpad.c:4174
> #7 0x00007ffff56accb7 in gst_avi_demux_loop_data (avi=<optimized
> out>) at gstavidemux.c:5244
> #8 gst_avi_demux_loop (pad=<optimized out>) at gstavidemux.c:5623
> #9 0x00007ffff7b63571 in gst_task_func (task=0x80b050) at
> gsttask.c:316
> #10 0x00007ffff75e488c in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #11 0x00007ffff75e3f05 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #12 0x00007ffff7360182 in start_thread (arg=0x7fffeb2fb700) at
> pthread_create.c:312
> #13 0x00007ffff708d00d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> (gdb) thr 3
> [Switching to thread 3 (Thread 0x7fffeaafa700 (LWP 32255))]
> #0 0x00007ffff707fcbd in poll () at
> ../sysdeps/unix/syscall-template.S:81
> 81 ../sysdeps/unix/syscall-template.S: No such file or
> directory.
> (gdb) bt
> #0 0x00007ffff707fcbd in poll () at
> ../sysdeps/unix/syscall-template.S:81
> #1 0x00007ffff75befe4 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #2 0x00007ffff75bf0ec in g_main_context_iteration () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #3 0x00007ffff75bf129 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #4 0x00007ffff75e3f05 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #5 0x00007ffff7360182 in start_thread (arg=0x7fffeaafa700) at
> pthread_create.c:312
> #6 0x00007ffff708d00d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> (gdb) thr 4
> [Switching to thread 4 (Thread 0x7fffea2f9700 (LWP 32256))]
> #0 0x00007fffebbcb589 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> (gdb) bt
> #0 0x00007fffebbcb589 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> #1 0x00007fffebbc8ff5 in ?? () from
> /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
> #2 0x00007ffff40e042f in _gst_vaapi_texture_put_surface (flags=0,
> surface=0x7fffe400f700, texture=<optimized out>) at
> gstvaapitexture.c:510
> #3 gst_vaapi_texture_put_surface (texture=0x60d760,
> surface=0x7fffe400f700, flags=0) at gstvaapitexture.c:606
> #4 0x00007fffedc1a4ec in _do_upload_with_meta (context=<optimized
> out>, upload=0x7fffe40112c0) at gstglupload.c:357
> #5 0x00007fffedc1bd88 in _run_message_sync (message=0x7fffe96f3730)
> at gstglwindow.c:353
> #6 0x00007fffedc205b2 in _run_message (message=0x7fffd4002820) at
> gstglwindow_x11.c:598
> #7 0x00007ffff75bece5 in g_main_context_dispatch () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #8 0x00007ffff75bf048 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #9 0x00007ffff75bf30a in g_main_loop_run () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #10 0x00007fffedc0aac9 in gst_gl_context_create_thread
> (context=0x7fffe400c330) at gstglcontext.c:959
> #11 0x00007ffff75e3f05 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #12 0x00007ffff7360182 in start_thread (arg=0x7fffea2f9700) at
> pthread_create.c:312
> #13 0x00007ffff708d00d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> (gdb) thr 5
> [Switching to thread 5 (Thread 0x7fffe96f4700 (LWP 32257))]
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> 185 ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
> No such file or directory.
> (gdb) bt
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> #1 0x00007ffff7600bf7 in g_cond_wait () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #2 0x00007fffedc1c4eb in gst_gl_window_default_send_message
> (window=0x7fffe400e020, callback=<optimized out>, data=<optimized
> out>) at gstglwindow.c:379
> #3 0x00007fffedc0b43d in gst_gl_context_thread_add
> (context=<optimized out>, func=func at entry=0x7fffedc1a4b0
> <_do_upload_with_meta>, data=data at entry=0x7fffe40112c0)
> at gstglcontext.c:1104
> #4 0x00007fffedc1aa9c in
> gst_gl_upload_perform_with_gl_texture_upload_meta
> (upload=upload at entry=0x7fffe40112c0, meta=meta at entry=0x7fffe4017418,
> texture_id=texture_id at entry=0x7fffe96f3830) at gstglupload.c:407
> #5 0x00007fffedc1ad17 in gst_gl_upload_perform_with_buffer
> (upload=0x7fffe40112c0, buffer=buffer at entry=0x7fffe4003280,
> tex_id=tex_id at entry=0x77ace8)
> at gstglupload.c:299
> #6 0x00007fffede3ff55 in gst_glimage_sink_prepare (bsink=0x77a950,
> buf=0x7fffe4003280) at gstglimagesink.c:759
> #7 0x00007ffff58dd2a1 in gst_base_sink_chain_unlocked
> (basesink=basesink at entry=0x77a950, obj=obj at entry=0x7fffe4003280,
> is_list=is_list at entry=0, pad=<optimized out>)
> at gstbasesink.c:3375
> #8 0x00007ffff58deaf4 in gst_base_sink_chain_main
> (basesink=0x77a950, pad=<optimized out>, obj=0x7fffe4003280,
> is_list=0) at gstbasesink.c:3538
> #9 0x00007ffff7b35958 in gst_pad_chain_data_unchecked
> (data=0x7fffe4003280, type=4112, pad=0x70a8e0) at gstpad.c:3830
> #10 gst_pad_push_data (pad=0x70a6b0, type=type at entry=4112,
> data=<optimized out>, data at entry=0x7fffe4003280) at gstpad.c:4063
> #11 0x00007ffff7b3c806 in gst_pad_push (pad=<optimized out>,
> buffer=buffer at entry=0x7fffe4003280) at gstpad.c:4174
> #12 0x00007ffff4dd27af in gst_video_decoder_clip_and_push_buf
> (decoder=decoder at entry=0x769790, buf=buf at entry=0x7fffe4003280) at
> gstvideodecoder.c:2804
> #13 0x00007ffff4dd8628 in gst_video_decoder_finish_frame
> (decoder=decoder at entry=0x769790, frame=0x0,
> frame at entry=0x7fffe4003b00) at gstvideodecoder.c:2710
> #14 0x00007ffff4700aac in gst_vaapidecode_push_decoded_frame
> (out_frame=0x7fffe4003b00, vdec=0x769790) at gstvaapidecode.c:365
> #15 gst_vaapidecode_decode_loop (decode=0x769790) at
> gstvaapidecode.c:430
> #16 0x00007ffff7b63571 in gst_task_func (task=0x80b5f0) at
> gsttask.c:316
> #17 0x00007ffff75e488c in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #18 0x00007ffff75e3f05 in ?? () from
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> ---Type <return> to continue, or q <return> to quit---
> #19 0x00007ffff7360182 in start_thread (arg=0x7fffe96f4700) at
> pthread_create.c:312
> #20 0x00007ffff708d00d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
>
>
> Regards,
> Jorge
>
> Este mensaje se dirige exclusivamente a su destinatario y puede
> contener información privilegiada o CONFIDENCIAL. Si no es vd. el
> destinatario indicado, queda notificado de que la utilización,
> divulgación y/o copia sin autorización está prohibida en virtud de la
> legislación vigente. Si ha recibido este mensaje por error, le
> rogamos
> que nos lo comunique inmediatamente por esta misma vía y proceda a su
> destrucción.
>
> This message is intended exclusively for its addressee and may
> contain information that is CONFIDENTIAL and protected by
> professional
> privilege.
> If you are not the intended recipient you are hereby notified that
> any dissemination, copy or disclosure of this communication is
> strictly prohibited by law. If this message has been received in
> error, please immediately notify us via e-mail and delete it.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list