Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory error analyzing chrome generated webm #285

Open
millzee01 opened this issue Feb 1, 2021 · 4 comments
Open

memory error analyzing chrome generated webm #285

millzee01 opened this issue Feb 1, 2021 · 4 comments
Labels
new feature request Planned Feature or New Feature Request status: low

Comments

@millzee01
Copy link

millzee01 commented Feb 1, 2021

Hi,

I use mediarecorder and capturestream to record canvas animations to webm,

The video output works fine in the browser, however when I upload the generated webm to php and analyze it using:

$ThisFileInfo = $getID3->analyze($file);

If the file is created with any chromium browsers, my server errors out with a memory error:
PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 72057594037927968 bytes) in /var/www/html/objects/getid3/getid3.php on line 2063

the webm file is actually only 2mb.

If i use firefox to create the webm and upload, i have no problems at all.

any ideas why a chromium generated webm causes this issue?

The video contains no audio, just video.

@JamesHeinrich
Copy link
Owner

Can you supply both a working (Firefox) and broken (Chrome) sample file for me to look at?

@millzee01
Copy link
Author

millzee01 commented Feb 1, 2021

sure

These were created without ts-ebml intervention:
https://lnk-mi.app/uploads/chrome.webm
https://lnk-mi.app/uploads/firefox.webm

These were created using ts-ebml:
https://lnk-mi.app/uploads/chrome-ts-ebm.webm
https://lnk-mi.app/uploads/firefox-ts-ebml.webm

both were created exactly the same way using ts-ebml.js to write the meta-data
recorder.addEventListener("dataavailable", async(e) => {
try {
const makeMediaRecorderBlobSeekable = await injectMetadata(e.data);
data.push(await new Response(makeMediaRecorderBlobSeekable).arrayBuffer());
blobData = await new Blob(data, { type: supportedType });
} catch (e) {
console.error(e);
console.trace();
}
});

both firefox files are noticeably bigger, however chrome video play fine in firefox and firefox videos play fine in chrome.

both firefox videos analyze fine with getid3, however the chrome ones cause a memory problem.

@JamesHeinrich
Copy link
Owner

Presumably its due to an incomplete EBML implementation in getID3, but since it's a detected abnormality and not an actual crashing error I'm going to defer this for now. If someone more familiar with Matroska structure than I would like to submit a patch I would be interested.
I'll leave this issue open, but I don't expect to apply a fix anytime soon.

@millzee01
Copy link
Author

Ok, thanks. i've switched to decoding the video with whammy on chrome which resolved my initial issue.

But like you said, its worth keeping open so anyone else with the same kind of problem has somewhere to potentially go.

@StudioMaX StudioMaX added new feature request Planned Feature or New Feature Request status: low labels May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request status: low
Projects
None yet
Development

No branches or pull requests

3 participants