[mediacapture-record] How to fix 2-N video tracks of concatenated Blobs of media recording not rendering playback?

guest271314 has just created a new issue for https://github.com/w3c/mediacapture-record:

== How to fix 2-N video tracks of concatenated Blobs of media recording not rendering playback? ==
This issue is a followup to https://github.com/w3c/mediacapture-record/issues/130.

After further browsing questions, answers and documentations arrived at the following, which is close to what am trying to achieve without third party software, using a server, or system calls; though does not meet requirement fully, yet.

According to [FFmpeg FAQ](https://ffmpeg.org/faq.html) at [3.14.3 Concatenating using the concat protocol (file level)](https://ffmpeg.org/faq.html#toc-Concatenating-using-the-concat-protocol-_0028file-level_0029)

> A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate video by merely concatenating the files containing them.

Using pattern at this [Answer](https://stackoverflow.com/a/44398123) at [webRTC convert webm to mp4 with ffmpeg.js](https://stackoverflow.com/q/44392027) we can convert `video/webm` to `video/mp4`

> So you can get mp4 recording directly from chrome MediaRecorder with following hack
> 
> ```
> var options = {mimeType: 'video/webm;codecs=h264'}; 
> mediaRecorder = new MediaRecorder(stream, options);
> .....
> //Before merging blobs change output mime 
> var blob = new Blob(recordedBlobs, {type: 'video/mp4'});
> // And name your file as video.mp4
> ```

Have been able to create videos using `MediaRecorder` and concatenate the resulting `Blob`s using `new Blob(chunks, {type:"video/mp4"})` where `chunks` is an array of `Blob`s resulting from `event.data` of `dataavailable` event, stored at an array, where the `Blob`s can be arranged in any order.

The issue is that no matter the order of the `Blob`s passed to `new Blob()` only the first video recording plays, then stops at the last frame of the first video, while each of the audio parts of the concatenated `Blob`s render playback. 

The expected result is for each video and audio render playback, not for audio to continue playback following first concatenated `Blob` while video following first concatenated `Blob` does not render playback. 

How to solve this issue? 










Please view or discuss this issue at https://github.com/w3c/mediacapture-record/issues/132 using your GitHub account

Received on Tuesday, 22 August 2017 16:38:26 UTC