# Export gif, CCapturer

**URL:** https://discourse.processing.org/t/export-gif-ccapturer/21008
**Category:** Libraries
**Created:** [May 18, 2020, 9:46am UTC](https://discourse.processing.org/t/export-gif-ccapturer/21008 "2020-05-18T09:46:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cuvner](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@cuvner](https://discourse.processing.org/u/cuvner)
#### Post date: [May 18, 2020, 9:46am UTC](https://discourse.processing.org/t/export-gif-ccapturer/21008/1 "2020-05-18T09:46:32Z")

</div>

Hello,

I have a file directory error which I cannot seem to resolve, any help much appreciated.  
Its the “js/gif.worker.js”  
html

```auto
<!DOCTYPE html><html lang="en"><head>
    <script src="p5.js"></script>
    <script src="p5.sound.min.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8">

  </head>
  <body>
    <script src="sketch.js"></script>
     <script src="CCapture.all.min.js"></script>
     <script src="js/gif.worker.js"></script>
    <script> 
    var capturer = new CCapture( {
	framerate: 60,
      format: 'gif',
      workersPath:'./js/',
	verbose: true
} );
    </script>
  

```

 ![Screenshot 2020-05-18 at 10.44.04](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8dcfb8a6fa89251cf4fce259cd154a71b6f8ff94.png) ![Screenshot 2020-05-18 at 10.42.53](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8578cec411e51a07be603e2c467e4bd69fa4f85d.png)

Here is the sketch

```auto
let gifLength = 180;
let canvas;
let x = 0;

function setup() {
  p5Canvas = createCanvas(600, 600);
  canvas = p5Canvas.canvas;
  capturer.start();
  ellipseMode(CENTER);
  imageMode(CENTER);

}

function draw() {
  background(240);
  ellipse(x, 100, 50, 50);
  x = x += 3;
  if (x == width) {
    x = 0;
  }

  if (frameCount < gifLength) {
    capturer.capture(canvas);
  } else if (frameCount === gifLength) {
    capturer.stop();
    capturer.save();
  }

}

```

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [May 18, 2020, 11:17am UTC](https://discourse.processing.org/t/export-gif-ccapturer/21008/2 "2020-05-18T11:17:01Z")

</div>

This is the only sketch I’ve done some gif experiments on CCapture library: 🥴

https://glitch.com/embed/#!/embed/ccapture-bouncing-colorful-balls-demo?path=sketch.js&previewSize=0&sidebarCollapsed=true
