To be clear, are you asking for a ByteArray that contains encoded frames, i.e., has already gone through an h264 encoder? Or are you looking for a ByteArray that contains RGB frames (or YUV)? ]
The former we can't currently provide from CameraX, though it is possible to hook CameraX into MediaCodec to provide encoded frames. I'm assuming you would like to avoid this since writing MediaCodec code can be tedious.
If you're just looking for RGB/YUV frames, you can use CameraX ImageAnalysis to get Image objects that contain that data.