Is there any node module/link through which we can convert the DOM to video in react. My requirement is that the user can upload video along with some text and there will be a download button. Once the user clicks on the download button the text entered by the user should merge with the input video and gets downloaded.
I tried the react-dom-to-video package but the issue is that the input video needs to played while recording which is not our requirement as we can't force user to play the whole video.
any help would be appreciated.
It sounds like you want to allow user merge text they upload with a video they also upload.
If the text will be an overlay on the video you can do this on the server side using ffmpeg.
Assuming you are using node.js as your backend, you can find various packages supporting ffmpeg - e..g.: https://www.npmjs.com/package/fluent-ffmpeg
You can also see the dedicated 'drawtext' filter, again in the ffmpeg documentation, here: https://ffmpeg.org/ffmpeg-filters.html#toc-drawtext-1
This will allow you add the text to the video as an overlay on the server side and then give the suer the option to download the merged content.
For example if you wanted to add your text to the bottom left of the video:
ffmpeg -i input -I [your text as an image] -filter_complex 'overlay=10:main_h-overlay_h-10' output
You can see other examples in the ffmpeg filter documentation here: https://ffmpeg.org/ffmpeg-filters.html#toc-Examples-89
You can also look at the 'drawtext' filter: https://ffmpeg.org/ffmpeg-filters.html#toc-drawtext-1