You are not logged in.

#1 2017-07-12 14:44:02

zx
Member
Registered: 2014-09-17
Posts: 22

Gstreamer and hardware video encoding/decoding

Hi,

I want to use hardware decoding with nvidia GPU with gstramer.
But from some reason it doens't work.

$ vdpauinfo         
display: :0   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  381.22  Thu May  4 00:21:02 PDT 2017

Video surface:

name   width height types
-------------------------------------------
420     4096  4096  NV12 YV12 
422     4096  4096  UYVY YUYV 

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                           0 65536  4080  4080
MPEG2_SIMPLE                    3 65536  4080  4080
MPEG2_MAIN                      3 65536  4080  4080
H264_BASELINE                  41 65536  4096  4096
H264_MAIN                      41 65536  4096  4096
H264_HIGH                      41 65536  4096  4096
VC1_SIMPLE                      1  8190  2048  2048
VC1_MAIN                        2  8190  2048  2048
VC1_ADVANCED                    4  8190  2048  2048
MPEG4_PART2_SP                  3  8192  2048  2048
MPEG4_PART2_ASP                 5  8192  2048  2048
DIVX4_QMOBILE                   0  8192  2048  2048
DIVX4_MOBILE                    0  8192  2048  2048
DIVX4_HOME_THEATER              0  8192  2048  2048
DIVX4_HD_1080P                  0  8192  2048  2048
DIVX5_QMOBILE                   0  8192  2048  2048
DIVX5_MOBILE                    0  8192  2048  2048
DIVX5_HOME_THEATER              0  8192  2048  2048
DIVX5_HD_1080P                  0  8192  2048  2048
H264_CONSTRAINED_BASELINE      41 65536  4096  4096
H264_EXTENDED                  41 65536  4096  4096
H264_PROGRESSIVE_HIGH          41 65536  4096  4096
H264_CONSTRAINED_HIGH          41 65536  4096  4096
H264_HIGH_444_PREDICTIVE       41 65536  4096  4096
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    y  Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8 
R10G10B10A2      16384 16384    y  Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8 

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         16384 16384
R8G8B8A8         16384 16384
R10G10B10A2      16384 16384
B10G10R10A2      16384 16384
A8               16384 16384

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             y
DEINTERLACE_TEMPORAL_SPATIAL     y
INVERSE_TELECINE                 y
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        y
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y         1     4096
VIDEO_SURFACE_HEIGHT             y         1     4096
CHROMA_TYPE                      y  
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y  
CSC_MATRIX                       y  
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y  
LUMA_KEY_MAX_LUMA                y  
$ vainfo 
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'vdpau'
libva info: Trying to open /usr/lib/dri/vdpau_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      VAProfileH264Baseline           : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
$ gst-inspect-1.0 vdpau
Plugin Details:
  Name                     vdpau
  Description              Various elements utilizing VDPAU
  Filename                 /usr/lib/gstreamer-1.0/libgstvdpau.so
  Version                  1.12.1
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      2017-06-20
  Binary package           GStreamer Bad Plugins (Arch Linux)
  Origin URL               http://www.archlinux.org/

  vdpaumpegdec: VDPAU Mpeg Decoder

  1 features:
  +-- 1 elements
$ gst-inspect-1.0 vaapi
Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
  Version                  1.12.1
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      2017-06-20
  Binary package           gstreamer-vaapi
  Origin URL               http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer


  0 features:

Any idea why I don't have any decoders on gstreamer side?
I installed everything for gstreamer, vdpau, and vaapi.

For example:

$ gst-launch-1.0 filesrc location=simpsons.mp4 ! qtdemux ! h264parse ! vaapidecode ! vaapisink
WARNING: erroneous pipeline: no element "vaapidecode"

PS: For example here: http://forum.lemaker.org/thread-10992-1-1.html
You can see:

vaapiparse:  vaapiparse_h264: H.264 parser
vaapi:  vaapidecode: VA-API decoder
vaapi:  vaapipostproc: VA-API video postprocessing
vaapi:  vaapisink: VA-API sink

Last edited by zx (2017-07-12 14:50:45)

Offline

#2 2017-07-12 15:02:18

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Gstreamer and hardware video encoding/decoding

The gstreamer vdpau plugin hasn't seen development since forever, so who knows if it still works. And even if it does, only mpeg2 decoding was ported from gstreamer-0.8, so it isn't of much use anyway.

