Send chunks from MediaRecorder to server and play it back in the browser

后端 未结 3 915
温柔的废话
温柔的废话 2021-02-09 06:28

With the following code in NodeJS I\'m able to play a webm file served from server:

app.get(\'/video\', function(req, res){
    res.writeHead(200,{
        \'Con         


        
3条回答
  •  梦毁少年i
    2021-02-09 07:12

    You can't just needle-drop into the WebM stream. WebM/Matroska require some setup to initialize the track info and what not. After that, you'll have Clusters, and you have to start on a Cluster. Additionally, Chrome is going to require that each Cluster start on a keyframe, which you're not going to be able to guarantee with the data from MediaRecorder. Therefore, server-side transcoding (or at least, some nasty hacking on the VP8 stream) is needed.

提交回复
热议问题