# Slight pause when reversing video playback speed

**URL:** https://discourse.processing.org/t/slight-pause-when-reversing-video-playback-speed/38325
**Category:** Libraries
**Created:** [August 12, 2022, 2:28pm UTC](https://discourse.processing.org/t/slight-pause-when-reversing-video-playback-speed/38325 "2022-08-12T14:28:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sm0ldata](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sm0ldata/32/16796_2.png) [@sm0ldata](https://discourse.processing.org/u/sm0ldata)
#### Post date: [August 12, 2022, 2:28pm UTC](https://discourse.processing.org/t/slight-pause-when-reversing-video-playback-speed/38325/1 "2022-08-12T14:28:59Z")

</div>

Hi all – I’m working on a project that requrires looping certain portions of a video by sort of scrubbing backwards and forwards over the same portion – i.e. play the video from 00:37 to 00:48, then reverse the speed so it plays backwards to 00:37, and then repeat. I have a sloppy proof of concept that works fine, with the very significant exception that there is a short (maybe 500ms) pause before it “changes direction” on both ends of the loop. Being a n00b I can’t tell if this is an inherent limitation of the video library, or my crappy code? Any ideas based on the below?

Again, please bear in mind this was just a quick and dirty proof of concept…

```auto
import processing.video.*;

Movie myMovie;

void setup(){
    size(720, 480);
    myMovie = new Movie(this, "/path/to/video.mp4");
    myMovie.play();
    myMovie.jump(37);
}

void draw(){
    image(myMovie, 0, 0);
        if (myMovie.time() <= 37){
        myMovie.speed(1.0);
        myMovie.play();
    }
    if (myMovie.time() >= 48{
        myMovie.speed(-1.0);
        myMovie.play();
    }
}

void movieEvent(Movie m) {
    m.read();
}

```
