5

I'm using MediaRecorder to record animation from the canvas element. After downloading the video, the video information is empty (duration, bitrate, frame rate...)

enter image description here

Here is how I make the download URL

    const blob = new Blob(data, { type: 'video/webm' });
    const url = window.URL.createObjectURL(blob);

Is there any way to add metadata to download files?

Quan Vo
  • 1,639
  • 2
  • 13
  • 28
  • Hello Quan, did you find a solution to this? – Vlas Bashynskyi Apr 19 '21 at 14:39
  • 1
    Related: https://stackoverflow.com/questions/38443084/how-can-i-add-predefined-length-to-audio-recorded-from-mediarecorder-in-chrome To add these metadata to the recorded file you'll need postprocessing. E.g ffmpeg should be able to do that for you. – Kaiido Jun 01 '21 at 11:25
  • @Kaiido Here you get the `duration` for the blob recorded but we need to add that in the Blob metadata, so while treating the asset with integration, it shouldn't fail due to this missing metadata. – dhruv479 Jun 01 '21 at 13:52
  • @dhruv479 that's why I said it's "related" and not "a dupe". Both questions are "related" to the same Chrome bug. I also said how one should handle that through postprocessing, which is obviously different than what I proposed in my answer to the other question. – Kaiido Jun 01 '21 at 13:57
  • I might have a possible answer for you... **(1)** How to recreate _`"using MediaRecorder to record animation from the canvas element"`_? **(2)** My solution is to just add own custom metadata bytes into the video (blob). But I need example data from step (1). – VC.One Jun 07 '21 at 10:32
  • This library to write id3 tags [https://github.com/egoroof/browser-id3-writer](https://github.com/egoroof/browser-id3-writer) maybe help you! – Majid Hajibaba Jun 07 '21 at 15:14

0 Answers0