# Apply video effect to every frame

**URL:** <https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730>\
**Category:** Libraries\
**Created:** [May 31, 2019, 7:44am UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730 "2019-05-31T07:44:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cai](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Cai](https://discourse.processing.org/u/Cai)\
**Post date:** [May 31, 2019, 7:44am UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730/1 "2019-05-31T07:44:14Z")

</div>

hey guys, I recently learned to create the dithering effect  
image no. 1 is the processed image  
image no. 2 is the original image  
… Its a lil heavy effect , So im unable to use it on videos and see it effect realtime.  
image no.3 is when I try to apply the effect on the video. (it also skips frames.)

how would one go about — \> taking every frame of a video ----- \> processing each frame ----- \> and then saving the frame …

 ![foundationvideo](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a02271001a4be1bf0344badd464cb685b18a0f35.jpeg)

---

<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:** [June 5, 2019, 4:12am UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730/2 "2019-06-05T04:12:35Z")

</div>

> [@Cai](#):
>
> how would one go about — \> taking every frame of a video ----- \> processing each frame ----- \> and then saving the frame

Is this a performance question – how to make it more efficient? When you say “saving the frame” do you mean to a directory of images?

---

<div class="post-metadata">

**Author:** ![InferNova](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/infernova/32/6009_2.png) [@InferNova](https://discourse.processing.org/u/InferNova)\
**Post date:** [June 5, 2019, 11:52pm UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730/3 "2019-06-05T23:52:04Z")

</div>

Hey There!

Processing runs at 60 FPS maybe reduce it to 24 ( Standard for movies) saving pics at 60 FPS is a hefty job.

Did you also try threading?

---

<div class="post-metadata">

**Author:** ![Cai](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Cai](https://discourse.processing.org/u/Cai)\
**Post date:** [June 6, 2019, 4:10am UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730/4 "2019-06-06T04:10:36Z")

</div>

ideally i would love it real time … so what i think is happening now , with a certain video is that the program jumps to a future frame without displaying the result of the current frame .  
ex. while frame number 1 is not completely processed and the result it is viewable the video has already moved to a future frame , lets say frame number 15.  
So i want to process every frame of a video and save every frame … it is okay if i cant view it in the sketch window. as long as every frame of the video is processed and saved.

---

<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:** [August 4, 2019, 12:01am UTC](https://discourse.processing.org/t/apply-video-effect-to-every-frame/11730/5 "2019-08-04T00:01:36Z")

</div>

You can use video library setframe to load frames programmatically. Then transform and use saveFrame to save each frame image to disk.

processing-video/Frames.pde

Alternately, you could dump the frames to a free directory with QuickTime or ffmpeg etc, then loop over the images in the directory and edit them.
