jscodec / jswebm

A javascript implementation of the Webm Demuxer (matroska)
https://jscodec.github.io/jswebm-demo/
MIT License
87 stars 14 forks source link

can not work on mediarecorder blob data #36

Open aisnote opened 2 years ago

aisnote commented 2 years ago

inputVideoBlob. type = video/x-matroska;codecs=avc1,opus,

function demux_blob(inputVideoBlob) {

  var copyBlob = new Blob([inputVideoBlob], {type: inputVideoBlob.type});

  var fileReader1 = new FileReader();
  fileReader1.onload = function() {
      vab = this.result;  // arrayBuffer

      const demuxer = new JsWebm();

      demuxer.queueData(vab);
      while (!demuxer.eof) {
        demuxer.demux();
      }

    log(demuxer);
    log(`total video packets : ${demuxer.videoPackets.length}`);
    log(`total audio packets : ${demuxer.audioPackets.length}`);

  };

  fileReader1.readAsArrayBuffer(copyBlob);

total video packets : 0 total audio packets : 0

Andy ideas?

Thanks.

thomasjammet commented 2 years ago

Looking at the code it seems that the project is not finished, for example state STATE_SEEKING is never assigned but expected here, maybe it works with a whole file queued into queueData but it doesn't work with progressive data from MediaRecorded for example. What is the state of this library @brianxautumn ?