Quan Vo
Quan Vo

Reputation: 1799

Add metadata for video which recording by MediaRecorder

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?

Upvotes: 7

Views: 2093

Answers (1)

bingeScripter
bingeScripter

Reputation: 84

When initializing the MediaRecorder, add a detailed mimetype, seems to do the trick in my case:

let recorder = new MediaRecorder(stream, { mimeType: "video/mp4;codecs=avc1,mp4a.40.2" });

Upvotes: 0

Related Questions