Libcamera Audio Video Sync using RTMP

Hi everyone,

I am using a 64mp Arducam and a USB microphone via libav on my Pi4.
When I start recording with libcamera-vid and output a file with --av-sync 50000 the video is absolutely in sync with the audio.
It is for some reason different if I send the video out via rtmp…
The delay also seems to change depending on the bandwith/internet connection.
Does someone have an idea how to fix that?

Best regards