nvdec and vaapi with cerbero

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

nvdec and vaapi with cerbero

Andressio
Hi,

Until a few days ago I was successfully using gstreamer v1.14 with vaapi to decode up to 4 rtsp h264 streams each of which of resolution 3840x2160 exploiting the Intel dedicated module. Gstreamer was installed from Ubuntu repositories. A sample working pipeline was:
gst-launch-1.0 rtspsrc location="rtsp://root:root@192.168.0.91:554/axis-media/media.amp?videocodec=h264&resolution=3840x2160&fps=25" protocols=GST_RTSP_LOWER_TRANS_TCP latency=0 ! rtph264depay ! queue ! vaapih264dec ! videoconvert ! fpsdisplaysink sync=false

But the requirements have changed and the streams should become 5K (4864x3248). My investigations led to the following conclusions:
  1. h264 streams bigger than 4096x4096 cannot be decoded in hardware, only in software
  2. theoretically h265 streams can be decoded in hardware up to 8192x8192
  3. with the Intel+vaapi i am not able to decode h265 streams bigger than 4096
  4. some hints tell me that the Nvidia RTX 2080 I have can perform decoding of h265 up to 8192x8192
As the plugin nvdec was not installed I've built Gstreamer 1.16 with Cerberus. I've followed the streps of the git page skipping the Intel Hardware Codecs as while compiling the file mfxvideo.h of the Intel Media SDK could not be located.
In the end I have the nvdec plugin but not the vaapi ones. But one problem at a time. Now that I have nvdec I've tried various pipeline to decode both h264 and h265 streams but the best I could achieve is a completely green screen with this pipeline for h264:
gst-launch-1.0 rtspsrc location="rtsp://root:root@192.168.0.91:554/axis-media/media.amp?videocodec=h264&resolution=3840x2160&fps=25" protocols=GST_RTSP_LOWER_TRANS_TCP latency=0 ! rtph264depay ! h264parse ! nvdec ! gldownload ! fpsdisplaysink sync=false

and this piepline for this h265 video:
gst-launch-1.0 filesrc location="tears.mkv" ! matroskademux ! h265parse ! nvdec ! gldownload ! fpsdisplaysink

As I said I only see a green frame but the frame counter of the fspdisplaysink is increasing. So my questions are:
  1. What is a correct pipeline than can decode a stream with Nvidia gpu and output rgb frames?
  2. How to install vaapi with Cerberus? Its absence is due to the fact that I have skipped the Intel Hardware Codecs to install gstreamer?
Thanks a lot

Sent from the GStreamer-devel mailing list archive at 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: nvdec and vaapi with cerbero

Andressio
Sorry, Cerbero, not Cerberus.
Any suggestions?



--
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: nvdec and vaapi with cerbero

Nicolas Dufresne-5


Le mer. 8 mai 2019 06 h 56, Andressio <[hidden email]> a écrit :
Sorry, Cerbero, not Cerberus.
Any suggestions?

I don't remember if VAAPI/nvdec has been integrated. Look in the recipes folder to see if GStreamer-vaapi is present (if so, it might be under a variant, see -v command argument). For nvenc, check in the file list of -bad reciepe. Both have dependencies that might not be met yet.




--
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: nvdec and vaapi with cerbero

Andressio
Nicolas Dufresne-5 wrote
For nvenc, check in the file list of -bad reciepe
With Cerbero I have nvdec and nvenc but I am not able to set up a decoding pipeline that uses nvdec and generates raw rgb frames in memory that I can access via appsink. Can you provide an example?
Nicolas Dufresne-5 wrote
I don't remember if VAAPI/nvdec has been integrated. Look in the recipes folder to see if GStreamer-vaapi is present
For what concerns VAAPI I will look as soon as I can

Sent from the GStreamer-devel mailing list archive at 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: nvdec and vaapi with cerbero

RiccardoCagnasso
In reply to this post by Andressio
You can decode videos up to 8K with intel video cards and vaapi using the new
intel-media-driver

https://github.com/intel/media-driver

nvdec would also work, if you manage to build it



--
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: nvdec and vaapi with cerbero

Andressio
RiccardoCagnasso wrote
nvdec would also work, if you manage to build it
I was able do build nvdec. Can you provide a sample working gstreamer pipeline that uses nvdec?

Sent from the GStreamer-devel mailing list archive at 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: nvdec and vaapi with cerbero

Andressio
RiccardoCagnasso wrote
You can decode videos up to 8K with intel video cards and vaapi using the new intel-media-driver
https://github.com/intel/media-driver
After installing the iHD driver following the steps you provided, I've set the following environment variables:
  • LD_LIBRARY_PATH=path_to_installed_driver_lib
  • LIBVA_DRIVERS_PATH=path_to_installed_driver_lib/dri
  • LIBVA_DRIVER_NAME=iHD
  • GST_VAAPI_ALL_DRIVERS=1
vainfo correctly opens the iHD driver and shows all the supported profiles and entrypoints. gst-instpect vaapi shows all the vaapi encoder/decoder but also prints the following lines:

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0


and repeatedly the following error lines while decoding a sample 4k video:

** (gst-launch-1.0:5765): CRITICAL **: 15:09:29.695: gst_vaapi_mini_object_unref: assertion 'object != NULL' failed
** (gst-launch-1.0:5765): CRITICAL **: 15:09:29.727: gst_vaapi_surface_associate_subpicture: assertion 'subpicture != NULL' failed


anyway the video is displayed. All the above messages where not printed when I used the older stock driver i965. I am trying the iHD because I need to decode a video with resolution 5472x3648. I have a sample video recorded directly from a h265 camera with that resolution and I am able to decode and see frames using a software decoder like this:

gst-launch-1.0 filesrc location="sample.h265" ! video/x-h265 ! h265parse ! avdec_h265 ! autovideosink sync=true

but switching to the vaapi version with new intel-media-driver iHD:

gst-launch-1.0 filesrc location="sample.h265" ! video/x-h265 ! h265parse ! vaapih265dec ! autovideosink sync=true

I get the following error:

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'autovideosink0-actual-sink-vaapi': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx1";
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode_h265:vaapidecode_h265-0: No valid frames decoded before end of stream
Additional debug info:
../../../../gst-libs/gst/video/gstvideodecoder.c(1139): gst_video_decoder_sink_event_default (): /GstPipeline:pipeline0/GstVaapiDecode_h265:vaapidecode_h265-0:
no valid frames found
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


When with the older i965 driver I got the following:

Pipeline is PREROLLING ...
Got context from element 'autovideosink0-actual-sink-vaapi': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx1";
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode_h265:vaapidecode_h265-0: Decoding error
Additional debug info:
../../../gst/vaapi/gstvaapidecode.c(764): gst_vaapidecode_handle_frame (): /GstPipeline:pipeline0/GstVaapiDecode_h265:vaapidecode_h265-0: Decode error -1
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


Any advice on how to setup gstreamer to decode h265 videos of that size (5472x3648) in hardware?
My specs: Ubuntu 18.01 | GStreamer 1.14 from repo | Intel i7-8700 | Nvidia RTX 2080

Sent from the GStreamer-devel mailing list archive at Nabble.com.

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