webm-writer-js icon indicating copy to clipboard operation
webm-writer-js copied to clipboard

Is it possible to add audio to the resulting webm file?

Open guest271314 opened this issue 6 years ago • 7 comments

Is it possible to add audio to the resulting webm file?

guest271314 avatar Mar 07 '18 15:03 guest271314

using ffmpeg with Electron, I guess.

nuthinking avatar Jun 14 '18 14:06 nuthinking

@nuthinking Can the relevant parts of https://github.com/kbumsik/opus-media-recorder be incorporated into webm-writer.js, or vice versa, to achieve the expected result?

guest271314 avatar Sep 22 '19 20:09 guest271314

Probably

thenickdude avatar Sep 23 '19 01:09 thenickdude

@thenickdude Have been trying using https://github.com/tseylerd/Webm-writer (which includes an addAudioTrack() method). Have been able to encode the video with variable resolution. Then began trying to incorporate https://github.com/kbumsik/opus-media-recorder which has thus far thrown errors, not record any audio, and crashes the browser (not just the tab). Will next try https://github.com/higuma/web-audio-recorder-js.

guest271314 avatar Sep 23 '19 02:09 guest271314

@thenickdude Do not (yet) know where to begin to include audio track support in your code else would have already written the code.

guest271314 avatar Sep 23 '19 02:09 guest271314

I'm pretty interested in as well

matthewfcarlson avatar Mar 30 '20 17:03 matthewfcarlson

@matthewfcarlson An experiment performed in the interim https://github.com/WebAudio/web-audio-api-v2/issues/6. mkv2xml and xml2mkv are particularly helpful for providing a "human readable" version of a Matroska file. It should be possible to substitute, edit any part of the XML file, e.g., to being with an XML template and insert PCM or Opus (and image) data, then use xml2mkv to convert back to binary format.

Revisited this issue https://github.com/legokichi/ts-ebml/issues/26 yesterday attempting to extract VP8 data (AFAICT webm-writer does not convert from RGB to YUV, though does appear to provide the code to facilitate that option, if necessary) and stream those images from a Worker to main thread, in conjunction with audio using http://libwebpjs.hohenlimburg.org/vp8/webm-javascript-decoder/, and to try setting hexadecimal encoded images into a stream.

How do you suggest to proceed to achieve the requirement?

guest271314 avatar Mar 31 '20 01:03 guest271314