function overlayMaker(){
ffmpeg()
.on('end', onEnd )
.on('progress', onProgress)
.on('error', onError)
.input(`${QuizicorderDir}/screen.webm`)
.input( `${QuizicorderDir}/webcam.webm`)
.complexFilter([
"[0:V]scale=1920:-4,pad=0:1080:0:(oh-ih)/2[vid];[vid][1:V]overlay"
])
.outputFps(30)
.output('./output-video.mp4')
.run();
}
I am using this function to create an overlay of the webcam video on top of the screen recorder video. I have defined the input file path to be the temp folder in windows as i am saving the recording there temperory.
The following image is the desired output