gstreamer raspbian buster rpi4 h264 omx HD video not working

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

gstreamer raspbian buster rpi4 h264 omx HD video not working

fabrizio.rinalduzzi
Hi,
I wrote a c program on a rpi4, O.S. raspian buster, using gtk, gstreamer
1.14.4 that plays movies chosen from a list.
I'm using the playbin element.

If I play a mpg movie with this specs :
/Topology:
  container: MPEG-1 System Stream
    audio: MPEG-1 Layer 2 (MP2)
    video: MPEG-1 Video
Properties:
  Duration: 0:00:25.280000000
  Seekable: yes
  Live: no
  Tags:
      audio codec: MPEG-1 Audio
      has crc: false
      channel mode: stereo
      nominal bitrate: 128000
      video codec: MPEG-1 Video/
everything goes smoothly,

If I play a mp4 movie with this specs:
/Topology:
  container: Quicktime
    audio: MPEG-4 AAC
    video: H.264 (High Profile)
Properties:
  Duration: 0:01:00.010000000
  Seekable: yes
  Live: no
  Tags:
      audio codec: MPEG-4 AAC audio
      maximum bitrate: 140304
      datetime: 2019-03-23T09:27:11Z
      container format: ISO MP4/M4A
      video codec: H.264 / AVC
      bitrate: 5574235/
it plays very badly, a lot of frames are skipped

The same result comes out if I simply run:
/gst-launch-1.0 -v playbin uri=file:///home/pi/Videos/FullHD.mp4/
So it does not seem related to my code, I guess Hw acceleration is not
working.

Then I tried /gst-launch-1.0 -v playbin3
uri=file:///home/pi/Videos/FullHD.mp4/, it did not play and I got this
message :
*ERROR: from element
/GstPlayBin3:playbin3-0/GstURIDecodeBin3:uridecodebin3-0/GstDecodebin3:decodebin3-0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Could not initialize supporting library.
Additional debug info:
gstvideodecoder.c(2535): gst_video_decoder_change_state ():
/GstPlayBin3:playbin3-0/GstURIDecodeBin3:uridecodebin3-0/GstDecodebin3:decodebin3-0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Failed to open decoder*

The same error is reported if I try to play the mpg file that worked well
with playbin.

It seems that playbin3 tries to access Hw acc, but omx fails to work, even
though it seems to be installed :
/pi@raspberrypi:~ $ gst-inspect-1.0 | grep omx
libav:  avenc_h264_omx: libav OpenMAX IL H.264 video encoder encoder
omx:  omxhdmiaudiosink: OpenMAX HDMI Audio Sink
omx:  omxanalogaudiosink: OpenMAX Analog Audio Sink
omx:  omxh264enc: OpenMAX H.264 Video Encoder
omx:  omxvc1dec: OpenMAX WMV Video Decoder
omx:  omxmjpegdec: OpenMAX MJPEG Video Decoder
omx:  omxvp8dec: OpenMAX VP8 Video Decoder
omx:  omxtheoradec: OpenMAX Theora Video Decoder
omx:  omxh264dec: OpenMAX H.264 Video Decoder
omx:  omxh263dec: OpenMAX H.263 Video Decoder
omx:  omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
omx:  omxmpeg2videodec: OpenMAX MPEG2 Video Decoder/

Am I missing something?

I would like to find a solution that :
- either enables hw acc. for playbin
- or allows playbin3 to use omx components.

I quickly searched topics similar to this but I didn't find, at least
related to the rapsberry pi4.
I apologise in advance if my search was not enough thorough.










--
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: gstreamer raspbian buster rpi4 h264 omx HD video not working

Nicolas Dufresne-5
Le mercredi 27 mai 2020 à 10:50 -0500, fabrizio.rinalduzzi a écrit :
> Am I missing something?
>
> I would like to find a solution that :
> - either enables hw acc. for playbin
> - or allows playbin3 to use omx components.

Try v4l2h264dec on RPi4, and GL or kms sink for zero-copy.

Nicolas

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

Re: gstreamer raspbian buster rpi4 h264 omx HD video not working

horai
In reply to this post by fabrizio.rinalduzzi
Dear sir,

We do not use playbin, we rather contruct pipeline manually since we have a
finer control over the flow and elements.
Which graphical server do you use? Wayland or X11?
We try to program a multi window player and we faced some issues regarding
Wayland, but there have been quite a few changes since then and I would
really encourage you to try waylandsink with v4l2h264dec (have a look at
proper settings to get hardware acceleration), it was blazing fast.
https://www.raspberrypi.org/forums/viewtopic.php?t=240274
The same we did on X11 graphical server Embedding sink into GTK window
brings some things to resolve and finding a working and fast solution
(especially combination of codec and sink) was a matter testing. There is a
huge variety of sinks which go along with GTK and v4l, just list all of them
the via:
gst-inspect-1.0 | grep sink
And pick the ones related to video.
Initially, cluttersink seemed very suitable for our purpose (must be
installed from repository libclutter-gst-3.0-dev), but we dropped it.
I was not successful in embedding kmssink into GTK window (nor I managed to
run it under X11 or Wayland), but it has already been a long time since I
tried it last, therefore I would encourage you to try it as kmssink was
fabulously fast without X11.
I guess,using OMX on RPi4 with KMS support is not possible since it disables
binary proprietary Broadcom driver used by OMX, there might be some chance
using fake-KMS, but I would really encourage you to use v4l, it is a
standard.



--
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: gstreamer raspbian buster rpi4 h264 omx HD video not working

Nicolas Dufresne-5


Le sam. 6 juin 2020 09 h 00, horai <[hidden email]> a écrit :
Dear sir,

We do not use playbin, we rather contruct pipeline manually since we have a
finer control over the flow and elements.
Which graphical server do you use? Wayland or X11?
We try to program a multi window player and we faced some issues regarding
Wayland, but there have been quite a few changes since then and I would
really encourage you to try waylandsink with v4l2h264dec (have a look at
proper settings to get hardware acceleration), it was blazing fast.
https://www.raspberrypi.org/forums/viewtopic.php?t=240274
The same we did on X11 graphical server Embedding sink into GTK window
brings some things to resolve and finding a working and fast solution
(especially combination of codec and sink) was a matter testing. There is a
huge variety of sinks which go along with GTK and v4l, just list all of them
the via:
gst-inspect-1.0 | grep sink
And pick the ones related to video.
Initially, cluttersink seemed very suitable for our purpose (must be
installed from repository libclutter-gst-3.0-dev), but we dropped it.
I was not successful in embedding kmssink into GTK window (nor I managed to
run it under X11 or Wayland), but it has already been a long time since I
tried it last, therefore I would encourage you to try it as kmssink was
fabulously fast without X11.
I guess,using OMX on RPi4 with KMS support is not possible since it disables
binary proprietary Broadcom driver used by OMX, there might be some chance
using fake-KMS, but I would really encourage you to use v4l, it is a
standard.

Weston compositor through Wayland sink should offer similar performance and capabilities of kmssink. You need Weston 8+, and it will transparently use a HW overlay like kmssink does. Kmssink runs as DRM master, hence will conflict with any display server. You could also consider adding support for the direct display protocol, which forces this path (without GL fallback), but RPi is so flexible that I don't think this is needed.

As for zero-copy to X11, there is extension in dri3 to use dmabuf, it won't give you overlay, but at least decent GL rendering. This is largely not-implemented in GStreamer. I think this could theorically be added as an upload method in glupload element. This is assuming you have the skills and time to get your hand dirty.





--
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