Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
From some documents said OpenMAX has been deprecated for a long time and isn't supported with 64-bit kernels, is it right? If it is, What is the uptodate multimedia platform on RPi?
- 6by9
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 18477
- Joined: Wed Dec 04, 2013 11:27 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
V4L2 is the mainline Linux kernel API for codec and camera related multimedia, and is where we are heading for those. Codecs are all supported already, as is the ISP for resizing and format conversion.
libcamera is coming in to provide a fully featured (and open source) camera stack.
DRM/KMS, and EGL are the mainline Linux kernel APIs for display side stuff, and again where things are heading.
For the older Pi variants MMAL is there and supported. There is an issue in 64bit land at present with it that will be addressed when time and resource permits.
OpenMAX has been a dead since around 2012. Android used it as most SoC vendors claimed support as part of the tick-box "APIs supported" marketing blurb, but whilst it claimed to be a standard there were significant differences in the interpretation by vendors. It's always been a pain to handle with regard the asynchronous callbacks for event completion, and debugging why transitions never completed was always a nightmare. RIP OMX.
And there is certainly no way I intend to attempt making OMX work in a 64bit environment - it's just too involved and messy.
libcamera is coming in to provide a fully featured (and open source) camera stack.
DRM/KMS, and EGL are the mainline Linux kernel APIs for display side stuff, and again where things are heading.
For the older Pi variants MMAL is there and supported. There is an issue in 64bit land at present with it that will be addressed when time and resource permits.
OpenMAX has been a dead since around 2012. Android used it as most SoC vendors claimed support as part of the tick-box "APIs supported" marketing blurb, but whilst it claimed to be a standard there were significant differences in the interpretation by vendors. It's always been a pain to handle with regard the asynchronous callbacks for event completion, and debugging why transitions never completed was always a nightmare. RIP OMX.
And there is certainly no way I intend to attempt making OMX work in a 64bit environment - it's just too involved and messy.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
Will the V4L2 H264 decoder be able to decode interlaced video in the (near) future?
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
So if the OpenMAX API is removed from kernel,which API should I use to operator audio device? Currently I only know use OMX Component to play audio.
- 6by9
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 18477
- Joined: Wed Dec 04, 2013 11:27 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
ALSA - the Linux standard audio library that has been supported on the Pi since about 2015. It also supports I2S and USB sound cards, unlike OMX.
For audio codecs use FFmpeg and the associated libavcodec library - that has far greater codec support than OMX has ever provided, and audio is far lighter on the CPU than video so shifting it to the GPU has minimal gain.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
- jamesh
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 35174
- Joined: Sat Jul 30, 2011 7:41 pm
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
You should use the standard linux ALSA components, which is how the desktop does things.
edit: Ninja'd
Software guy, working in the applications team.
- RedMarsBlueMoon
- Posts: 501
- Joined: Mon Apr 06, 2020 3:49 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
So what's going to be the way to make use of the Pis' hardware video decoding capabilities?
I spent some time with ffmpeg/avcodec and wasn't able do do any decent h264 decoding. (I'm happy to be proved wrong, I'm no expert)
With 'hello_video' I can play a 1080p video at full speed using 5-10% of the RPi4's CPU. I wasn't able to get more than 15fps with avcodec and that was at 45% cpu.
I'm just concerned as I haven't seen any examples of any other way of efficiently playing h264 video well.
If you are really leaving OpenMax behind I think it would be a good idea to create some examples showing the alternative ways to get the same results?
I spent some time with ffmpeg/avcodec and wasn't able do do any decent h264 decoding. (I'm happy to be proved wrong, I'm no expert)
With 'hello_video' I can play a 1080p video at full speed using 5-10% of the RPi4's CPU. I wasn't able to get more than 15fps with avcodec and that was at 45% cpu.
I'm just concerned as I haven't seen any examples of any other way of efficiently playing h264 video well.
If you are really leaving OpenMax behind I think it would be a good idea to create some examples showing the alternative ways to get the same results?
- cleverca22
- Posts: 9593
- Joined: Sat Aug 18, 2012 2:33 pm
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
the h264 hw decode is being migrated over to the v4l api, and the ffmpeg shipped with rpios has been patched to be able to use all hw decode via v4l, and thats also the only way to get hw decode on a 64bit userland, due to complications with how the old api workedRedMarsBlueMoon wrote: ↑Mon Nov 02, 2020 12:27 amSo what's going to be the way to make use of the Pis' hardware video decoding capabilities?
I spent some time with ffmpeg/avcodec and wasn't able do do any decent h264 decoding. (I'm happy to be proved wrong, I'm no expert)
With 'hello_video' I can play a 1080p video at full speed using 5-10% of the RPi4's CPU. I wasn't able to get more than 15fps with avcodec and that was at 45% cpu.
I'm just concerned as I haven't seen any examples of any other way of efficiently playing h264 video well.
If you are really leaving OpenMax behind I think it would be a good idea to create some examples showing the alternative ways to get the same results?
- 6by9
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 18477
- Joined: Wed Dec 04, 2013 11:27 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
omxplayer and OpenMAX relied on the GPU being able to randomly slap layers onto the screen.
That isn't the way that mainline Linux wants screen composition to go. DRM/KMS is the kernel API that controls display composition.
GStreamer supports KMS natively via kmssink.
I've got a 1080p30 Big Buck Bunny running here with that on a Pi4 taking under 3% of any core.
gst-play should work too - I looked at an issue a little while back and got it working. Note that GStreamer knows how to direct audio to IL, and if that isn't supported (eg 64bit OS) it can fail. You really need to direct it to use ALSA.
That isn't the way that mainline Linux wants screen composition to go. DRM/KMS is the kernel API that controls display composition.
GStreamer supports KMS natively via kmssink.
Code: Select all
gst-launch-1.0 -e -vvv filesrc location=foo.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! kmsink gst-play should work too - I looked at an issue a little while back and got it working. Note that GStreamer knows how to direct audio to IL, and if that isn't supported (eg 64bit OS) it can fail. You really need to direct it to use ALSA.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
- RedMarsBlueMoon
- Posts: 501
- Joined: Mon Apr 06, 2020 3:49 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
Hi @6by9 that's cool could I please ask what version of gstreamer you are using as I don't seem to have a kmssink available. I built v 1.12 I think it was.
returns nothing and running your line gives a sink not found error.
UPDATE: D'oh its meant to be 'kmssink' and not 'kmsink' of course!
It still doesn't seem to work for me on any of my test video files,
Code: Select all
gst-inspect-1.0 | grep kmsinkUPDATE: D'oh its meant to be 'kmssink' and not 'kmsink' of course!
It still doesn't seem to work for me on any of my test video files,
Code: Select all
gst-launch-1.0 -e -vvv filesrc location=Mulan_trailer.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! kmssinkCode: Select all
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: Could not open DRM module (NULL)
Additional debug info:
gstkmssink.c(710): gst_kms_sink_start (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
reason: No such file or directory (2)
Setting pipeline to NULL ...
Freeing pipeline ...- 6by9
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 18477
- Joined: Wed Dec 04, 2013 11:27 am
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
Buster ships with GStreamer 1.14. Latest is 1.16 or so.
KMS supports a single client at a time. At a guess you're running Xserver, in which case that is the one client.
Either boot to the console, or use ctrl-alt-F2 to switch to an alternate console and kmssink will be available.
Whilst running X you have to ask X to be involved in the rendering. Unfortunately the only mechanism it knows about for composition is using GL which hammers performance. eglsink is the one IIRC, or try autovideosink.
And note this is all for Pi3 or 4 running vc4-fkms-v3d or vc4-kms-v3d overlays.
The only place IL isn't going to be supported is on 64bit OSes (ie we're not removing it from 32bit versions), and under those conditions you should be using one of those overlays.
KMS supports a single client at a time. At a guess you're running Xserver, in which case that is the one client.
Either boot to the console, or use ctrl-alt-F2 to switch to an alternate console and kmssink will be available.
Whilst running X you have to ask X to be involved in the rendering. Unfortunately the only mechanism it knows about for composition is using GL which hammers performance. eglsink is the one IIRC, or try autovideosink.
And note this is all for Pi3 or 4 running vc4-fkms-v3d or vc4-kms-v3d overlays.
The only place IL isn't going to be supported is on 64bit OSes (ie we're not removing it from 32bit versions), and under those conditions you should be using one of those overlays.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
When will the ffmpeg with hw accelerated h264/hevc decoder & encoder be released? the v4l codec api is hard to learn,the documents and examples about it is rare,so I still prefer to use ffmpeg;
Re: Whether OpenMAX is deprecated? What is the uptodate multimedia platform on RPi?
Or, how do I add the patches that ffmpeg can support hw video decoder/encoder?
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion