Movie sync issues with psychopy

454 views
Skip to first unread message

Gradstudent

unread,
Jan 28, 2016, 7:25:06 AM1/28/16
to psychopy-users
Hello,
I am trying to play movies in psychopy and my movie isnt syncing correctly. When the movie starts, the audio input comes online first while the visual input is slower and almost pixellated. Then, when both the audio and visual input are playing, they are out of sync. As a side note, when I play this movie on my computer's video player (quicktime) the movie works well. I have attached videos of the movie using psychopy and using quicktime to compare.

I am using v 1.82 and avbin for backend. Originally I wanted to play a loop of movies, but for now I had removed the loop and am only playing 1 movie, which I have specified the file name under movie. It is a .mp4 movie that is 10s long. I would appreciate any help!

Computer info:

Software  Mac OS X Lion 10.7.5 (11G63)

Processor  2 GHz Intel Core i7

Memory  4 GB 1333 MHz DDR3

Graphics  Intel HD Graphics 3000 384 MB


Movie info:
Kind MPEG-4 movi
Size 13,900,357 bytes (13.9 MB on disk)
Dimensions 1920 × 1080
Codecs H.264, AAC
Audio channels 2
Total bit rate 12,753

I also tried to download the standalone mac osx version of psychopy 1.83.03 on github, but whenever I try to open the problem I get an error which says i can terminate psychopy or go to the console. When I go to the console, this is what I see:

1/27/16 8:54:12.673 PM Microsoft Word: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 88
1/27/16 8:54:12.673 PM Microsoft Word: kCGErrorIllegalArgument: CGSGetWindowResolution: Invalid window 0x58
1/27/16 8:54:12.673 PM Microsoft Excel: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 81
1/27/16 8:54:12.673 PM Microsoft Excel: kCGErrorIllegalArgument: CGSGetWindowResolution: Invalid window 0x51
1/27/16 8:54:12.673 PM Microsoft Word: error [1001] getting window resolution
1/27/16 8:54:12.674 PM Microsoft Word: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 88
1/27/16 8:54:12.674 PM Microsoft Excel: error [1001] getting window resolution
1/27/16 8:54:12.674 PM Microsoft Word: kCGErrorIllegalArgument: CGSSetWindowResolution: Invalid window 0x58
1/27/16 8:54:12.674 PM Microsoft Excel: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 81
1/27/16 8:54:12.674 PM Microsoft Excel: kCGErrorIllegalArgument: CGSSetWindowResolution: Invalid window 0x51
1/27/16 8:54:12.674 PM Microsoft Word: Error [1001] setting resolution to 1
1/27/16 8:54:12.674 PM Microsoft Excel: Error [1001] setting resolution to 1
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2: Traceback (most recent call last):
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/__boot__.py", line 381, in <module>
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     _run()
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/__boot__.py", line 362, in _run
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     exec(compile(source, path, 'exec'), globals(), globals())
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/psychopyApp.py", line 56, in <module>
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     app = PsychoPyApp(0, showSplash=showSplash)
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 81, in __init__
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     self.onInit(**kwargs)
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 121, in onInit
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     from psychopy.app import coder, builder, dialogs, wxIDs, urls #import coder and builder here but only use them later
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/__init__.py", line 4, in <module>
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     from builder import *
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py", line 14, in <module>
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     import experiment, components
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/experiment.py", line 10, in <module>
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:     from lxml import etree
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2: ImportError: dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/lxml/etree.so, 2): Symbol not found: _lzma_auto_decoder
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   Referenced from: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/lxml/etree.so
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:   Expected in: flat namespace
1/27/16 8:54:15.432 PM [0x0-0x6b06b].org.psychopy.PsychoPy2:  in /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/lxml/etree.so
1/27/16 8:54:15.441 PM PsychoPy2: PsychoPy2 Error

IMG_8717.MOV
IMG_8718.MOV

Jonathan Peirce

unread,
Jan 29, 2016, 7:21:04 AM1/29/16
to psychop...@googlegroups.com
First of all, top marks for your message level-of-detail. :-)

From your movie size I think the main problem is that avbin can't cope with that resolution. Try the opencv backend instead of avbin (but also you'll need the 32bit version of VLC installed which you can find here:
    http://www.afterdawn.com/software/audio_video/media_players/vlc_for_mac.cfm

On top of that, I'm surprised that the audio is working at all given that you've compressed it with AAC. Last I knew avbin couldn't read that in! Could you resave the movie with linear/PCM audio encoding instead of AAC?

