You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @Vanilagy and thanks for your work 🙏
I tried to achieve what I need to do with your lib but I think I'm missing something.
I'm trying to merge an audio blob with a video blob to get a final MP4 file.
I have the audio blob (which is a dynamic merge of severals mp3 file).
I have the video blob (which is a blob got from a canvas animation with MediaRecorder).
Does your lib can achieve that or did I misunderstood your examples?
I read your docs, tried a lot of mechanisms, but I can't figured out how I should do for this specific case.
Could you please give me some advices so we could add it to your demo folder (it could be helpfull for other devs)?
I did my test by including your lib directly in the HTML and by loading a sample.mp3 and a sample.webm
<scriptsrc="build/mp4-muxer.js"></script>
window.onload=go;constaudioUrl='sample.mp3';constvideoUrl='sample.webm';asyncfunctionloadFileAsBlob(url){constresponse=awaitfetch(url);constarrayBuffer=awaitresponse.arrayBuffer();returnnewBlob([arrayBuffer]);}asyncfunctiongo(){try{constaudioBlob=awaitloadFileAsBlob(audioUrl);constvideoBlob=awaitloadFileAsBlob(videoUrl);awaitmergeAudioVideo(audioBlob,videoBlob);// <-- what mechanism should have this function?}catch(error){console.error('Error loading files:',error);}}
Thanks for your help and time!
The text was updated successfully, but these errors were encountered:
Hi @Faksprod. Doing this is non-trivial actually. My library only takes care of muxing, not demuxing which is required for reading media files. That means you'll need to combine several web APIs to make this work. You'll also need to reencode the media chunks.
For the audio, your best bet is to decode it using an AudioContext and then to create an AudioData from it, which you can pass into an AudioDecoder.
For the video it's more tricky as there's no neat API for extracting frames from a video. There are a few possibilities here but all are hacky and suboptimal or slow. Your best bet would be not to use MediaRecorder but directly pipe the canvas into a VideoFrame, and then into a VideoEncoder, and then into the muxer. Is that possible in your case?
Hello @Vanilagy and thanks for your work 🙏
I tried to achieve what I need to do with your lib but I think I'm missing something.
I'm trying to merge an audio blob with a video blob to get a final MP4 file.
Does your lib can achieve that or did I misunderstood your examples?
I read your docs, tried a lot of mechanisms, but I can't figured out how I should do for this specific case.
Could you please give me some advices so we could add it to your demo folder (it could be helpfull for other devs)?
I did my test by including your lib directly in the HTML and by loading a sample.mp3 and a sample.webm
Thanks for your help and time!
The text was updated successfully, but these errors were encountered: