# Error:VideoExport.startFfmpeg(Unknown Source) but ffmpeg is already installed

**URL:** https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977
**Category:** Processing.py
**Created:** [May 20, 2022, 5:13am UTC](https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977 "2022-05-20T05:13:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![salt](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@salt](https://discourse.processing.org/u/salt)
#### Post date: [May 20, 2022, 5:13am UTC](https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977/1 "2022-05-20T05:13:15Z")

</div>

Ffmpeg is already installed on your computer

C:\Users\Fu\>ffmpeg  
ffmpeg version 5.0.1-essentials\_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers

NullPointerException  
at com.hamoid.VideoExport.startFfmpeg(Unknown Source)  
at com.hamoid.VideoExport.initialize(Unknown Source)  
at com.hamoid.VideoExport.startMovie(Unknown Source)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:188)  
at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:206)  
at org.python.core.PyObject. **call** (PyObject.java:480)  
at org.python.core.PyObject. **call** (PyObject.java:484)  
at org.python.core.PyMethod. **call** (PyMethod.java:126)  
at org.python.pycode.\_pyx11.setup$1(musice.pyde:16)  
at org.python.pycode.\_pyx11.call\_function(musice.pyde)  
at org.python.core.PyTableCode.call(PyTableCode.java:171)  
at org.python.core.PyBaseCode.call(PyBaseCode.java:125)  
at org.python.core.PyFunction. **call** (PyFunction.java:403)  
at org.python.core.PyFunction. **call** (PyFunction.java:398)  
at jycessing.PAppletJythonDriver.setup(Unknown Source)  
at processing.core.PApplet.handleDraw(PApplet.java:2432)  
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)  
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)  
at jycessing.mode.run.SketchRunner.convertPythonSketchError(Unknown Source)  
at jycessing.mode.run.SketchRunner.lambda$startSketch$3(Unknown Source)  
at java.lang.Thread.run(Thread.java:748)

code

```auto
add_library('VideoExport')
add_library('minim')
minim = Minim(this)
export = VideoExport(this)

def setup():
    global player, fft, fftScale, export
    bg = loadImage("001.jpg")
    size(720,540)
    export.startMovie()
    player = minim.loadFile("2.mp3")
    player.play()
    fft = FFT(player.bufferSize(), player.sampleRate())
    fftScale = 50
    colorMode(HSB)
    frameRate(30)
    
def draw():
    background(255, 204, 0)
    fft.forward(player.mix)
    specLength = fft.specSize()/2
    j = 0
    for i in range(specLength):
      j = j +1
      if (j %2 == 0):
          continue
      
      ffti = sqrt(fft.getBand(i)) * fftScale
      basis = width/6 + 2 *sin(0.5*i + frameCount)
      angle = map(i, 0, specLength-1, -0.5*PI, 1.5*PI)
      
      startX = width/2 + cos(angle)*basis
      startY = height/2 + sin(angle)*basis
      
      endX = width/2 + cos(angle) * (basis+ffti)
      endY = height/2 + sin(angle) * (basis+ffti)
      
      stroke(map(i, 0, specLength-1, 0, 255), 255, 255)
      strokeWeight(2)
      line(startX, startY, endX, endY)
      export.saveFrame()
      
def keyPressed():
  if (key == 'q'):
    export.endMovie()
    exit()

```

---

<div class="post-metadata">

### Author: ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)
#### Post date: [May 20, 2022, 5:41am UTC](https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977/2 "2022-05-20T05:41:26Z")

</div>

Welcome, @salt

Move your `VideoExport(this)` line to the setup block instead. For example –

```python
add_library('VideoExport')

def setup():
    global export
    export = VideoExport(this)
    export.startMovie()
    
def draw():
    background(0)
    circle(frameCount%width, height/2, 10)
    export.saveFrame()
      
def mouseClicked():
    export.endMovie()
    exit()

```
