Skip to content

Instantly share code, notes, and snippets.

@jokester
Created March 3, 2015 00:55
Show Gist options
  • Save jokester/3384489de1a947175635 to your computer and use it in GitHub Desktop.
Save jokester/3384489de1a947175635 to your computer and use it in GitHub Desktop.
Psychtoolbox: problem loading movie file of particular format
GNU Octave, version 3.8.1
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.
Octave was configured for "x86_64-pc-linux-gnu".
Additional information about Octave is available at http://www.octave.org.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html
Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.
warning: function /usr/share/octave/packages/specfun-1.1.0/erfcinv.m shadows a built-in function
warning: function /usr/share/octave/packages/specfun-1.1.0/expint.m shadows a core library function
warning: function /usr/share/octave/packages/specfun-1.1.0/ellipke.m shadows a core library function
warning: function /usr/lib/x86_64-linux-gnu/octave/packages/specfun-1.1.0/x86_64-pc-linux-gnu-api-v49+/ellipj.oct shadows a built-in function
PTB-INFO: Display ':0' : X-Screen 0 : Assigning primary output as 0 with RandR-CRTC 0 and GPU-CRTC 0.
screenNumber = 0
libGL error: failed to authenticate magic 12
libGL error: failed to load driver: vboxvideo
INFO: Movie: /home/o_kan/ifso-stallman-mpeg1_512kb.mp4 : 6147.040000 seconds duration, 0.000000 fps, w x h = 0 x 0...
frameTime=-1.000000
% dpkg -l | egrep -i "psych|gstream|libgcc|libgl1|libglu1"
ii gir1.2-gst-plugins-base-1.0 1.2.4-1~ubuntu1 amd64 Description: GObject introspection data for the GStreamer Plugins Base library
ii gir1.2-gstreamer-1.0 1.2.4-0ubuntu1 amd64 Description: GObject introspection data for the GStreamer library
ii gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugin for ALSA
ii gstreamer0.10-fluendo-mp3:amd64 0.10.23.debian-3 amd64 Fluendo mp3 decoder GStreamer 0.10 plugin
ii gstreamer0.10-nice:amd64 0.1.4-1 amd64 ICE library (GStreamer 0.10 plugin)
ii gstreamer0.10-plugins-bad:amd64 0.10.23-7.2ubuntu1 amd64 GStreamer plugins from the "bad" set
ii gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins from the "base" set
ii gstreamer0.10-plugins-base-apps 0.10.36-1.1ubuntu2 amd64 GStreamer helper programs from the "base" set
ii gstreamer0.10-plugins-good:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugins from the "good" set
ii gstreamer0.10-plugins-ugly:amd64 0.10.19-2ubuntu5 amd64 GStreamer plugins from the "ugly" set
ii gstreamer0.10-pulseaudio:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugin for PulseAudio
ii gstreamer0.10-tools 0.10.36-1.2ubuntu3 amd64 Tools for use with GStreamer
ii gstreamer0.10-x:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins for X11 and Pango
ii gstreamer1.0-clutter 2.0.8-1build1 amd64 Clutter PLugin for GStreamer 1.0
ii gstreamer1.0-fluendo-mp3:amd64 0.10.23.debian-3 amd64 Fluendo mp3 decoder GStreamer 1.0 plugin
ii gstreamer1.0-libav:amd64 1.2.4-1~ubuntu1 amd64 libav plugin for GStreamer
ii gstreamer1.0-plugins-bad:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugins from the "bad" set
ii gstreamer1.0-plugins-bad-faad:amd64 1.2.4-1~ubuntu1 amd64 GStreamer faad plugin from the "bad" set
ii gstreamer1.0-plugins-bad-videoparsers:amd64 1.2.4-1~ubuntu1 amd64 GStreamer videoparsers plugin from the "bad" set
ii gstreamer1.0-plugins-base:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugins from the "base" set
ii gstreamer1.0-plugins-good:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugins from the "good" set
ii gstreamer1.0-plugins-ugly:amd64 1.2.3-2build1 amd64 GStreamer plugins from the "ugly" set
ii gstreamer1.0-pulseaudio:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugin for PulseAudio
ii gstreamer1.0-tools 1.2.4-0ubuntu1 amd64 Tools for use with GStreamer
ii gstreamer1.0-x:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugins for X11 and Pango
ii libclutter-gst-2.0-0:amd64 2.0.8-1build1 amd64 Open GL based interactive canvas library GStreamer elements
ii libgcc-4.8-dev:amd64 4.8.2-19ubuntu1 amd64 GCC support library (development files)
ii libgcc1:amd64 1:4.9.1-0ubuntu1 amd64 GCC support library
ii libgl1-mesa-dev 10.1.3-0ubuntu0.3 amd64 free implementation of the OpenGL API -- GLX development files
ii libgl1-mesa-dri:amd64 10.1.3-0ubuntu0.3 amd64 free implementation of the OpenGL API -- DRI modules
ii libgl1-mesa-glx:amd64 10.1.3-0ubuntu0.3 amd64 free implementation of the OpenGL API -- GLX runtime
ii libglu1-mesa:amd64 9.0.0-2 amd64 Mesa OpenGL utility library (GLU)
ii libgstreamer-perl 0.19-1 amd64 Perl interface to the GStreamer media processing framework
ii libgstreamer-plugins-bad0.10-0:amd64 0.10.23-7.2ubuntu1 amd64 GStreamer shared libraries from the "bad" set
ii libgstreamer-plugins-bad1.0-0:amd64 1.2.4-1~ubuntu1 amd64 GStreamer development files for libraries from the "bad" set
ii libgstreamer-plugins-base0.10-0:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer libraries from the "base" set
ii libgstreamer-plugins-base1.0-0:amd64 1.2.4-1~ubuntu1 amd64 GStreamer libraries from the "base" set
ii libgstreamer-plugins-good1.0-0:amd64 1.2.4-1~ubuntu1 amd64 GStreamer development files for libraries from the "good" set
ii libgstreamer0.10-0:amd64 0.10.36-1.2ubuntu3 amd64 Core GStreamer libraries and elements
ii libgstreamer1.0-0:amd64 1.2.4-0ubuntu1 amd64 Core GStreamer libraries and elements
ii octave-psychtoolbox-3 3.0.11.20131230.dfsg1-1build1 amd64 toolbox for vision research -- Octave bindings
ii parole 0.6.1-0ubuntu3.1 amd64 media player based on GStreamer framework
ii psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1 all toolbox for vision research -- arch/interpreter independent part
ii psychtoolbox-3-lib 3.0.11.20131230.dfsg1-1build1 amd64 toolbox for vision research -- arch-specific parts
ii totem 3.10.1-1ubuntu4 amd64 Simple media player for the GNOME desktop based on GStreamer
% vim: ft=matlab
% load movie into a struct
% taken from psychtoolbox3 example
function movie_struct = load_movie(window, moviename)
movie_struct = {};
pixelFormat = [];
maxThreads = [];
preloadsecs = [];
[movie movieduration fps imgw imgh] = Screen('OpenMovie', window, moviename, [], preloadsecs, [], pixelFormat, maxThreads);
movie_struct.movie = movie;
movie_struct.duration = movieduration;
movie_struct.fps = fps;
movie_struct.imgw = imgw;
movie_struct.imgh = imgh;
fprintf('INFO: Movie: %s : %f seconds duration, %f fps, w x h = %i x %i...\n', moviename, movieduration, fps, imgw, imgh);
end
% play frames in that movie
video_file = '/home/o_kan/ifso-stallman-mpeg1_512kb.mp4';
oldSupressAllWarnings = Screen('Preference', 'SuppressAllWarnings', 1);
oldSyncTests = Screen('Preference', 'SkipSyncTests', 2);
AssertOpenGL;
screenNumber=min(Screen('Screens'))
white = WhiteIndex(screenNumber);
[window, wRect] = Screen('OpenWindow',screenNumber, white);
movie = load_movie(window, video_file);
Screen('Flip', window);
shader = [];
loop = 0;
rate = 1.0;
volume = 1.0;
Screen('PlayMovie', movie.movie, rate, loop, volume);
blocking_when_loading_texture = 1;
playing = 1;
while playing
[tex, frameTime] = Screen('GetMovieImage', window, movie.movie, blocking_when_loading_texture);
printf('frameTime=%f\n', frameTime);
if frameTime < 0
playing = 0;
break;
end
Screen('DrawTexture', window, tex);
Screen('Flip', window);
end % while playing
# no problem
http://techslides.com/demos/sample-videos/small.webm
# loaded to
http://archive.org/download/ifso-stallman/ifso-stallman-mpeg1_512kb.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment