Would it be possible to build ffmpeg with libx264 and libx265 support or are they still too slow?
The ffmpegx add-on provides an ffmpeg binary wth h264 support (not sure about h265). Hardware encoding is still some way off as the kernel is still missing a defined uAPI for V4L2 encoding so there's a choreographed dance between kernel, specs, and userspace apps like gstreamer and ffmpeg to pull off.