Raspi 4: omxdec to EGLImage decoding

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

Raspi 4: omxdec to EGLImage decoding

Gert Glass
Hi,

I'm trying to port my application from the Raspberry Pi 3 (raspbian
jesse, gst 1.10.4) to the recently introduced Pi 4 (raspbian buster, gst
1.14.4).

The gst-launch equivalent of my apps pipeline is something like this:

  filesrc ... ! h264parse ! omxh264dec ! glupload ! glimagesink

Note that my app explictly needs the decoded frames rendered to EGLImages.

For some reason this stopped working with the new setup, I am not yet
sure if this is related to drivers or changes in gstreamer itself, I now
get the following non-helpful errors:

ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: Internal data stream error.
WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: streaming stopped, reason not-negotiated (-4)

I have found that the v4l2h264dec seems to be able to create a similar
pipeline, the following now works:
 
  filesrc ... ! h264parse ! v4l2h264dec ! glupload ! glimagesink

My remaining problem is that the v4l2h264dec/glupload pair do not use EGLImages from the
GstGLMemoryEGLAllocator, but instead uses the GstGLMemoryAllocator - I assume these are
GL textures instead of EGLImages.

I noticed gstupload.c has significatly changed from 1.10 to 1.14, but there still seems to be
a path available doing GST_GL_HAVE_PLATFORM_EGL.

I would be much obliged if someone could answer my questions:

- Is omxdec still supposed to be functional on the rpi4, and if so, what can be the cause of
  the above erros?

- If omxdec is not the right way to go, should I megrate to v4l2dec, and if so, how do I get it
  to use EGLImage buffers?

Thank you,

Gert


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

Re: Raspi 4: omxdec to EGLImage decoding

Nicolas Dufresne-5
Le jeudi 01 août 2019 à 09:47 +0200, Gert Glass a écrit :
> Hi,
>
> I'm trying to port my application from the Raspberry Pi 3 (raspbian
> jesse, gst 1.10.4) to the recently introduced Pi 4 (raspbian buster, gst
> 1.14.4).

On RPi 4 the preferred decoder is v4l2videodec.

>
> The gst-launch equivalent of my apps pipeline is something like this:
>
>   filesrc ... ! h264parse ! omxh264dec ! glupload ! glimagesink
>
> Note that my app explictly needs the decoded frames rendered to EGLImages.
>
> For some reason this stopped working with the new setup, I am not yet
> sure if this is related to drivers or changes in gstreamer itself, I now
> get the following non-helpful errors:
>
> ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
> ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
> WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
> ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
> ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
> WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
> ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
> ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
> WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
> ERROR                    omx gstomx.c:1154:gst_omx_component_set_parameter:<omxh264dec-omxh264dec0> Set video_decode parameter at index 0x02000001: Bad parameter (0x80001005)
> ERROR                    omx gstomx.c:1333:gst_omx_port_update_port_definition:<omxh264dec-omxh264dec0> Updated video_decode port 130 definition: Bad parameter (0x80001005)
> WARN            videodecoder gstvideodecoder.c:732:gst_video_decoder_setcaps:<omxh264dec-omxh264dec0> Subclass refused caps
> WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: Internal data stream error.
> WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: streaming stopped, reason not-negotiated (-4)
>
> I have found that the v4l2h264dec seems to be able to create a similar
> pipeline, the following now works:
>  
>   filesrc ... ! h264parse ! v4l2h264dec ! glupload ! glimagesink
>
> My remaining problem is that the v4l2h264dec/glupload pair do not use EGLImages from the
> GstGLMemoryEGLAllocator, but instead uses the GstGLMemoryAllocator - I assume these are
> GL textures instead of EGLImages.
>
> I noticed gstupload.c has significatly changed from 1.10 to 1.14, but there still seems to be
> a path available doing GST_GL_HAVE_PLATFORM_EGL.
>
> I would be much obliged if someone could answer my questions:
>
> - Is omxdec still supposed to be functional on the rpi4, and if so, what can be the cause of
>   the above erros?
>
> - If omxdec is not the right way to go, should I megrate to v4l2dec, and if so, how do I get it
>   to use EGLImage buffers?
>
> Thank you,
>
> Gert
>
>
> _______________________________________________
> 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

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Raspi 4: omxdec to EGLImage decoding