As for the vdpau-vaapi wrapper (libva-vdpau-driver), it hasn't seen development for almost 5 years now, there's been a lot of changes in vaapi since then. HW decode wrappers are crap anyway (the other wrapper, libvdpau-va-gl, has so much overhead you're better off with software decoding).

Basically, forget about Nvidia hardware decoding with gstreamer.

Last edited by Gusar (2017-07-12 15:07:51)

Offline

#3 2017-07-12 15:17:38

zx
Member
Registered: 2014-09-17
Posts: 22

Re: Gstreamer and hardware video encoding/decoding

Really?
Crap as ....

Any idea how to get HW decoding? Doesn't matter it's nvidia, intel, radeon, gstreamer, and other soft.

I had an idea to use raspberry pi, but  will not works for me too (other device which I need doesn't work on RPI);-/

Offline

#4 2017-07-12 15:19:30

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Gstreamer and hardware video encoding/decoding

Gusar wrote:

the other wrapper, libvdpau-va-gl, has so much overhead you're better off with software decoding.

This is not even relevant. libvdpau-va-gl is used to add support on VDPAU for intel driver, which natively supports only VAAPI.

Offline

#5 2017-07-12 15:23:27

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Gstreamer and hardware video encoding/decoding

What if you replace vaapidecode with vdpaumpegdec? Seems like it is available via gst-plugins-bad according to your gst-inspect result on vdpau.

P.S. not sure what you should vaapisink be replaced with though...

Also why not ffmpeg? https://trac.ffmpeg.org/wiki/HWAccelIntro

Last edited by tom.ty89 (2017-07-12 15:26:24)

Offline

#6 2017-07-12 15:24:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,627

Re: Gstreamer and hardware video encoding/decoding

Use a player/decoder that properly implements VDPAU. What is your actual issue, what is your end goal?

Online

#7 2017-07-12 15:36:16

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Gstreamer and hardware video encoding/decoding

zx wrote:

Any idea how to get HW decoding? Doesn't matter it's nvidia, intel, radeon, gstreamer, and other soft.

I had an idea to use raspberry pi, but  will not works for me too (other device which I need doesn't work on RPI);-/

On Nvidia, use anything that supports VDPAU natively. Which is basically everything but gstreamer. VLC or mpv would be my choices for a player.

On Intel, use anything that supports VAAPI natively. A lot of software does, but I'll point out that VLC only supports VAAPI in copy-back mode, which is less efficient than zero-copy mode. The best choice is mpv. Gstreamer should in theory work well, but practice quite often doesn't match theory, though I think the fault lies more with the most used gstreamer-based player - Totem - rather than with gstreamer itself.

On AMD, the open source drivers have good support for both VDPAU and VAAPI, so take your pick smile

The Raspberry Pi has its own proprietary interfaces for video decoding, MMAL and OpenMAX. mpv has good support for MMAL. Then there's omxplayer which is quite good (as the name implies, it uses OpenMAX). Edit: VLC supports OpenMAX too, so that's another choice.

Last edited by Gusar (2017-07-12 15:42:43)

Offline

#8 2017-07-12 15:51:13

zx
Member
Registered: 2014-09-17
Posts: 22

Re: Gstreamer and hardware video encoding/decoding

V1del wrote:

Use a player/decoder that properly implements VDPAU. What is your actual issue, what is your end goal?

The idea is to build FPV with rasppbery pi and use HDK2 as a display.

I tried setup HDK2 on RPI, but from what I see this will not work. Maybe I will find other small board with hardware decoding.
I can use RPI as transmitter, but as a receiver I have to use PC (in general).
Only HW decoding is acceptable.

That's why I'm asking how to get it working.

Maybe I have to decide DO NOT use OSVR and buy really simple HD FPV display which will work with RPI.

Offline

#9 2017-07-12 16:03:30

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Gstreamer and hardware video encoding/decoding

zx wrote:

The idea is to build FPV with rasppbery pi and use HDK2 as a display.

Then check out places specifically for the RPi (there's lots of RPi forums and such around), very likely this has been done already.

Offline

#10 2017-07-12 16:21:01

zx
Member
Registered: 2014-09-17
Posts: 22

Re: Gstreamer and hardware video encoding/decoding

Gusar wrote:
zx wrote:

The idea is to build FPV with rasppbery pi and use HDK2 as a display.

Then check out places specifically for the RPi (there's lots of RPi forums and such around), very likely this has been done already.

I did it:) I found wifibroadcast. But I need something for OSVR for now... I will see where I will go...

Thank you all for help!

Offline

Board footer

Powered by FluxBB