2

Movies aren't played. Matlab crushed even when I tried to run "SimpleMovieDemo".

I've done all recommendations suggested when running on Windows in this post: https://github.com/Psychtoolbox-3/Psychtoolbox-3/issues/234. I use "matlab.exe -nojvm", and tried many combinations of java, GStreamer and Matlab versions.

I still get this error when simply running "SimpleMovieDemo":

PTB-ERROR: Due to failed GStreamer initialization, the movie playback engine is disabled for this session.

Error in function OpenMovie:    Usage error
GStreamer initialization failed due to library loading problems. Aborted.
Error using Screen
Usage:

[ moviePtr [duration] [fps] [width] [height] [count] [aspectRatio]]=Screen('OpenMovie', windowPtr, moviefile [, async=0] [, preloadSecs=1] [, specialFlags1=0][, pixelFormat=4][,
maxNumberThreads=-1][, movieOptions]);

Error in SimpleMovieDemo (line 49)
    movie = Screen('OpenMovie', win, moviename);

Please help me display movies via Matlab PTB.

Sharonas Ykm
  • 427
  • 2
  • 4
  • 13

2 Answers2

2

tl;dr: Reinstall GStreamer, but pick "Custom installation" (Don't use "complete" or "regular" options!) on installation, then pick all the components options manually. After that, "SimpleMovieDemo" will work as expected via "Matlab.exe -nojvm".

It took some time until I found this little hiding solution under "help gstreamer", but under the header "Apple OSX", but it works like a charm on Windows 10 x64:

When the installer asks you to select the components it should install, select a "Custom installation" (instead of a "Basic installation" or such). Then, if you chose a "Custom installation" in the displayed check list of packages to install, select all components manually, if you want support for all video formats and all functionality. Without this, many popular video formats like H264 video will not play at all, or video recording / video capture and similar functions may not work. In fact, even our own demos, e.g., SimpleMovieDemo will fail if you don't have all codecs installed! -> If SimpleMovieDemo doesn't work, then the most likely cause is that you didn't select all GStreamer packages for installation, so restart the installer and repeat installation with the full set of packages.

Sharonas Ykm
  • 427
  • 2
  • 4
  • 13
0

Actually pick "Custom installation" doesn't work for my psychotoolbox. I also met the same problem with you. My psychotoolbox version was 3.0.15 at that time and looked for answer on the google.

I found the url: https://github.com/Psychtoolbox-3/Psychtoolbox-3/wiki/FAQ#how-to-resolve-gstreamer-problems. It said "On Windows: Upgrade to Psychtoolbox 3.0.16 with GStreamer 1.16.0 MSVC or later and retry."

Then I upgrade my Psychtoolbox to the latest version of 3.0.17 and download the GStreamer 1.18.1 runtime MSVC(Not the development version or MingW, they won't work). I choose the typical installation for my GStreamer and then test SimpleMovieDemo on matlab.

Finally, it worked. I actually don't know the reason but hope my experience can help you.

Ming Zhou
  • 1
  • 1