aws-robotics / kinesisvideo-encoder-common

ROS packages for facilitating the use of AWS cloud services.
GNU Lesser General Public License v2.1
9 stars 12 forks source link

Hardware encoding on Ubuntu Bionic #23

Open AAlon opened 5 years ago

AAlon commented 5 years ago

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:

  1. Correct detection of encoding capabilities is still not quite there. If ffmpeg was configured without --enable-omx-rpi, it will try to use libOMXCore.so, which (by default) is unavailable - only libopenmaxil.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 found libopenmaxil.so. One option to solve it, once and for all, is to actually try to open the codec (invoke avcodec_open2) as part of the check (inside is_omx_available). If it fails, fall back to SW encoding, while warning about it.

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

xabxx commented 5 years ago

@AAlon this is urgent? if so, we should put this in our backlog.

xabxx commented 5 years ago

we should add tags of some sort to help us prioritize tasks and get a closer-to-accurate ops report.

AAlon commented 5 years ago

Thanks for checking - we're actively investigating HW encoding on RPi Bionic as part of the ROS2 support work. No new insights yet.

mm318 commented 5 years ago

In my opinion, the work that needs to be done is on the Bionic OS image, not on this package.