Open AAlon opened 5 years ago
@AAlon this is urgent? if so, we should put this in our backlog.
we should add tags of some sort to help us prioritize tasks and get a closer-to-accurate ops report.
Thanks for checking - we're actively investigating HW encoding on RPi Bionic as part of the ROS2 support work. No new insights yet.
In my opinion, the work that needs to be done is on the Bionic OS image, not on this package.
In our testing, HW encoding worked out of the box for RPi running Xenial (most likely because the ffmpeg was properly configured). However, we've been having difficulties getting it to work on Ubuntu Bionic. This is tightly related to #2 , but the issue is two fold:
Correct detection of encoding capabilities is still not quite there. If ffmpeg was configured without
--enable-omx-rpi
, it will try to uselibOMXCore.so
, which (by default) is unavailable - onlylibopenmaxil.so
is. The code that detects HW encoding support (https://github.com/aws-robotics/kinesisvideo-encoder-common/pull/3) reports that it is available because it foundlibopenmaxil.so
. One option to solve it, once and for all, is to actually try to open the codec (invokeavcodec_open2
) as part of the check (insideis_omx_available
). If it fails, fall back to SW encoding, while warning about it.The bigger problem, in my mind, is that there seems to be no easy or simple way to set up the RPi for HW encoding with Bionic... the Bionic images we've tried do not come with properly-configured ffmpeg. When building ffmpeg from source there are numerous intricacies with regards to how to compile it properly (configuration flags etc.). We need to come up with a solution to simplify this, and I wouldn't rule out building & vending binaries of ffmpeg (along with all related libraries) ourselves.