Welcome! Log In Create A New Profile

Advanced

video file compatibility

Posted by aboharbf 
video file compatibility
December 01, 2020 05:47PM
Has anyone run into issues presenting .avi files? I recently created some using ffmpeg, and monkeylogic is recognizing it as 'Not supported file type'. other .avis i have (produced via MATLAB, without ffmpeg) work alright. any insights would be appreciated it.
Re: video file compatibility
December 01, 2020 08:11PM
Additional notes

Problem seems to be in mltaskobject code, line 305 -
obj.ID(m) = mgladdmovie(o.Name);


When trying to run this command, it hits some sort of error at line 24 -
id = mdqmex(2,2,filename,buffering_time,device);

This line, rather than spitting out an ID, leads to the delete(obj) method of mltaskobject being called.
Re: video file compatibility
December 01, 2020 08:45PM
Update: Problem solved.

Realizing the problem may have had to do w/ source of videos (and their respective codec use), i investigated and found that the videos having problems use H.264 compression (-c:v libx264 in ffmpeg), whereas those generated by MATLAB use the 'Motion JPEG AVI' (mjpeg) by default (VideoWriter). Switching to the mpjpeg encoding in my ffmpeg script (-c:v mjpeg) generates videos which are now read as normal by MonkeyLogic.

Seems like this should be noted on the TaskObject Doc- [monkeylogic.nimh.nih.gov].
Re: video file compatibility
December 02, 2020 05:32AM
I am glad that you figured it out. AVI, MKV, MP4, etc. are just container formats. To decode the contents in the container, you still need codecs. So, for encoding, you should choose a codec already installed in the target computer.

Matching codecs is an issue in any video playback. Back in the old days, you could easily test the codec compatibility by playing the video on the target computer. But it does not work any more because most of video players include codecs in their binaries for users' convenience these days. So it is possible that you can play the video with your preferred player but not with NIMH ML. To avoid this, it is not a bad idea to install a codec pack on the target computer.
Re: video file compatibility
December 02, 2020 09:01AM
Oooo so MonkeyLogic isn't actually bound by the codec itself, but by whats installed on the machine? Does codec choice effect performance? at the moment, when I run the userloop script and load these files (a few mb's each) it takes about 10 seconds to do so. Perhaps a different codec would perform better. I use VLC to play things so I was confused by it working there and not in ML. Thanks for the explanation.
Re: video file compatibility
December 02, 2020 12:38PM
A codec is a piece of software written to implement a particular compression algorithm, so there can be multiple codecs that work for one algorithm and, of course, their performance is different. Try a different codec if the loading speed is too slow.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.