Va-api ofVideoPlayer error intel and nvidia Linux

Hi all,

I have installed openFrameworks in two machines with fedora 35, and in both machines I have problem to reproduce video, and also to grab the video from the webcam. I am using the examples video player and video grabber, besides one of my patchs that used to work in fedora 34.

the first machine has a Intel Ivybridge (Gen7). With the example ofVideoPlayer I’ve got the white screen of the patch and in the terminal appears this error:

DtsGetHWFeatures: Create File Failed                                                                                                                                      
DtsGetHWFeatures: Create File Failed                                                                                                                                      
Running DIL (3.22.0) Version                                                                                                                                              
DtsDeviceOpen: Opening HW in mode 0                                                                                                                                       
DtsDeviceOpen: Create File Failed                                                                                                                                         
[notice ] ofGstUtils: Got context from element 'vaapipostproc0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";          
                                                                                                                                                                          
[notice ] ofGstUtils: Got context from element 'vaapipostproc0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx0",
 gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx0";

DtsGetHWFeatures: Create File Failed                                                                                                                                      
DtsGetHWFeatures: Create File Failed                                                                                                                                      
Running DIL (3.22.0) Version                                                                                                                                              
DtsDeviceOpen: Opening HW in mode 0                                                                                                                                       
DtsDeviceOpen: Create File Failed                                                                                                                                         
[notice ] ofGstUtils: Got context from element 'vaapipostproc0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";          
                                                                                                                                                                          
[notice ] ofGstUtils: Got context from element 'vaapipostproc0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx0",
 gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx0";    
    

I assumed that is something with the va-api of the intel card and gstreamer but the following gstreamer command works perfect:

gst-launch-1.0 -v filesrc location=./fingers.mov !  qtdemux ! vaapidecodebin ! vaapisink fullscreen=true

regarding the ofVideoGrabber I get this error:

[verbose] ofGstUtils: gstreamer inited
[notice ] ofGstVideoGrabber: Probing devices with udev...
[notice ] ofGstVideoGrabber: Found device 0ac8:c40a, getting capabilities...
[notice ] ofGstVideoGrabber: detected v4l2 device: A4 TECH USB2.0 PC Camera J
[notice ] ofGstVideoGrabber: driver: uvcvideo, version: 332037
[notice ] ofGstVideoGrabber: Capabilities: 0x84A00001
[notice ] ofGstVideoGrabber: Found device 0ac8:c40a, getting capabilities...
[notice ] ofGstVideoGrabber: detected v4l2 device: A4 TECH USB2.0 PC Camera J
[notice ] ofGstVideoGrabber: driver: uvcvideo, version: 332037
[notice ] ofGstVideoGrabber: Capabilities: 0x84A00001
[notice ] device /dev/video1 seems to not have the capture capability, (radio tuner/metadata device?)
[notice ] removing it from device list
[verbose] ofGstVideoGrabber: listDevices(): device 0: /dev/video0: A4 TECH USB2.0 PC Camera J
[notice ] 0: A4 TECH USB2.0 PC Camera J
[verbose] Device: A4 TECH USB2.0 PC Camera J (/dev/video0)

[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2640x480 videoformat: 4 framerates: 
[verbose] 30/1 
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2352x288 videoformat: 4 framerates: 
[verbose] 30/1 
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2320x240 videoformat: 4 framerates: 
[verbose] 30/1 
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2176x144 videoformat: 4 framerates: 
[verbose] 30/1 
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2160x120 videoformat: 4 framerates: 
[verbose] 30/1 
[notice ] ofGstVideoGrabber: initGrabber(): selected device: A4 TECH USB2.0 PC Camera J
[notice ] ofGstVideoGrabber: initGrabber(): selected format: 320x240 video/x-raw YUY2 framerate: 30/1
[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=YUY2,width=320,height=240,framerate=30/1  ! videoconvert   ! appsink name=ofappsink enable-last-sample=0 caps="video/x-raw, format=RGB, width=320, height=240"
[verbose] ofGstUtils: startPipeline(): attaching callbacks
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from src
[verbose] Pipeline is live and does not need PREROLL waiting PLAY
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from pipeline1
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from src
make: *** [/home/pemb/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:184: run] Segmentation fault (core dumped)

The gstreamer command gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! xvimagesink gives me the same error so I assumes is something to do with gstreamer and not OF. Cheese works perfect.

In the nvidia machine the video player gets segmentation fault immediately using both nvidia and intel.

So at least for the video player I assumes that it is something to do with openFrameworks and the hardware acceleration. Is there a workaround without uninstalling drivers?

by the way: GStreamer Core Library version 1.20.0, OF stable release.

thanks

I checked the github page and it seems the issue is gstreamer 1.20 and the hardware decoding. Therefore, it is a known problem. I uninstalled gstreamer1-vaapi package but I’ve got segmentation fault in the videoPlayer example (with the package the example is opened but no video is shown). I hope this can be sorted out, meanwhile I will attempt to reimplement the patch with ofxHapPlayer, which works.

On the other hand this code works for the webcam in gstream, so it is not gstream as such as I pointed in the previous post.

gst-launch-1.0 v4l2src name=video_source device=/dev/video0 ! videoconvert ! videoscale ! queue ! videoconvert ! ximagesink name=img_origin