You can stream raw binary data directly over MQTT . MQTT treats the message payload as an opaque byte buffer (uint8_t*
with a length), so it does not care what the contents are.
You might only need to encode in Base64 if the MQTT broker or subscriber expects text-only payloads.