fix-webm-duration icon indicating copy to clipboard operation
fix-webm-duration copied to clipboard

Duration section is missing

Open themire opened this issue 1 year ago • 2 comments

I've been getting the message [fix-webm-duration] Duration section is missing when trying to add this to my app. On the latest Chrome on desktop Mac. I've tried both methods but it doesn't add the duration.

I've played around with it a fair bit but can't get it to work. Any tips on what I might be doing wrong?

const options = {
  mimeType: this.mimeType, // audio/webm;codecs=opus
  bitsPerSecond: 64000, // For video-only recording
  audioBitsPerSecond: 64000, // For audio recording
  numberOfAudioChannels: 1, // Mono
  audioBitrateMode: "variable", // For variable bitrate
}

this.mediaRecorder = new MediaRecorder(this.stream, options)

this.mediaRecorder.onstop = (e) => {
  const blob = new Blob(this.chunks, { type: this.mimeType })

  ysFixWebmDuration(blob, 10000, (fixedBlob) => {
    console.log(fixedBlob, "after1")
  })

  ysFixWebmDuration(blob, 10000, { logger: true }).then((fixedBlob) => {
    console.log(fixedBlob, "after2")
  })
}

The log looks like

Blob {size: 38123, type: 'audio/webm;codecs=opus'} 

themire avatar Jan 30 '24 16:01 themire

Didn't test the library with audio-only files... I'll check it

yusitnikov avatar Jan 31 '24 09:01 yusitnikov

Also getting this error with recorded audio files. This isn't really a big issue because you can set logger:false, but I'm not sure why the duration is not being set correctly.

TasseDeCafe avatar Apr 21 '24 05:04 TasseDeCafe

"Duration section is missing" is not an error, it's just a debugging info. It means that the library will add the missing duration section after logging that. The logger could be silenced by providing logger: false option if the output is not desirable. I also could change the default logger from console.log to console.debug

yusitnikov avatar Jun 13 '24 14:06 yusitnikov