I've tried using ffmpeg, but I couldn't get it to work. At the very beginning, I cannot register the codecs by calling av_register_codecs() and later I couldn't find the relevant codec(s) to use.
I'm right now looking for alternatives to construct the video file. Any ideas? I need some C++ lib/code to start off with.