Thanks for the detail from the console of the 1.83.03 "will not start" problem. That will be fixed in the next release (which is 64bit and so any version of VLC can be used, and an entirely new movie output option)

best wishes
Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/0e8a8da5-6111-4938-ae69-fa7b53ecb1cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
University of Nottingham

http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

Gradstudent

unread,
Jan 29, 2016, 4:34:41 PM1/29/16
to psychopy-users
Hi John,

Thanks so much for your reply.

I was able to download the newest version of psychopy on yosemite (my version of lion was not compatible); however I was having similar issues. Avbin was giving me the weird pixelation. Moviepy and opencv were resulting in no pixelation (yay) but other issues. Opencv ran but the visual output was chopping due to dropped frames for every other frames. Moviepy resulted in out of sync audio and visual output.

I am wondering if I can run this on my mac, given that I have a standard graphics card for a mac laptop, or if I need a PC with a better graphics card. Any ideas?

Unfortunately, I am not very familiar with video editing (I am a psychologist and neuroscientist, not a media person). Can you clarify what you mean by "Could you resave the movie with linear/PCM audio encoding instead of AAC?" I edited my videos using Premiere but I do not know the different encoding types you are mentioning. How can I do this?

Thanks so much!

Jonathan Peirce

unread,
Feb 1, 2016, 5:58:17 AM2/1/16
to psychop...@googlegroups.com
I've seen good performance from standard mac laptops.

When you save your edited movie file from Premiere it probably gave options for how to 'encode' each part (video and audio streams). I don't know what options it offers but see if one of them says something like 'linear' (or anything other than AAC actually)

cheers
Jon

For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

Gradstudent

unread,
Feb 5, 2016, 3:10:16 PM2/5/16
to psychopy-users
Hi Jon,
Sorry for the delayed reply. I did not see on Premiere how to edit audio that way. However, I did change the files to H264, CBR, 8bit. It helped for 1 movie but not another (continued to have many many dropped frames and choppy). I tried to run the task by rebooting my mac as a PC. This helped with a good amount of syncing issues, but I am still experiencing a ton of dropped frames. Do you have any suggestions? The videos run fine on a standard video player but have issues in psychopy. I am using vlc.

As a side note, the videos run fine on my husband's PC with an enhanced graphics card, but he is in grad school across the country so I cannot use his computer. I am trying to find out if there is any way to run the task in psychopy using a Mac with an intel graphics card.

Here are my husband's computer specs, in case they would be helpful. Do you have any idea what is causing the issue running the movies on psychpy or a solution?

He is on a ASUS K55VJ:

Processor
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Video Card 1Intel(R) HD Graphics 4000
Video Card 2NVIDIA GeForce GT 635M
Memory8.0 GB
Operating SystemMicrosoft Windows 10 (build 10586), 64-bit

Jonathan Peirce

unread,
Feb 10, 2016, 9:01:19 AM2/10/16
to psychop...@googlegroups.com
Ultimately then it might simply be that your machine isn't powerful enough to do this with psychopy. There are various reasons that VLC could play the movie better:
    - VLC is written in C not in Python which is faster to run but harder to code
    - VLC isn't doing anything else, like checking for responses or interpreting the next step in the experiment.
    - VLC was written by mdeia people not psychologists/neuroscientists ;-)

best wishes
Jon

For more options, visit https://groups.google.com/d/optout.

Gradstudent

unread,
Feb 10, 2016, 11:17:38 AM2/10/16
to psychopy-users
Hi John,
Thank you for your continued assistance.

Is there possibly an alternative reason that you can think of? I ask this because my husband's older laptop runs the movies fine (using VLC), but the higher end mac desktop at my university's imaging center experiences many dropped frames (also using VLC).

I have very little knowledge, but from a lay person perspective this makes me question if this really is a matter of needing a higher end computer, and also that this might not be a vlc specific issue- since it works on one computer significantly better than another while both using VLC.

Thank you,
Katie

Jon Peirce

unread,
Feb 10, 2016, 5:18:45 PM2/10/16
to psychop...@googlegroups.com
I really don't know any more than I've told you.
Jon

For more options, visit https://groups.google.com/d/optout.

-- 
Jon Peirce
http://www.peirce.org.uk

Katie Jankowski

unread,
Feb 10, 2016, 6:06:29 PM2/10/16
to psychop...@googlegroups.com
Thank you for your thoughtful feedback.

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/OttQCH2sQEw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages