-
Notifications
You must be signed in to change notification settings - Fork 21
ffmpeg h264_omx doesn't work #98
Comments
Possibly related to the MMAL changes? #10 & #86 (comment) |
It's really hard for me to tell what's missing, however the speed impact of losing OMX ist remarkable. I noticed a header file is present:
But including it didn't help. When I tried to compile ffmpeg from source I followed this tutorial "Compiling FFmpeg on your Raspberry Pi" and this is my configure step:
|
This post suggests that mmal doesn't affect omx, though: https://stackoverflow.com/questions/40175644/ffmpeg-hardware-acceleration-on-raspberry-pi
|
OpenMax IL will NEVER be supported on 64bit. The hell involved in mapping 64bit pointers to pass to the 32bit VPU just isn't worth it. The V4L2 stateful codec API is the preferred approach for codecs, and is available in both 32 and 64bit OSes. In FFmpeg use h264_v4l2m2m instead. |
@6by9 does h264_v4l2m2m use any hardware support? I'm not familiar with it. |
Yes, it's a V4L2 API wrapper on top of the MMAL components, but doing that allows us to add 64bit compatibility relatively easily. |
@6by9 So I'm curious now. On my RPI4 (64bit), ffmpeg has the h264_v4l2m2m encoder available - I take it it's not using omx underneath so then what is it actually doing? Some other software encoder through MMAL? |
A quick search finds https://www.kwasi-ich.de/blog/2017/11/26/omx/ which seems to suggest that OpenMax is a portable-wrapper on top of the Broadcom-specific MMAL. |
h264_v4l2m2m uses the V4L2 stateful decoder API to then access the hardware codec (encode and decode) via the MMAL framework. MMAL and OpenMAX IL both share the components at the lowest level. That was termed internally as Reduced-IL (or RIL) as it removes all the common state machine stuff from the individual components to give a reduced API. MMAL and IL provide two different routes down to the RIL level, with MMAL being the more recent, and tries to get rid of a load of the bits of IL that caused grief (particularly all the asynchronous callback for completing state transitions and the like). The MMAL framework code within the kernel has been adapted to handle 64bit kernels. Where the client needs to pass a 64bit pointer through a 32bit IPC field, it goes through an allocation and lookup table. If you felt like picking IL apart to do the same, then a PR would be welcome. |
Thanks for the detailed info @6by9 ! 👍 |
h264_v4l2m2m produces green video output - so I would consider it broken. I also wonder where this could be reported. |
Green output but a visible image? The chroma planes are set to 0. Following normal Debian policies of not changing major version within a release you won't find FFmpeg being significantly bumped, but we can see if that fix can be simply backported. |
I'm still waiting on this before I can even use the x64 version here. And it sucks as I'm doing live encoding of video stream from a queue of frames in RAM (doing surveillance with motion detection). The 2GB limit is killing me. But, this is a deal breaker. Is there just no hope this will ever be resolved? |
As #98 (comment),
I thought h264_v4l2m2m had been fixed, but haven't double checked. |
Hmm, I missed that. I just saw this issue was still open. I'll test out ffmpeg with h264_v4l2m2m instead. I guess if that is working, and knowing the history with OMS, maybe this should be closed with "won't fix" and a final reference to use the other hardware encoding option would be best? |
Please leave a comment how to get hardware support for decoding / encoding with ffmpeg if you find a solution! I'm still using older Pis which are much faster because they do support this. |
I have the same problem. |
Make sure you are on an updated RpiOS bullseye image. |
I'm on Ubuntu 20.04 |
I think you should report it to Ubuntu then |
I've seen this green output problem on other architectures, too. It could be a ffmpeg problem. |
IIRC, an all-green screen is what you get when a YUV image is entirely 0s. |
It works when compiling ffmpeg from source, but not when installing with |
Which suggests Ubuntu are building the apt ffmpeg without support for this. That's not something we can help you with here (on an RPiOS issue tracker). |
Hello, every 01!
ffmpeg lists h264_omx as a supported Decoder/Encoder, however if I try to use it it says
[h264_omx @ 0x5578fb7e10] libOMX_Core.so not found7014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[h264_omx @ 0x5578fb7e10] libOmxCore.so not found
I tried to compile ffmpeg from source which worked except that it complains that it can't find the headers:
ERROR: OpenMAX IL headers from raspberrypi/firmware not found
I have installed libomxil-bellagio-dev but can't get hardware support for ffmpeg either way.
The text was updated successfully, but these errors were encountered: