celia
Junior Member
Registered:1518472659 Posts: 9
Posted 1528259432
Reply with quote
#1
Hello, I'm trying to play compressed .avi videos, like the example attached here, in a task using ML2. The task essentially plays one video clip per trial, without interruptions - I simply call idle(movie_duration) in the timing script. However, after several trials (appx. between 1 and 7), the following error message always appears: <<< MonkeyLogic >>> MovieGraphic, There is no video frame in this file. (mgladdmovie, Line 15) Error using mgladdmovie (line 15) MovieGraphic, There is no video frame in this file.
Error in mltaskobject/createobj (line 527) obj.ID(m) = mgladdmovie(a{2});
Error in mltaskobject (line 33) if isfield(taskobj,'Attribute'), createobj(obj,taskobj,MLConfig,TrialRecord); else createobj_from_struct(obj,taskobj,MLConfig,TrialRecord); end
Error in run_trial (line 95) TaskObject = mltaskobject(taskobject,MLConfig,TrialRecord); Error in monkeylogic/UIcallback (line 1102) result = run_trial(MLConfig,datafile); Error while evaluating UIControl Callback
I've already installed the Standard K-Lite Codec Pack, which fixed my movie-related issues in the past. Any idea what might be going wrong?
Attached Files
example.zip
(4.02 MB, 4 views)
Jaewon
Administrator
Registered:1435685587 Posts: 775
Posted 1528294495
Reply with quote
#2
Please update to the latest package.
celia
Junior Member
Registered:1518472659 Posts: 9
Posted 1528394011
Reply with quote
#3
Hi Jaewon, I've updated to the latest ML2 package, but I'm still having issues. ML2 consistently runs the first trial of the task, selects a condition for the next trial, then crashes with the following error pop-up (before starting the second trial): Any other things I can try?
Jaewon
Administrator
Registered:1435685587 Posts: 775
Posted 1528399446
· Edited
Reply with quote
#4
I have run your movie for ~20 trials, but didn't see a problem. It is a very large, heavily compressed movie. Its uncompressed size is 1.2 GB. Try decreasing its size and encoding with a different compression algorithm so that your computer may handle it easily.
celia
Junior Member
Registered:1518472659 Posts: 9
Posted 1528665048
Reply with quote
#5
I tried compressing again using a different algorithm (with Avidemux ) and got the compressed file size if each clip down to about 1.55 MB. An example is attached here. However, the task still crashes after about seven trials (i.e., seven movies). I have 10 movies in the task folder that is added to my Matlab path, so I think ML2 is only trying to load about 15 MB of movie files in total. Is there anything else I can try?
Attached Files
compressed_example.zip
(1.28 MB, 2 views)
Jaewon
Administrator
Registered:1435685587 Posts: 775
Posted 1528687900
· Edited
Reply with quote
#6
Perhaps my explanation was not sufficient. The error that you first mentioned (MovieGraphic, There is no video frame in this file. ) occurred because there was not enough memory for MATLAB. I fixed something recently related to that issue, so I suggested updating. I don't know why the crashes (the ones you get after the update) happen. There is just not enough information for me. (You can tell me something like your Windows version, MATLAB version, memory size, etc. and provide the script you ran.) From the fact that the memory ran out just in seven trials, I guess your computer may not be powerful enough to handle this big movie. What you need to decrease is the resolution of the video, not the size of the file. Movies should be uncompressed to be displayed on the screen, so the small file size just means that the file is heavily compressed and your computer will need more power to uncompress it. The movie with the 1280 x 720 resolution is huge and the most computers cannot play it seamlessly. Try movies with smaller resolution and see if the problem persists. Again I ran both movies you uploaded above with the script I attach below and didn't have any issue except some skipped frames.
Attached Files
movie_test.zip
(483 Bytes, 2 views)