-
Notifications
You must be signed in to change notification settings - Fork 12
Hardware encoding on Ubuntu Bionic #23
Description
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 (workaround avcodec_find_encoder_by_name() unreliably indicating that h264_omx codec is available #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.