Gert Glass
Quoting Nicolas Dufresne (2019-08-01 16:41:47)
> Le jeudi 01 août 2019 à 09:47 +0200, Gert Glass a écrit :
> > Hi,
> >
> > I'm trying to port my application from the Raspberry Pi 3 (raspbian
> > jesse, gst 1.10.4) to the recently introduced Pi 4 (raspbian buster, gst
> > 1.14.4).
>
> On RPi 4 the preferred decoder is v4l2videodec.

Right, so that makes sense, thanks for confirming that.

Can you also offer any advice on how I can get this decoder to decode to
EGLImage buffers instead of GLImage buffers?

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

Re: Raspi 4: omxdec to EGLImage decoding

Nicolas Dufresne-5
Le jeudi 01 août 2019 à 17:12 +0200, Gert Glass a écrit :

> Quoting Nicolas Dufresne (2019-08-01 16:41:47)
> > Le jeudi 01 août 2019 à 09:47 +0200, Gert Glass a écrit :
> > > Hi,
> > >
> > > I'm trying to port my application from the Raspberry Pi 3 (raspbian
> > > jesse, gst 1.10.4) to the recently introduced Pi 4 (raspbian buster, gst
> > > 1.14.4).
> >
> > On RPi 4 the preferred decoder is v4l2videodec.
>
> Right, so that makes sense, thanks for confirming that.
>
> Can you also offer any advice on how I can get this decoder to decode to
> EGLImage buffers instead of GLImage buffers?
It produces GstBuffer containing DMABuf (by default), and glupload will
take care of converting to EGLImage and binding a texture to this
EGLImage.

Nicolas

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

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Raspi 4: omxdec to EGLImage decoding

horai
In reply to this post by Gert Glass
Dear sir,

please, could you help me running the pipeline on RPI4?
I cannot run any pipeline ending with "h264parse ! v4l2h264dec ! glupload !
glimagesink "

Did you have to do anything extra apart from installing packages from
repository?

Did you compile Gstreamer from sources (if yes, which version)?
Was is necesssary to export any enviromental variables?

Thank you
Best regards,
Ivo



--
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: Raspi 4: omxdec to EGLImage decoding

Peel70
Hi,
I think that with the new VC and enabled it in the config.txt (is default
activated), you have to use kmssink instead of glimagesink

You have to install gstreamer plugins bad's kms and you don't need to export
DISPLAY=:0.0

this also should work
gst-launch-1.0 videotestsrc ! kmssink
gst-launch-1.0 videotestsrc ! kmssink plane-properties=s,rotation=4

I was able to use the below pipelines in Burster light, but I'm using
Bitbake Poky to build an image without X11, for the moment the only pipeline
that I was able to work with are these:

I was able to play accelerated in GPU with this pipeline:

gst-launch-1.0 -e -vvv filesrc location=big_buck_bunny_720p_h264.mov !
qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 ! kmssink

I was able to convert mp4 to mkv with this command
gst-launch-1.0 -v filesrc location="/home/root/test.mp4" ! parsebin
name="demux" ! h264parse ! queue ! matroskamux name="mux" ! filesink
location="1.mkv" demux. ! aacparse ! queue ! mux.

I was able ti play mp4 with this command but is a sw render (I've installed
gstreamer-1.0-libav):
gst-launch-1.0 -e -vvv filesrc location="/home/root/test.mp4" ! qtdemux !
h264parse ! avdec_h264 ! kmssink

but
GST_DEBUG="omx:2" gst-launch-1.0 -e -vvv filesrc
location=bbb_sunflower_1080p_30fps_normal.mp4 ! qtdemux ! h264parse !
omxh264dec ! videoconvert ! kmssink

I give this error:
¡0:00:00.332141903 634 0x1430d20 ERROR omx
gstomx.c:1892:gst_omx_component_set_parameter: Set video_decode parameter at
index 0x02000001: Bad parameter (0x80001005)
0:00:00.332392237 634 0x1430d20 ERROR omx
gstomx.c:2072:gst_omx_port_update_port_definition: Updated video_decode port
130 definition: Bad parameter (0x80001005)`

Please try and give me a feedback because I'm interested in a potential fix

PI4 have h265 encoder/decoder HW to it will be possible to play mkv HEVC inm
GPU but at the moment I was not able to give it working.

have a good test



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel