# Inserting Movie in the experiment

**URL:** <https://discourse.psychopy.org/t/inserting-movie-in-the-experiment/879>\
**Category:** Builder\
**Created:** [August 15, 2016, 6:26am UTC](https://discourse.psychopy.org/t/inserting-movie-in-the-experiment/879 "2016-08-15T06:26:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thwan](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@thwan](https://discourse.psychopy.org/u/thwan)\
**Post date:** [August 15, 2016, 6:26am UTC](https://discourse.psychopy.org/t/inserting-movie-in-the-experiment/879/1 "2016-08-15T06:26:34Z")

</div>

Hi all, I am trying to put two movieclips in PsychoPy for an experiment. Each clip stand for around 5 mins in mpeg4 format. However, I received a message below. I tried to use other movie clips in different format but I still got the same message. Am I missing sth to install?

```auto
Output
IOError: Error in file Video1.mp4, At time t=319.73-320.18 seconds, indices wanted: 100000-119937, but len(buffer)=119052
index 119052 is out of bounds for axis 0 with size 119052

```

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [August 15, 2016, 9:33pm UTC](https://discourse.psychopy.org/t/inserting-movie-in-the-experiment/879/2 "2016-08-15T21:33:14Z")

</div>

I think this means the sound and video are slightly different lengths. Possibly you could ‘recode’ the movies using a tool like Handbrake to get things aligned (just try on one movie first to see if it works).  
In the longer term, @jwe080 found a fix for a similar looking problem (linked below) that is now a part of PsychoPy, so this will hopefully go away anyway in the next release.

> [@Moviestim 1/2/3, mp4s, pauses and IOErrors](http://discourse.psychopy.org/t/moviestim-1-2-3-mp4s-pauses-and-ioerrors/637):
>
> Hi there, I want to show a set of movie clips separated by fixation. I had working code just using the pyschopy library from the command line but somehow broke the module by installing avbin10 when I tried running my code in the standalone version of psychopy and it asked for avbin10 to play the mp4. In the standalone version 1.84.0rc4: If the movie is loaded as MovieStim then there are a pauses and some odd low res frames at the beginning and end of each clip and some kind of memory dequeui…

---

<div class="post-metadata">

**Author:** ![thwan](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@thwan](https://discourse.psychopy.org/u/thwan)\
**Post date:** [August 17, 2016, 3:58am UTC](https://discourse.psychopy.org/t/inserting-movie-in-the-experiment/879/3 "2016-08-17T03:58:51Z")

</div>

> [@jon](#):
>
> recode

After using the “recoding” software, the videos can be displayed in PsychoPy normally. Thank you very much for your great help, Jon! 🙂
