I have a student who has built some stimuli in iMovie and exported the movies in mp4 format, h.264 encoded with an AAC 48kHz audio track. The movies have a sound that plays right from the start (i.e. the audio is present from the first frame). She’s using my PyHab script, which uses MovieStim with ffpyplayer and PTB.
The issue is that when the movie is loaded, the first ~100ms of the audio play (30fps movie, so about 3 frames). The same thing happens when the movie is reset with a “replay” or “seek” call.
This does not happen with every movie file I try it with, including other mp4s that have the same encoding, or at least both QuickTime and Adobe Premier think they have the same encoding. Re-exporting the movies that show this behavior doesn’t fix it.
The work-around I’ve come up with is to just edit the movie and delay the audio start time by 100ms, which works for this study but is not a real solution.
Has anyone else encountered these over-eager movie sounds recently or have any idea what in MovieStim allows this to happen? There were some similar issues in the past but they have long since been fixed, so I’m not sure what’s up with this.
The fact that it seems specific to some movie files (and particularly those made in iMovie) makes me suspect some manner of Apple nonsense, but I can’t find any hints about what it could actually be.