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
tools.makeMetadataSeekable returns broken webm file on server side (node.js), it works on browser though. mkinfo returns (MKVInfo) No EBML head found. This file is probably not a Matroska file.
When I decode created webm file, it returns following error.
When buffer[start] == 0 , then Math.log2() goes to Infinite.
I'm investigating what causes this issue, especially makeMetadataSeekable() works on browser side.
Any suggestion would be appreciated!
how to reproduce
here is my simple test code to reproduce this error. (or simply try cli.js and check resulted webm)
// index.jsconstfs=require('fs');constpath=require('path');constebml=require("ts-ebml");const{ Decoder, Reader, tools }=ebml;asyncfunctionfixWebmDuration(filePath){console.log("fixWebmDuration(), filePath=",filePath);letwebMBuf;try{webMBuf=fs.readFileSync(filePath);}catch(err){console.error(err);returnnull;}constreader=checkWebm(webMBuf,"Original WebM file");// make webm seekable!constrefinedMetadataArrayBuf=tools.makeMetadataSeekable(reader.metadatas,reader.duration,reader.cues);constrefinedMetadataBuf=convertArrayBufferToBuffer(refinedMetadataArrayBuf);constbody=webMBuf.subarray(reader.metadataSize);returnBuffer.from(tools.concat([refinedMetadataBuf,body]).buffer);}functioncheckWebm(buffer,logName){console.log('checkWebmDuration');constdecoder=newDecoder();constreader=newReader();reader.logging=true;reader.logGroup=logName;reader.drop_default_duration=false;constrefinedElms=decoder.decode(buffer);refinedElms.forEach((elm)=>{reader.read(elm);});reader.stop();returnreader;}functionconvertArrayBufferToBuffer(arrayBuffer){returnBuffer.from(arrayBuffer);}asyncfunctionfix(filepath){console.log('fix');constrawWebmPath=filepath;constrefinedBuffer=awaitfixWebmDuration(rawWebmPath);checkWebm(refinedBuffer,"Refined WebM file");constrefinedFilename='fixed.webm';constfilePath=path.join(__dirname,refinedFilename);console.log('filePath',filePath);// Write the Buffer to a filetry{fs.writeFileSync("fixed.webm",refinedBuffer);console.log('File written successfully');}catch(err){console.error(err);}}constfilepath=path.join(__dirname,'test_chrome52.webm');fix(filepath);
The text was updated successfully, but these errors were encountered:
tools.makeMetadataSeekable returns broken webm file on server side (node.js), it works on browser though.
mkinfo
returns(MKVInfo) No EBML head found. This file is probably not a Matroska file.
When I decode created webm file, it returns following error.
Uncaught Error: Unrepresentable length: Infinity
Also, /lib/cli.js is not working.
The error above comes from readVint function ebml.js package here
When
buffer[start] == 0
, thenMath.log2()
goes to Infinite.I'm investigating what causes this issue, especially
makeMetadataSeekable()
works on browser side.Any suggestion would be appreciated!
how to reproduce
here is my simple test code to reproduce this error. (or simply try cli.js and check resulted webm)
The text was updated successfully, but these errors were encountered: