# Video data size limit error

**URL:** <https://discourse.processing.org/t/video-data-size-limit-error/3769>\
**Category:** Coding Questions\
**Created:** [September 23, 2018, 4:48pm UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769 "2018-09-23T16:48:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 23, 2018, 4:48pm UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/1 "2018-09-23T16:48:48Z")

</div>

I am running into an error when attempting to load video which is around 200MB in size.

allocation size overflow [p5.dom.js:807:15](http://127.0.0.1:8698/libraries/p5.dom.js)

The error doesn’t occur with small videos.

please help, thanks

---

<div class="post-metadata">

**Author:** ![TheWizardBear](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/thewizardbear/32/3552_2.png) [@TheWizardBear](https://discourse.processing.org/u/TheWizardBear)\
**Post date:** [September 23, 2018, 5:28pm UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/2 "2018-09-23T17:28:11Z")

</div>

What environment are you using?

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 24, 2018, 1:56am UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/3 "2018-09-24T01:56:52Z")

</div>

p5.js + Firefox 62 + Linux Mint 18.3

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 24, 2018, 9:25am UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/4 "2018-09-24T09:25:59Z")

</div>

Maybe I should share an example bit of code.

```auto
ar film;
var fx,fy,fw,fh;

function setup() {
  createCanvas(windowWidth, windowHeight);
  input = createFileInput(handleFile);
  input.position(0, 0);
  noLoop();
}

function draw() {
  background(0);
  image(film,fx,fy,fw,fh);
}

function vidLoad() {
  film.play();
  var ratio = width/height;
  var fratio = film.width/film.height;
  if(ratio > fratio)//screen is more wide
  {
    fh = height;
    fw = film.width * (height/film.height);
    fy = 0;
    fx = width/2-fw/2;
  }
  else //film is wider
  {
    fw = width;
    fh = film.height * (width/film.width);
    fy = height/2-fh/2;
    fx = 0;
  }
  input.hide();
  loop()
}

function handleFile(file) { 
  print(file.type); 
  if (file.type === 'video') 
  { 
    film = createVideo(file.data,vidLoad); 
    film.hide(); 
  } 
} 

function windowResized() {
  resizeCanvas(windowWidth, windowHeight);
  var ratio = width/height;
  var fratio = film.width/film.height;
  if(ratio > fratio)//screen is more wide
  {
    fh = height;
    fw = film.width * (height/film.height);
    fy = 0;
    fx = width/2-fw/2;
  }
  else //film is wider
  {
    fw = width;
    fh = film.height * (width/film.width);
    fy = height/2-fh/2;
    fx = 0;
  }
  scaleX = width/100;
  scaleY = height/100;
  trackW = width;
  trackH = height;
}

```

---

<div class="post-metadata">

**Author:** ![TheWizardBear](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/thewizardbear/32/3552_2.png) [@TheWizardBear](https://discourse.processing.org/u/TheWizardBear)\
**Post date:** [September 24, 2018, 4:01pm UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/5 "2018-09-24T16:01:08Z")

</div>

It appears the file size limit for the p5.js editor is 5MB.

> <https://github.com/processing/p5.js-web-editor/issues/160>

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 24, 2018, 11:54pm UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/6 "2018-09-24T23:54:55Z")

</div>

Thank you, but I do not believe that is the issue I’m dealing with here. This issue also happens if I try to load the video from my assets, and I’m not really uploading here; I’m just selecting a local file. I can not imagine that all p5.js sketches are limited to using small videos only. I have it working with a 95MB video. I’m not sure where the exact cut off is.

Please help

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 29, 2018, 1:38am UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/7 "2018-09-29T01:38:56Z")

</div>

I have solved this issue.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 29, 2018, 3:18am UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/8 "2018-09-29T03:18:20Z")

</div>

Very glad to hear it!

Was there a solution you could share that might help others in a similar situation?

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [September 29, 2018, 3:40am UTC](https://discourse.processing.org/t/video-data-size-limit-error/3769/9 "2018-09-29T03:40:09Z")

</div>

Spongman created it: [https://github.com/processing/p5.js/issues/3237#issuecomment-424436519](https://github.com/processing/p5.js/issues/3237#issuecomment-424436519)
