You can try libqtavi. It is a wrapper around the libgwavi. API looking simple and good integration with Qt classes. But only support MJPG codec and avi format and its bigger output size than mpeg/mp4, hevc/mkv…
QAviWriter writer("demo.avi", QSize(800, 600), 24, "MJPG");// set framerate to 24 fps and 'MJPG' codec
writer.setAudioFileName("audio.wav"); // set audio track
writer.open();
writer.addFrame(QImage("file.png"));
//...add all other video frames here
writer.close();