MediaRecorder 将 Blob 转换为 MP4 以供 PPTXGenJS 视频使用。

huangapple go评论98阅读模式
英文:

MediaRecorder convert blob to MP4 for PPTXGenJS video

问题

我正在使用MediaRecorderGetDisplayMedia()记录视频流,以便在PowerPoint文档中使用PPTXGenJS嵌入。

我知道MediaRecorder不能记录为mp4,只能为webm,而PPTX需要MP4格式

因此,来自MediaRecorder的结果webm blob需要转换为mp4。

如何将来自MediaRecorder的webm blob转换为mp4 blob?

英文:

I'm recording a video stream from GetDisplayMedia() using MediaRecorder to be embedded within a powerpoint document using PPTXGenJS.
<br>
I know MediaRecorder can't record to mp4, only webm, and PPTX requires MP4 format.
<br>
<br>
So the resultant webm blob from MediaRecorder will have to be converted to mp4.
<br>
How can I convert the webm blob from MediaRecorder to an mp4 blob?

答案1

得分: 1

我最终将WebM数据块保存为文件系统上的文件,然后使用FFmpeg将WebM转换为MP4,然后将MP4的Base64字符串表示发送回前端。

英文:

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.

huangapple
  • 本文由 发表于 2023年6月2日 12:06:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387056.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定