Hi @martin181818
I don't think you need to use the VideoEncoder, but it will make the size smaller which is more suitable for MQTT since I believe there are some size restrictions on data sent.
You can access the image using:
h265Packet = q.get() # Blocking call, will wait until a new data has arrived
image = h265Packet.getData()
Thanks,
Jaka