@Olivier-Duguay can you update to a more recent version of Qt ? Since 6.5, the default backend has been switched to ffmpeg which may give better results.
You might want to check the libqtavi library: https://iondev.ro/qtavi/
It enables Qt based applications to easily save video files in the AVI container format and is available under two licenses: open-source (GPL v. 3.0) and commercial.