Giter Club home page Giter Club logo

Comments (9)

miroslavpejic85 avatar miroslavpejic85 commented on May 22, 2024 2

Hi bryankaplan, Sorry i misunderstood,

It hasn't happened to me yet, but if recording exceeds Blob, probably go on error and the rec will be not saved.
I should try to make a recording on a device with little ram and disk space for a long time...to see what happen,
in order to be able to give you a certain answer, anyway thanks for this question :)

Have a nice day.

from mirotalk.

miroslavpejic85 avatar miroslavpejic85 commented on May 22, 2024 1

I just did 1 hour of video recording from a old mobile phone, and I was unable to exceed the Blob size :),
But I have noticed that, when a video size is big, the download is not immediate, some time pass before it comes processed and downloaded. Therefore I added a popup messages, when you stop recording: eb45d7c

from mirotalk.

miroslavpejic85 avatar miroslavpejic85 commented on May 22, 2024

Hi bryankaplan, welcome!
The recording actually it's stored to your local browser blob: https://developer.mozilla.org/en-US/docs/Web/API/Blob and is automatically downloaded on end to your pc/mobile. https://github.com/miroslavpejic85/mirotalk/blob/master/www/js/client.js#L1642
Do you say that it is better to store it in the cloud or similar, Right?
Thanks.

from mirotalk.

bryankaplan avatar bryankaplan commented on May 22, 2024

Cool! I just tried it and it worked. But the previous two times I tried it, I was not prompted for a download. I'm not sure whether there was an error.

What happens if the blob exceeds maximum size?

from mirotalk.

miroslavpejic85 avatar miroslavpejic85 commented on May 22, 2024

Thanks :), You can follow Your browser log on console: press F12 then look on console
Regarding Blob, It depends on how much ram memory you have and disk space, for example for chrome:
https://chromium.googlesource.com/chromium/src/+/224e43ce1ca4f6ca6f2cd8d677b8684f4b7c2351/storage/browser/blob/README.md#blob-storage-limits
ref: https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size

from mirotalk.

bryankaplan avatar bryankaplan commented on May 22, 2024

I know how to look on the console. I was only pointing out that I didn't look on the console previously when I didn't receive a download prompt because I didn't know I was supposed to receive one.

That link does not seem to answer my question. I'm aware that blobs have a maximum size. That's why I'm asking you what happens when a recording exceeds it.

from mirotalk.

rudrathedev avatar rudrathedev commented on May 22, 2024

@bryankaplan so, u typically wanna point out for fast processing of large videos ?

from mirotalk.

bryankaplan avatar bryankaplan commented on May 22, 2024

@bryankaplan so, u typically wanna point out for fast processing of large videos ?

@anshuman2166AppproDev I don't understand what you're trying to ask.

from mirotalk.

miroslavpejic85 avatar miroslavpejic85 commented on May 22, 2024

HI @bryankaplan.

Trying to reach 2GB + of video recording is difficult for me, but I tried to allocate a buffer in the Blob with a size greater than 2GB, and In fact it generates an error as I imagined. So to your question what happens if the Blob size is exceeded, it goes into error and the recording is not saved. Although it is difficult that someone make a recording of that size. 🙂

Here how to reproduce

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test Blob</title>
    <script>
        function testBlob() {
            var byteLength = 2200000000; // 2GB OK | 2,2GB KO
            var buffer = new ArrayBuffer(byteLength);
            var blob = new Blob([buffer]);

            function bytesToSize(bytes) {
                var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
                if (bytes == 0) return '0 Byte';
                var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
                return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
            };

            var blobSizeInGB = bytesToSize(blob.size);
            console.log( blobSizeInGB );
        }
    </script>
</head>
<body>
    <button onclick="testBlob()">testBlob</button>
</body>
</html>

Output

blob.html:9 Uncaught RangeError: Array buffer allocation failed
    at new ArrayBuffer (<anonymous>)
    at testBlob (blob.html:9)
    at HTMLButtonElement.onclick (blob.html:25)

I also added the file size on recording info, and if for some reason the recording failed, I print to user the error.message : 697de25

from mirotalk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.