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
I'm trying to parse a webm file, drop some SimpleBlocks, and adjust the Timecodes on each block so that I can effectively trim the video. I can create Clusters and Cluster Timecodes without an issue but encoding a SimpleBlocks is a problem. Although there is an Encoder() present, there seems to be no way to create/edit a SimpleBlock. I'm looking a function that can do the inverse of tools.readBlock.
(Currently I'm using ffmpeg (wasm) but it's a bit expensive on data.)
The text was updated successfully, but these errors were encountered:
I'm trying to play webm chunks with MediaSource. I want to skip the chunks before open stream. So i can play the stream anytime. WebM was recorded by MediaRecorder.
Some of them have been deleted, but times not right:
new Blob(
[
webmChunkBufferArray.shift(),
webmChunkBufferArray.shift(),
webmChunkBufferArray.shift()
],
{
type: mimeType
}
).arrayBuffer()
.then(buffer => {
const decoder = new Decoder();
const elms = decoder.decode(buffer);
console.debug(elms);
const recodeArray = [];
let count = 0;
for(const elm of elms) {
if (elm.name === "SimpleBlock" && count < 100) {
count ++;
continue;
}
recodeArray.push(elm);
}
console.debug(recodeArray);
const encoder = new Encoder();
const recodeBuffer = encoder.encode(recodeArray);
console.debug(recodeBuffer);
sourceBuffer.mode = 'sequence'; // must set!
sourceBuffer.appendBuffer(recodeBuffer);
});
But i do not know how to get SimpleBlock from mediaRecorder.ondataavailable() stream?
new Decoder().decode(buffer): buffer must start from the begin of the webm. If not, decode failure.
I'm trying to parse a
webm
file, drop someSimpleBlocks
, and adjust theTimecode
s on each block so that I can effectively trim the video. I can createCluster
s and ClusterTimecode
s without an issue but encoding aSimpleBlock
s is a problem. Although there is an Encoder() present, there seems to be no way to create/edit aSimpleBlock
. I'm looking a function that can do the inverse oftools.readBlock
.(Currently I'm using
ffmpeg
(wasm) but it's a bit expensive on data.)The text was updated successfully, but these errors were encountered: