# Movie Maker video doesn't sync

**URL:** <https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435>\
**Category:** Processing.py\
**Created:** [March 19, 2019, 8:22am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435 "2019-03-19T08:22:29Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 8:22am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/1 "2019-03-19T08:22:29Z")

</div>

I’ve got an issue with the native Movie Maker where the video rate exports with a framerate greater than specified. My sketch reacts to sound input so it’s clear to see that the exported .mov visuals don’t sync with the sound.

Both frameRate(30) is defined in setup() and a framerate of 30 set in the Movie Maker options.

I’m working in Processing.py

---

<div class="post-metadata">

**Author:** ![cansik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cansik/32/8815_2.png) [@cansik](https://discourse.processing.org/u/cansik)\
**Post date:** [March 19, 2019, 9:00am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/2 "2019-03-19T09:00:56Z")

</div>

Just because you set `frameRate(30)` does not guarantee you a constant framerate of **30 FPS**. Usually it’s about 28 to 29 FPS. Saving frames to a file costs a lot of computing power and so your sketch will run at about 10-15 FPS.

Now there are multiple solutions for this problem:

1. You could store the frames in a `PGraphics` list and buffer them till the recording ended, then save all the frames. This is possible, but it depends on the time you would like to record, because you don’t have unlimited memory. You could counter that with a separate thread, which then writes the `PGraphics` async onto the disk. But this maybe is slow too, because you would have to store the pixels on the CPU (with loadpixels) and GPU - CPU transfers can not be done multithreaded.

2. You write your software as a frame by frame renderer instead of a live renderer. You first define how long the animation should take, and then interpolate frame by frame for the animation. This of course can not react to live music, but it would be possible to read the audio file sample by sample.

3. Maybe the best solution is to use another software for recording. Send your sketch through [syphon](https://github.com/Syphon/Processing) to a software which is capable of recording syphon streams (f.e. [syphon recorder](http://syphon.v002.info/recorder/)).

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 11:11am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/3 "2019-03-19T11:11:48Z")

</div>

Ah… I had suspected as much. Thank you for the detailed response and suggestions.

I had thought that perhaps had a frame not corresponding to time been saved then the moviemaker would recycle a previous one as a placeholder. But of course it can’t because they’re named iteratively versus some framerate structure.

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 11:16am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/4 "2019-03-19T11:16:15Z")

</div>

I was exporting .jpg’s but .tga’s seem faster. Do we know for sure what exports quickest for lower drag?

---

<div class="post-metadata">

**Author:** ![cansik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cansik/32/8815_2.png) [@cansik](https://discourse.processing.org/u/cansik)\
**Post date:** [March 19, 2019, 11:47am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/5 "2019-03-19T11:47:28Z")

</div>

Check out the following library which is for direct video export (ffmpeg). It seems to be a bit faster then directly writing to the disk (opinion based, not measured).

[https://funprogramming.org/VideoExport-for-Processing/](https://funprogramming.org/VideoExport-for-Processing/)

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 11:48am UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/6 "2019-03-19T11:48:22Z")

</div>

Thanks again Cansik!

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 1:08pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/7 "2019-03-19T13:08:26Z")

</div>

Is it possible to use this library in python mode? I installed ffmpeg no problem but there doesn’t seem any way to install VideoExport via sketch \> import library. cc @hamoid

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [March 19, 2019, 1:15pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/8 "2019-03-19T13:15:04Z")

</div>

Did you try sketch \> import library \> add library? I see it listed there near the bottom of the list… if not, what OS and Processing version?

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 1:23pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/9 "2019-03-19T13:23:19Z")

</div>

Hi hamoid — I don’t see it nor does it appear with search “VideoExport” or “hamoid”.

I’m running processing 3 (3.5.3) on osx 10.10.5

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [March 19, 2019, 1:27pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/10 "2019-03-19T13:27:56Z")

</div>

What about “Video Export” with a space or “Abe”?

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 1:32pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/11 "2019-03-19T13:32:18Z")

</div>

Unfortunately no results.

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [March 19, 2019, 1:41pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/12 "2019-03-19T13:41:25Z")

</div>

You’re right. Somehow it is cached in my system but if you visit the library URL

[http://download.processing.org/contribs](http://download.processing.org/contribs)

you can see the Video Export library very much gone. I don’t know why.

You can still find it at [https://funprogramming.org/VideoExport-for-Processing/](https://funprogramming.org/VideoExport-for-Processing/)

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 1:43pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/13 "2019-03-19T13:43:48Z")

</div>

Sorry to ask such a noob question but how do I install it outside of the UI? I tried putting ‘com’ in a libraries folder (which is in the sketch folder) but even in java mode I get “The import com.hamoid cannot be resolved”. I really would like to continue working in python!

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [March 19, 2019, 1:47pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/14 "2019-03-19T13:47:36Z")

</div>

No problem 🙂

com? maybe you downloaded the source code instead?

At the top of the page click download, which scrolls to the middle of the page, where you can download a zip file. The file contains a VideoExport folder, which you drop into your Processing libraries folder. Then restart Processing and 🤞

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 2:07pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/15 "2019-03-19T14:07:31Z")

</div>

Awesome! It’s working locally. Looking forward to trying this out 🙂

Your reply sort of sounds like there’s a more general folder for adding processing libraries as opposed to storing local to the sketch folder. Is that true?

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [March 19, 2019, 2:18pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/16 "2019-03-19T14:18:10Z")

</div>

That’s true 🙂 Your sketchbook folder (which you can find in the Processing Preferences screen) should contain a `libraries` folder. That’s where you put libraries that can be used by all your sketches.

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [March 19, 2019, 2:35pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/17 "2019-03-19T14:35:13Z")

</div>

The withAudioViz example is exactly what I need. Now to translate to python!  
Thanks to @cansik for the recommendation and @hamoid for the library.

---

<div class="post-metadata">

**Author:** ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)\
**Post date:** [May 1, 2019, 12:52pm UTC](https://discourse.processing.org/t/movie-maker-video-doesnt-sync/9435/18 "2019-05-01T12:52:22Z")

</div>

Thanks again @cansik — Turns out Syphon was perfect for this job.
