https://stackoverflow.com/questions/18756797/can-i-merge-h264-and-aac-to-ts-stream-by-code
using C, IMHO the easiest way is 'system'.
#include <studio.h>
.....
system("ffmpeg -i audio.au -i video.h264 -vcodec copy -acodec copy play.ts")
but take care to the ffmpeg license. because depending how your program use ffmpeg it may have huge implication!