Search code examples
mp4mediarecorderwebmget-display-mediapptxgenjs

MediaRecorder convert blob to MP4 for PPTXGenJS video


I'm recording a video stream from GetDisplayMedia() using MediaRecorder to be embedded within a powerpoint document using PPTXGenJS.
I know MediaRecorder can't record to mp4, only webm, and PPTX requires MP4 format.

So the resultant webm blob from MediaRecorder will have to be converted to mp4.
How can I convert the webm blob from MediaRecorder to an mp4 blob?


Solution

  • I ended up saving the webm blob as a file on the file system, then using ffmpeg to convert the webm to mp4, then sending the base64 string representation of the mp4 back to the front end.