use FFmpeg, which is a free and open-source software for handling multimedia files.
you need to set the input and output file paths according to your requirements. Also, you need to specify the FFmpeg executable file path in the ffmpegPath variable. The command variable contains the FFmpeg command to convert the MP4 video to an MKV video. The -i option specifies the input file path, and the -c copy option specifies to copy the video and audio streams from the input file without re-encoding them. Finally, the output file path is specified. The process object is used to execute the FFmpeg command as a separate process.