I think what needs to be done is the audio and video streams being muxed into a container such as AVI, WEBM or Matroska so that the video and audio are in sync. The program to do that is FFmpeg where you should be able to pipe or feed the files into it and get a stream out.
There's likely directions of the internet for doing it.
Even better would be to use FFmpeg's libavcodec in a program to do the muxing, beyond my abilities.
I'm already working on .... under Avxcat v2
Review some information from older post:
https://www.os2world.com/forum/index.php/topic,2453.msg27476.html#msg27476Syntax I use has changed a lot due to syncro issue and other issue using latest ffmpeg (release 4.2.2-3)
I could get better result inverting audio and video input file order.
Sharing with you, here is a working example :
Of course, You have to start Wim's exes first.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 mywebcam.avi
(adjust -itsoffset 1.05 value if you have video/audio not syncro)
Of course, you can make the choice to change avi to mp4 etc.... but this will introduce ffmpeg process which could impact result at this step.
I've got some better results piping ffmpeg result into an other ffmpeg process.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 -f avi - |ffmpeg -i - mywebcam.mp4
Output of the second ffmpeg (or directly from first process) could be of other type (e.g. flv for rtmp...). You'll have visible latency due to ffmpeg process time (some special parameters exist to reduce streaming latency but already exist)
Warning: Piping from firs FFMPEG into second FFMPEG may consume a high amount of storage
From what I could see, about 174Mb shared low storage while runing only one ffmpeg step with avi output file requires about 42Mb shared low storage.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 mywebcam.avi (or -f avi mywebcam.avi or any other format)
Note: If you start webcam through WCC, you can display/control current recording using:
ffplay -i
http://127.0.0.1:14225 -x 190 -y 144